[llvm] [SPIRV][HLSL] Handle arrays of resources (PR #111564)

Steven Perron via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 12:59:27 PDT 2024


================
@@ -967,11 +1117,16 @@ void addInstrRequirements(const MachineInstr &MI,
   case SPIRV::OpConstantSampler:
     Reqs.addCapability(SPIRV::Capability::LiteralSampler);
     break;
+  case SPIRV::OpAccessChain:
----------------
s-perron wrote:

Okay I added a case for OpInBoundsAccessChain. For now it the same as OpAccessChain. I generally don't think about OpInBoundsAccessChain because in HLSL we can't know that it is inbounds, so we don't generate the opcode. However, other languages might want to use it, so it is best to implement it.

However, I'm not sure how to test it because we do not generate it. I will rely on the testing for OpAccessChain.

https://github.com/llvm/llvm-project/pull/111564


More information about the llvm-commits mailing list