[clang] [HLSL] Get the index for resource bindings from the slot (PR #117303)

Chris B via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 22 07:18:41 PST 2024


================
@@ -588,7 +588,7 @@ llvm::Function *CGHLSLRuntime::createResourceBindingInitFn() {
       auto *Slot = llvm::ConstantInt::get(CGM.IntTy, RBA->getSlotNumber());
       // FIXME: resource arrays are not yet implemented
       auto *Range = llvm::ConstantInt::get(CGM.IntTy, 1);
-      auto *Index = llvm::ConstantInt::get(CGM.IntTy, 0);
+      auto *Index = llvm::ConstantInt::get(CGM.IntTy, RBA->getSlotNumber());
----------------
llvm-beanz wrote:

It might be better to just diverge this by the target. That way the intermediate IR reflects the index correctly.

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


More information about the cfe-commits mailing list