Depends on #182992
During Clang CodeGen, any expression that accesses a resource or resource array member of a global struct instance must be translated to an access of the corresponding implicit global variable.
When CodeGen encounters a MemberExpr of a resource type, it should traverse the AST to locate the parent struct declaration, building the expected global variable name along the way. If the parent is a non-static global struct instance, CodeGen should search its HLSLAssociatedResourceDeclAttr attributes to locate the matching global variable for the resource, and then generate IR code to access it.
Design doc: https://github.com/llvm/wg-hlsl/blob/main/proposals/0038-resources-in-structs.md
Depends on #182992
During Clang CodeGen, any expression that accesses a resource or resource array member of a global struct instance must be translated to an access of the corresponding implicit global variable.
When CodeGen encounters a
MemberExprof a resource type, it should traverse the AST to locate the parent struct declaration, building the expected global variable name along the way. If the parent is a non-static global struct instance, CodeGen should search itsHLSLAssociatedResourceDeclAttrattributes to locate the matching global variable for the resource, and then generate IR code to access it.Design doc: https://github.com/llvm/wg-hlsl/blob/main/proposals/0038-resources-in-structs.md