You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to add constant buffers to the HLSL language spec.
That includes documenting the different ways to declare a constant buffer (cbuffer vs. ConstantBuffer), cbuffer and packoffset grammar, and rules on what exactly is allowed inside a cbuffer declaration.
DXC currently supports quite a few more or less unusual constructs such as:
nested cbuffer declarations
multiple cbuffer declarations with the same name
constants defined outside of cbuffer context (to be placed in $Globals constant buffer and bound to first register b0)
namespace declarations inside cbuffer context
function definitions inside cbuffer context
The spec should clarify which of these are we going to support in Clang.
We need to add constant buffers to the HLSL language spec.
That includes documenting the different ways to declare a constant buffer (
cbuffer
vs.ConstantBuffer
),cbuffer
andpackoffset
grammar, and rules on what exactly is allowed inside acbuffer
declaration.DXC currently supports quite a few more or less unusual constructs such as:
cbuffer
declarationscbuffer
declarations with the same namecbuffer
context (to be placed in$Globals
constant buffer and bound to first registerb0
)cbuffer
contextcbuffer
contextThe spec should clarify which of these are we going to support in Clang.
@tex3d put together an example that these various interesting cases here:
https://godbolt.org/z/E4cdx7xj8
Same shader with FXC:
https://shader-playground.timjones.io/39c0683735c0cd79b5970b5116765940
One difference between FXC and DXC in the nested
cbuffer
case. FXC binds outercbuffer
declaration before the nested one while DXC binds it after.The text was updated successfully, but these errors were encountered: