Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HLSL] Generate AST for Root Signatures #119011

Closed
5 tasks
Tracked by #24 ...
inbelic opened this issue Dec 6, 2024 · 4 comments · Fixed by #134124 · May be fixed by #134293
Closed
5 tasks
Tracked by #24 ...

[HLSL] Generate AST for Root Signatures #119011

inbelic opened this issue Dec 6, 2024 · 4 comments · Fixed by #134124 · May be fixed by #134293
Assignees
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" HLSL HLSL Language Support

Comments

@inbelic
Copy link
Contributor

inbelic commented Dec 6, 2024

This issue handles "plugging-in" the root signature parser into the generation of the AST node. It consists of initializing an HLSLRootSignatureAttr with the parsed HLSLRootElements.

Root signatures are defined as a list of "root elements" and so the in-memory representation will retain this form.

This is dependent on #120472.

AC:

  • Define HLSLRootSignatureAttr in Attr.td
  • Use AdditionalMembers to hold an ArrayRef of HLSLRootElements
  • Define handleHLSLRootSignature in SemaHLSL.h
  • Implement handleHLSLRootSignature in SemaHLSL.cpp to simply invoke the parser and construct the Root Elements on the ASTContext, then set the AdditionalMembers to refence that
  • Add test of a practical root signature example generated AST with ast-dump in AST/HLSL/RootSignatures-AST.hlsl
@inbelic inbelic self-assigned this Dec 6, 2024
@inbelic inbelic moved this to Planning in HLSL Support Dec 6, 2024
@inbelic inbelic added HLSL HLSL Language Support and removed new issue labels Dec 6, 2024
@inbelic
Copy link
Contributor Author

inbelic commented Dec 6, 2024

Self-note for information regarding default values: https://learn.microsoft.com/en-us/windows/win32/direct3d12/specifying-root-signatures-in-hlsl

@davidcook-msft davidcook-msft moved this from Planning to Designing in HLSL Support Dec 17, 2024
@damyanp
Copy link
Contributor

damyanp commented Dec 17, 2024

Feedback from refinement: split this into two issues - one for parsing the root signature string, and then another for adding the attribute and hooking it into the parser.

@inbelic inbelic changed the title [HLSL] Parse and generate AST for Root Signatures [HLSL] Generate AST for Root Signatures Dec 18, 2024
@inbelic inbelic moved this from Designing to Planning in HLSL Support Jan 7, 2025
@davidcook-msft davidcook-msft moved this from Planning to Designing in HLSL Support Jan 7, 2025
@damyanp
Copy link
Contributor

damyanp commented Jan 7, 2025

Needs some information about how ast-dump will be modified to allow for testing.

llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this issue Apr 3, 2025
…ureAttr` (#134124)

- Defines HLSLRootSignature Attr in `Attr.td`
- Define and implement handleHLSLRootSignature in `SemaHLSL`
- Adds sample test case to show AST Node is generated in
`RootSignatures-AST.hlsl`

This commit will "hook-up" the seperately defined RootSignature parser
and invoke it to create the RootElements, then store them on the
ASTContext and finally store the reference to the Elements in
RootSignatureAttr

Resolves llvm/llvm-project#119011

---------

Co-authored-by: Finn Plummer <[email protected]>
@EugeneZelenko EugeneZelenko added the clang:frontend Language frontend issues, e.g. anything involving "Sema" label Apr 3, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 3, 2025

@llvm/issue-subscribers-clang-frontend

Author: Finn Plummer (inbelic)

This issue handles "plugging-in" the root signature parser into the generation of the AST node. It consists of initializing an `HLSLRootSignatureAttr` with the parsed `HLSLRootElements`.

Root signatures are defined as a list of "root elements" and so the in-memory representation will retain this form.

This is dependent on #120472.

AC:

  • Define HLSLRootSignatureAttr in Attr.td
  • Use AdditionalMembers to hold an ArrayRef of HLSLRootElements
  • Define handleHLSLRootSignature in SemaHLSL.h
  • Implement handleHLSLRootSignature in SemaHLSL.cpp to simply invoke the parser and construct the Root Elements on the ASTContext, then set the AdditionalMembers to refence that
  • Add test of a practical root signature example generated AST with ast-dump in AST/HLSL/RootSignatures-AST.hlsl

@inbelic inbelic reopened this Apr 7, 2025
@inbelic inbelic closed this as completed by moving to Closed in HLSL Support Apr 7, 2025
@inbelic inbelic moved this from Closed to Needs Review in HLSL Support Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" HLSL HLSL Language Support
Projects
Status: Needs Review
4 participants