| Issue |
161852
|
| Summary |
[HLSL][SPIRV] NonUniformResourceIndex lowering
|
| Labels |
HLSL,
backend:SPIR-V
|
| Assignees |
s-perron
|
| Reporter |
s-perron
|
We need to implement handle the spv intrinsic add in https://github.com/llvm/llvm-project/pull/159608 in the SPIR-V backend. This intrinsic is used to indicate that the index to the resource array is non uniform. For SPIR-V, this means that we have to add the appropriate capability to the module. Which capability depends on the type of the resource array, and add the decoration to the index, and the access chain that does the indexing.
Most of the code for this is already in the SPIR-V backend. During ISel, in SPIRVInstructionSelector::buildPointerToResource, the `IsNonUniform` is used to trigger all everything. For now, that value is always false.
The new implementation can be:
1. When we see the new intrinsic, apply create a OpCopyObject and add the decoration SPIRV::Decoration::NonUniformEXT to the index.
2. In SPIRVInstructionSelector::buildPointerToResource, remove the `IsNonUniform` parameter. If the index register has the `SPIRV::Decoration::NonUniformEXT` decoration, then add the decoration to the access chain as well.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs