-
Notifications
You must be signed in to change notification settings - Fork 335
[wgsl] update name uniqueness validation rules #1227
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
* v-0004: Recursion is not allowed. | ||
* v-0005: Functions must be declared before use. | ||
* v-0006: Variables must be defined before use. | ||
* v-0005: Types must be declared before use. |
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.
isn't type name an identifier? if so, would the second sentence be a generalization of the first?
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.
That's right. How about I use the rule From https://gpuweb.github.io/gpuweb/wgsl.html#scoping to take all the name uniqueness rules and condense them to one?
fe64fb4
to
b0f4de3
Compare
wgsl/index.bs
Outdated
* v-0028: A fallthrough statement must not appear as the last statement in last clause of a switch. | ||
|
||
* v-0029: Return must come last in its block. | ||
* v-0030: The storage type of a struct containing a runtime-sized array must be a of storage class |
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.
v-0030 isn't quite right. A struct type doesn't have a storage type or store type. A variable has a store type.
I suggest:
If a runtime-sized array appears inside the store type for a variable, then its appearance must be as the last member of the structure type that is the store type for a storage buffer variable. A runtime-sized array must not be the store type of a variable.
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.
Thanks for bringing this up, I created a separated PR to continue our discussions. #1252
b0f4de3
to
ff6e467
Compare
This PR adds unimplemented stubs for the `modf` builtin. Issue: gpuweb#1229 gpuweb#1228 gpuweb#1227 gpuweb#1226
Using the rule From https://gpuweb.github.io/gpuweb/wgsl.html#scoping to take all the name uniqueness rules and condense them to one.