[clang] [llvm] [DirectX] Add resource name argument to llvm.dx.handlefrom[implicit]binding intrinsics (PR #139991)
Justin Bogner via cfe-commits
cfe-commits at lists.llvm.org
Tue May 27 11:40:07 PDT 2025
================
@@ -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
More information about the cfe-commits
mailing list