Skip to content

Proposal for shader semantics #296

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

Keenuts
Copy link
Collaborator

@Keenuts Keenuts commented Jun 18, 2025

This is another proposal on how to implement semantic input in Clang, given DXIL & SPIR-V have drasticly different handlings, but some parts could be shared.

The POC for this implementation is in llvm/llvm-project#149363

Another proposal exists: #112 which also suggest a sema change.

This is another proposal on how to implement semantic input in Clang,
given DXIL & SPIR-V have drasticly different handlings, but some parts
could be shared.

Another proposal exists: llvm#112 which also suggest a sema change.
HLSLAnnotationAttr *Semantic;

// Info about this field/scalar.
DeclaratorDecl *Decl;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be useful to handle the [[vk::location(X)]] attribute. Would be handled later, on top of this.

@Keenuts
Copy link
Collaborator Author

Keenuts commented Jul 2, 2025

Thanks for the review!
I've rewritten the entire proposal to handle both input and outputs, and I also created a branch which implements input & output semantics for HLSL:
https://github.com/Keenuts/llvm-project/tree/hlsl-semantics

@Keenuts Keenuts changed the title Proposal for input semantics Proposal for shader semantics Jul 9, 2025
Copy link
Collaborator

@tex3d tex3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review of comments, thanks for all this work!

@Keenuts
Copy link
Collaborator Author

Keenuts commented Jul 18, 2025

Thanks, rephrased mostly as suggested, reorganized a bit and added more intermediate examples, should be clearer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants