dawn-cmake/test/tint/let/inferred/function.wgsl.expected.wgsl
James Price 3b671cb377 wgsl: Separate struct members with commas
Use of semicolons is still supported, but deprecated.

Also updates the parsing methods for structures to better match the
WGSL grammar.

Bug: tint:1475
Change-Id: I7675ba42c13f91080b0ac173c352e0092021f80b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/84380
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
2022-03-28 14:31:22 +00:00

49 lines
788 B
WebGPU Shading Language

struct MyStruct {
f1 : f32,
}
type MyArray = array<f32, 10>;
fn ret_i32() -> i32 {
return 1;
}
fn ret_u32() -> u32 {
return 1u;
}
fn ret_f32() -> f32 {
return 1.0;
}
fn ret_MyStruct() -> MyStruct {
return MyStruct();
}
fn ret_MyArray() -> MyArray {
return MyArray();
}
fn let_decls() {
let v1 = 1;
let v2 = 1u;
let v3 = 1.0;
let v4 = vec3<i32>(1, 1, 1);
let v5 = vec3<u32>(1u, 1u, 1u);
let v6 = vec3<f32>(1.0, 1.0, 1.0);
let v7 = mat3x3<f32>(v6, v6, v6);
let v8 = MyStruct(1.0);
let v9 = MyArray();
let v10 = ret_i32();
let v11 = ret_u32();
let v12 = ret_f32();
let v13 = ret_MyStruct();
let v14 = ret_MyStruct();
let v15 = ret_MyArray();
}
@stage(fragment)
fn main() -> @location(0) vec4<f32> {
return vec4<f32>(0.0, 0.0, 0.0, 0.0);
}