Skip to content

[HLSL] HLSLResourceBindingAttr is not added to numeric $Globals default constant declarations #128964

@hekota

Description

@hekota

register(c#) annotations on numeric constants in the global scope are not translated to HLSLResourceBindingAttr. This applies to scalar, vector and array constants.

For this code:

float a : register(c5);

[numthreads(4,1,1)]
void main() {
}

The AST should contain HLSLResourceBindingAttr added to the VarDecl for 'a' like this:

...
| |-VarDecl 0x#### <line:1:1, col:7> col:7 a 'hlsl_constant float'
| | `-HLSLResourceBindingAttr 0x#### <col:7> "c5" "space0"
...

https://godbolt.org/z/sfEcEEjK4

Metadata

Metadata

Assignees

No one assigned

    Labels

    HLSLHLSL Language Supportclang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions