[llvm-branch-commits] [clang] [HLSL] Add codegen for accessing resource members of a struct (PR #187127)

Helena Kotas via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Apr 2 18:00:51 PDT 2026


================
@@ -96,24 +97,113 @@ void addRootSignatureMD(llvm::dxbc::RootSignatureVersion RootSigVer,
   RootSignatureValMD->addOperand(MDVals);
 }
 
+// Gived a MemberExpr of a resource or resource array type, find the parent
+// VarDecl of the struct or class instance that contains this resource and
+// build the full resource name based on the member access path.
+//
+// For example, for a member access like "myStructArray[0].memberA",
+// this function will find the VarDecl of "myStructArray" and use the
+// EmbeddedResourceNameBuilder to build the resource name
+// "myStructArray.0.memberA".
+static const VarDecl *getStructResourceParentDeclAndBuildName(
+    const MemberExpr *ME, EmbeddedResourceNameBuilder &NameBuilder) {
----------------
hekota wrote:

I'll rename it to `findStructResourceParentDeclAndBuildName` so it is not just `getX_and_doY`.

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


More information about the llvm-branch-commits mailing list