microsoft / hlsl-specs

HLSL Specifications
MIT License
116 stars 29 forks source link

Add `cbuffer` and `tbuffer` specification to language spec #225

Open llvm-beanz opened 4 months ago

llvm-beanz commented 4 months ago

Which document does this relate to? Draft language specification

Describe the issue you see with the spec We have no specification for cbuffer and tbuffer. The behavior of these structures varies between DXC and FXC, and the Clang implementation is likely again different. We should write a full specification for this feature in the language.

Additional Context We have some issues around cbuffer where we don't have a specification to guide the direction.

simondeschenes commented 3 months ago

Weren't the cbuffer and tbuffer declarations deprecated in favor of ConstantBuffer<T> and TextureBuffer<T>? I thought it was the case in order to unify the syntax with Buffer<T>, StructuredBuffer<T>, ...

llvm-beanz commented 3 months ago

@simondeschenes the new types were added, but the old syntax has never been deprecated and is still widely used.

There is also some complication because the ConstantBuffer<> and TextureBuffer<> types have syntax that relies on special-cased language behaviors for those types, which is super gross.