Vulkan GLSL: uniform block with push_constant
allocation
#12
Labels
kind:enhancement
a desirable new feature, option, or behavior
push_constant
allocation
#12
Both Vulkan and D3D12 share the idea that "push constants" ("root constants") are exposed to the shading language as ordinary uniform blocks (
cbuffer
s). In D3D12 the actual assignment of a buffer to root constant resources is handled at the API level, while in Vulkan all of the binding to API-level resources is handled inlayout
modifiers.A GLSL
uniform
block decorated withlayout(push_constant)
:consumes different resources from an ordinary uniform block. This needs to be accounted for in a few places:
push_constant
layout modifier into a form visible to semanticsParameterBinding.cpp
and/orTypeLayout.cpp
logic needs to allocate resources differently for these blocksPushConstant
) for members of the blockThe existing reflection API should be able to handle this case.
Actually, one parting shot: it might be worthwhile to go ahead and detect this modifier during parsing, so that we can break out a distinct type for the
push_constant
block like what we do forin
andout
blocks already. That would probably simplify a lot of the logic because the block would no longer surface as an "ordinary" uniform block.The text was updated successfully, but these errors were encountered: