Override-expressions for Fixed Size Arrays#6654
Conversation
…le macros for exhaustive matching
teoxoy
left a comment
There was a problem hiding this comment.
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
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
Pendingstate 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 testto run tests.CHANGELOG.md. See simple instructions inside file.