[SPIR-V] SPIRV-Val is complaining that OpTypeStruct must not contain an opaque type
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Currently, when compiling HLSL structures or constant buffers that contain opaque resource types (like RWBuffer or Texture2D) to SPIR-V, the compiler generates standard Vulkan SPIR-V which strictly forbids opaque types inside structures. This results in a validation error (VUID-StandaloneSpirv-None-04667).
As a result we are seeing these errors on the offload test suite
https://github.com/llvm/offload-test-suite/actions/runs/24995356633/job/73190808526#step:13:597
```
# .---command stderr------------
# | error: line 29: [VUID-StandaloneSpirv-None-04667] In Vulkan, OpTypeStruct must not contain an opaque type.
# | %class_hlsl__RWBuffer = OpTypeStruct %spirv_SignedImage
# |
# | clang-dxc: error: spirv-val command failed with exit code 1 (use -v to see invocation)
# `-----------------------------
# error: command failed with exit status: 1
```
This is a validator complaint from `spirv-val`.
## Tests impacted
```
OffloadTest-clang-vk :: Feature/ResourcesInStructs/array-of-structs-with-res.test
OffloadTest-clang-vk :: Feature/ResourcesInStructs/res-array-of-matrix-in-struct.test
OffloadTest-clang-vk :: Feature/ResourcesInStructs/res-in-struct-mix.test
OffloadTest-clang-vk :: Feature/ResourcesInStructs/res-in-struct-simple-array.test
OffloadTest-clang-vk :: Feature/ResourcesInStructs/res-in-struct-simple-one.test
```
CC: @s-perron @Keenuts
Contributor guide
Assessment
This issue has not been assessed yet.