llvm / llvm/llvm-project

[SPIR-V] Validator failure: Invalid use of VariablePointersStorageBuffer capability

Open
#202,064 1 comment 0 reactions 1 assignee Claimed by @hekota View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.