cts
cts copied to clipboard
wgsl: address space names are not keywords
Example: this should work:
const function = 1;
const private = 1;
const workgroup = 1;
const storage = 1;
const uniform = 1;
const handle = 1;
@group(0) @binding(0) var<storage,read_write> buf: array<i32,6>;
@compute @workgroup_size(1)
fn main() {
buf[0] = function;
buf[1] = private;
buf[2] = workgroup;
buf[3] = storage;
buf[4] = uniform;
buf[5] = handle;
}
In general, we can do this for context-dependent names.
I suggest we update https://github.com/gpuweb/cts/blob/main/src/webgpu/shader/validation/parse/identifiers.spec.ts to:
- add anything that is a predeclared 'enum' to the kValidIdentifiers
- But we have to be careful to avoid clashes, e.g. in the module-scope var test, it currently does
var<private> ...
- But we have to be careful to avoid clashes, e.g. in the module-scope var test, it currently does
This is covered in #3600