cts
cts copied to clipboard
wgsl: Validate variable and value declaration parsing
- [ ]
var a; - [x]
var a:i32;-- passes - [ ]
var i32:f32; - [ ]
var :i32; - [ ]
var a:invalid; - [ ]
var function> a:i32; - [ ]
var<> a:i32; - [ ]
var<function a:i32; - [ ]
var<invalid> a:i32; - [ ]
var<storage,> a:i32; - [ ]
var<storage,invalid> a:i32; - [x]
var<storage,read_write> a:i32;-- passes - [ ]
var<function,read_write> a:i32; - [ ]
var<function> :i32; - [x]
var a = 123;-- passes - [ ]
var a = invalid; - [ ]
var a:i32 = 1.0; - [ ]
let = 1; - [ ]
let a 1; - [ ]
let a =; - [ ]
let a; - [ ]
let a = 9ba; - [ ]
let a i32; - [ ]
let a := 123; - [x]
let a = 123;-- passes - [x]
let a:i32=123;--passes; - [x]
let a:i32; - [ ]
let a:invalid; - [ ]
let/* comment*/a/*comment*/:/* */i32/**/=/**/123; - [ ]
const a = 123;-- passes - [x]
const a:i32 = 1;-- passes - [x]
const a:i32 = 1.0; - [ ]
const :i32 = 1; - [ ]
const a; - [x]
const a:i32; - [ ]
const a i32 = 1; - [ ]
const a:=1;
Globals
-
[ ] invalid attribute
-
[x] valid attribute passes
-
[x] multiple attributes passes
-
[ ]
override a; -
[x]
override a = 1;-- passes -
[ ]
override a:=1; -
[x]
override a:i32=1;-- passes -
[ ]
override a = invalid; -
[ ]
override a:i32 1; -
[ ]
override i32 = 2; -
[x]
override a: i32 = 1.0f; -
[ ]
override a i32 = 1; -
https://www.w3.org/TR/WGSL/#var-and-value-decl-grammar
- https://github.com/gpuweb/cts/blob/main/src/webgpu/shader/validation/decl/var.spec.ts
- https://github.com/gpuweb/cts/blob/main/src/webgpu/shader/validation/decl/let.spec.ts
- https://github.com/gpuweb/cts/blob/main/src/webgpu/shader/validation/parse/var_and_let.spec.ts
- https://github.com/gpuweb/cts/blob/main/src/webgpu/shader/validation/decl/const.spec.ts
- https://github.com/gpuweb/cts/blob/main/src/webgpu/shader/validation/decl/override.spec.ts