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

Fix WGSL entry point parameter location attributes #6116

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

fairywreath
Copy link
Contributor

@fairywreath fairywreath commented Jan 17, 2025

Closes #5933.

For WGSL entry points, location attributes are only applied to struct parameters. This is a side-effect of reusing code from Metal, where the same behavior applies, but Metal legalization performs packing of all parameters to a common struct first hence all parameters are appropriately assigned attributes, while WGSL does not perform packing and some parameters are not assigned attributes.

This change applies Metal's hoisting and packing logic to WGSL's entry point legalization.

@fairywreath fairywreath requested a review from a team as a code owner January 17, 2025 05:02
@fairywreath fairywreath marked this pull request as draft January 17, 2025 05:05
@fairywreath fairywreath marked this pull request as ready for review January 17, 2025 05:10
Copy link
Collaborator

@csyonghe csyonghe left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@csyonghe csyonghe added the pr: non-breaking PRs without breaking changes label Jan 17, 2025
@csyonghe csyonghe merged commit 9143087 into shader-slang:master Jan 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: non-breaking PRs without breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wgsl @location attribute not emitted for entry-point varyings
2 participants