Skip to content

[HLSL] Align implementation of cbuffer declarations with spec #162572

@bogner

Description

@bogner

Consider https://hlsl.godbolt.org/z/x6sT7baY8:

// -T cs_6_4
cbuffer Bar {
  namespace NS {
    float i;
  }
}
RWStructuredBuffer<float> Out;

[numthreads(1,1,1)]
void main() {
  Out[0] = NS::i;
}

As per microsoft/hlsl-specs#671, namespaces nested inside cbuffer decls are allowed. We shouldn't error on them.

The fix should be as simple as updating validateDeclsInsideHLSLBuffer to stop explicitly disallowing them.

Metadata

Metadata

Assignees

Labels

HLSLHLSL Language Support

Type

No type

Projects

Status

Active

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions