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

Vyacheslav Levytskyy via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 11:39:40 PDT 2024


================
@@ -967,11 +1117,16 @@ void addInstrRequirements(const MachineInstr &MI,
   case SPIRV::OpConstantSampler:
     Reqs.addCapability(SPIRV::Capability::LiteralSampler);
     break;
+  case SPIRV::OpAccessChain:
+    addOpAccessChainReqs(MI, Reqs, ST);
+    break;
   case SPIRV::OpTypeImage:
     addOpTypeImageReqs(MI, Reqs, ST);
     break;
   case SPIRV::OpTypeSampler:
-    Reqs.addCapability(SPIRV::Capability::ImageBasic);
+    if (ST.isOpenCLEnv()) {
----------------
VyacheslavLevytskyy wrote:

It's a subtle difference, but recently there were so many talks about "computational flavor of SPIRV but not OpenCL" that I'd probably use rather `!isVulkanEnv()` than `isOpenCLEnv()`. Please feel to ignore though, because at the moment we have just those 2 checks and nobody hasn't yet mentioned enhancing `isOpenCLEnv()` to OpenCL and Non OpenCL.

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


More information about the llvm-commits mailing list