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

Steven Perron via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 22 07:36:18 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());
----------------
s-perron wrote:

Diverging is fine. We will have to diverge when identifying the slots anyway. Because we keep samplers and textures in the same "space", we will need a more complicated way of determining the right space and slot. Plus we will eventually at the `vk::binding` attribute which to be another consideration.

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


More information about the cfe-commits mailing list