[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 17:58:56 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:
Sorry! I understand, but I think it make sense to construct the name as the same time as we are walking the AST looking for the parent.
https://github.com/llvm/llvm-project/pull/187127
More information about the llvm-branch-commits
mailing list