Skip to content

[HLSL] Codegen for accessing resource members of a struct #182989

@hekota

Description

@hekota

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

Metadata

Metadata

Assignees

Labels

HLSLHLSL Language Supportclang:codegenIR generation bugs: mangling, exceptions, etc.clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

Type

No type
No fields configured for issues without a type.

Projects

Status
Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions