[SPIR-V] Validator failure: Invalid use of VariablePointersStorageBuffer capability
Open
backend:SPIR-V
clang:HLSL:SPIRV
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Example:
```hlsl
struct A {
RWStructuredBuffer Buf;
};
A a1;
A a2;
[numthreads(1,1,1)]
void main() {
int3x2 m = a1.Buf[0];
a2.Buf[0] = m * 2;
}
```
Error:
```
error: line 96: In Logical addressing, variables can only allocate a storage buffer pointer if the VariablePointersStorageBuffer capability is declared
%a1 = OpVariable %_ptr_Function_struct_A Function %49
```
HLSL to SPIR-V: https://hlsl.godbolt.org/z/79WcK3sxx
spirv-val: https://hlsl.godbolt.org/z/Mqxos9qG4
Contributor guide
Assessment
This issue has not been assessed yet.