================
@@ -539,19 +537,29 @@ static void initializeBuffer(CodeGenModule &CGM,
llvm::GlobalVariable *GV,
}
static void initializeBufferFromBinding(CodeGenModule &CGM,
- llvm::GlobalVariable *GV, unsigned
Slot,
- unsigned Space) {
+ llvm::GlobalVariable *GV,
+ HLSLResourceBindingAttr *RBA) {
llvm::Type *Int1Ty = llvm::Type::getInt1Ty(CGM.getLLVMContext());
- llvm::Value *Args[] = {
- llvm::ConstantInt::get(CGM.IntTy, Space), /* reg_space */
- llvm::ConstantInt::get(CGM.IntTy, Slot), /* lower_bound */
- llvm::ConstantInt::get(CGM.IntTy, 1), /* range_size */
- llvm::ConstantInt::get(CGM.IntTy, 0), /* index */
- llvm::ConstantInt::get(Int1Ty, false) /* non-uniform */
- };
- initializeBuffer(CGM, GV,
- CGM.getHLSLRuntime().getCreateHandleFromBindingIntrinsic(),
- Args);
+ auto *NonUniform = llvm::ConstantInt::get(Int1Ty, false);
+ auto *Index = llvm::ConstantInt::get(CGM.IntTy, 0);
+ auto *RangeSize = llvm::ConstantInt::get(CGM.IntTy, 1);
+ auto *Space =
+ llvm::ConstantInt::get(CGM.IntTy, RBA ? RBA->getSpaceNumber() : 0);
+
+ if (RBA->hasRegisterSlot()) {
----------------
hekota wrote:
Thanks @shafik for following up! I was planning to fix this before I left on
vacation but didn't get to it.
https://github.com/llvm/llvm-project/pull/139022
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits