Issue 147717
Summary [SPIRV] The clang-dxc enables SPV extension not allowed in Vulkan
Labels HLSL, backend:SPIR-V
Assignees s-perron
Reporter s-perron
    When the `-fspv-extension` is not on the command line it is suppose to enable "all" SPIR-V extensions. This is implemented in Clang by passing the `-spv-ext=all` to the SPIR-V backend. In the DXC context, this did not require any qualifications because if an extension was not used in Vulkan, it was not part of the compiler. However, the SPIR-V backend in Clang generates code for OpenCL as well, and uses extensions that are not allowed in Vulkan.

See https://godbolt.org/z/E1484Pqan for an example. The SPV_KHR_no_integer_wrap_decoration extension is generated, but it is not legal.

```
RWBuffer<int> sb;

[numthreads(1,1,1)]
void main() {
 sb[0] = -sb[1];
}
```

This needs to be fixed. I see two options based on whose responsibility it is to limit "all" extensions to just those allowed in Vulkan.

1. The SPIR-V backend will have two list for the SPIRVExtensionMap. 

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to