| Issue |
241741
|
| Summary |
[hlsl][spirv] Resource names are emitted as byte arrays in spir-v output
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
rj123-nv
|
Since the handlefrombinding and similar intrinsics take a string argument, when these are lowered to SPIR-V in the backend, the string name operand becomes the OpName associated with the global but also gets emitted as an array of bytes.
The only relevant thing to emit is the OpName instruction with the string literal.
Repro:
```
RWStructuredBuffer<uint> buf : register(u0);
[numthreads(1, 1, 1)]
void main() {
buf[0] = 1;
}
```
clang --driver-mode=dxc -spirv -T cs_6_0 -E main -O3 -fspv-target-env=vulkan1.3 repro.hlsl
relevant SPIR-V:
```
OpCapability Int8
...
OpName %buf "buf"
...
%uchar_0 = OpConstant %uchar 0
%uchar_102 = OpConstant %uchar 102
%uchar_117 = OpConstant %uchar 117
%uchar_98 = OpConstant %uchar 98
...
%21 = OpConstantComposite %_arr_uchar_uint_4 %uchar_98 %uchar_117 %uchar_102 %uchar_0
```
This will inadvertently require the int8 capability, so a Vulkan application that doesn't request that feature on the app side could have issues/will have validation warnings.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs