[wgsl] update name uniqueness validation rules#1227
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.
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.
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.
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.
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.