[llvm-branch-commits] [clang] [HLSL] Add implicit binding attribute to resource arrays (PR #152452)

Joshua Batista via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Aug 7 11:13:41 PDT 2025


================
@@ -3640,6 +3655,24 @@ void SemaHLSL::ActOnVariableDeclarator(VarDecl *VD) {
 
     // process explicit bindings
     processExplicitBindingsOnDecl(VD);
+
+    if (VD->getType()->isHLSLResourceRecordArray()) {
+      // If the resource array does not have an explicit binding attribute,
+      // create an implicit one. It will be used to transfer implicit binding
+      // order_ID to codegen.
+      if (!VD->hasAttr<HLSLVkBindingAttr>()) {
----------------
bob80905 wrote:

Shouldn't this check if it's missing HLSLResourceBindingAttr? Or is this saying that HLSLVkBindingAttr is only added when a binding attribute is explicitly spelled out?

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


More information about the llvm-branch-commits mailing list