-
Notifications
You must be signed in to change notification settings - Fork 353
Restrict contents of array and struct #1411
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
Conversation
wgsl/index.bs
Outdated
|
|
||
| An array element type must not be: | ||
|
|
||
| * The [=void=] type. |
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.
This is a bit of a laundry list.
I could have defined a new concept such as a "concrete" type.
However, I expect WGSL will soon have to support arrays of textures and arrays of samplers, so the category isn't going to be particularly stable.
| These may only appear in specific contexts.<br> | ||
| </table> | ||
|
|
||
| An array element type must be one of: |
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.
I assume this set of types is going to show up a lot. I.e. the same should apply to structure members, function arguments, etc. Can we have a common definition for this?
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 have two cases in this PR.
The closest analog in SPIR-V is "concrete" type. (That also covers a physical pointer, which is not in WSGL). I think we should keep an eye on this and if we get a lot more cases then we'll add a definition.
Define array and structure types in a positive sense. (Use an allow-list of subtypes instead of a deny-list.) Fixes gpuweb#1409
|
Rebased to avoid merge conflicts. |
|
The change was approved in the WGSL meeting of 2021-02-16 |
Fixes #1409