================ @@ -557,29 +553,47 @@ static void initializeBuffer(CodeGenModule &CGM, llvm::GlobalVariable *GV, CGM.AddCXXGlobalInit(InitResFunc); } -static void initializeBufferFromBinding(CodeGenModule &CGM, - llvm::GlobalVariable *GV, - HLSLResourceBindingAttr *RBA) { +void CGHLSLRuntime::initializeBufferFromBinding(const HLSLBufferDecl *BufDecl, + llvm::GlobalVariable *GV, + HLSLResourceBindingAttr *RBA) { llvm::Type *Int1Ty = llvm::Type::getInt1Ty(CGM.getLLVMContext()); 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); + Value *Name = nullptr; + + // DXIL intrinsic includes resource name + if (getArch() == Triple::dxil) { ---------------- bogner wrote:
Ideally we could use the same method of checking if the name is needed as in CGHLSLBuiltins here. https://github.com/llvm/llvm-project/pull/139991 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits