================ @@ -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()); ---------------- s-perron wrote:
This is not the way I implemented this for SPIR-V. This assumes the `Slot` and `Index` as interwined, which they are in DXIL, but not in SPIR-V. In SPIR-V, the `Slot` is the binding number, and all elements of the resource array are accessed through the same binding number. The element does not get their own binding number. The binding and index are independent. Would it be possible to keep this as is, and have the DXIL backend add the slot number to the index? https://github.com/llvm/llvm-project/pull/117303 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits