Issue 176062
Summary [HLSL] Erroneous register validation warning on structs with resources in base class
Labels HLSL
Assignees
Reporter hekota
    Register type validation does not seem to be scanning base classes when looking for resources in a structure/class. The following code is valid and in Clang it produces two warnings.

```
struct A {
  RWBuffer<int> BufA;
 StructuredBuffer<int> BufB;
};

struct B : A {
};

B b : register(u10) : register(t20);

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

Warnings reported:
```
<source>:9:3: warning: binding type 'u' only applies to types containing UAV resources [-Wlegacy-constant-register-binding]
    9 | B b : register(u10) : register(t20);
      |   ^
<source>:9:3: warning: binding type 't' only applies to types containing SRV resources [-Wlegacy-constant-register-binding]
2 warnings generated.
``` 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to