-
Notifications
You must be signed in to change notification settings - Fork 943
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
Override-expressions for Fixed Size Arrays #6654
Conversation
…le macros for exhaustive matching
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to validate that arrays of this form are only declared on workgroup variables. They also can't be nested. I think this can be done via a new TypeFlags
implementing the spec's distinction between "creation-fixed footprint" and "fixed footprint".
see https://www.w3.org/TR/WGSL/#fixed-footprint-types & https://www.w3.org/TR/WGSL/#example-workgroup-variables-sized-by-override
There is also this note in the spec:
I think to make this work we'd have to make |
You were right, that was much easier, sorry for the force push |
bf89b36
to
1958c2b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
This pull request is still a work in progress, but is open to avoid others repeating work that's already been done.
Connections
Resolves #5315
Description
The WebGPU spec allows for arrays to have a fixed size specified by an override-expression. This PR implements this by adding a
Pending
state to array sizes, which gets resolved with the rest of the override-expressions.Testing
This change is tested by checking that a 1d spiral is correctly stored.
Checklist
cargo fmt
.taplo format
.cargo clippy
. If applicable, add:cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.