diff --git a/src/ast/module_clone_test.cc b/src/ast/module_clone_test.cc index fc6117ed8b..d89f9d993a 100644 --- a/src/ast/module_clone_test.cc +++ b/src/ast/module_clone_test.cc @@ -48,12 +48,9 @@ var g5 : [[access(read)]] texture_storage_2d; var g6 : [[access(write)]] texture_storage_2d; [[builtin(position)]] var g7 : vec3; -[[group(10), binding(20)]] var g8 : [[access(write)]] -S; -[[group(10), binding(20)]] var g9 : [[access(read)]] -S; -[[group(10), binding(20)]] var g10 : [[access(read_write)]] -S; +[[group(10), binding(20)]] var g8 : [[access(write)]] S; +[[group(10), binding(20)]] var g9 : [[access(read)]] S; +[[group(10), binding(20)]] var g10 : [[access(read_write)]] S; fn f0(p0 : bool) -> f32 { if (p0) { diff --git a/src/transform/binding_remapper_test.cc b/src/transform/binding_remapper_test.cc index 4d36ccdd1e..bb7a20c1c5 100644 --- a/src/transform/binding_remapper_test.cc +++ b/src/transform/binding_remapper_test.cc @@ -30,11 +30,9 @@ TEST_F(BindingRemapperTest, NoRemappings) { struct S { }; -[[group(2), binding(1)]] var a : [[access(read)]] -S; +[[group(2), binding(1)]] var a : [[access(read)]] S; -[[group(3), binding(2)]] var b : [[access(read)]] -S; +[[group(3), binding(2)]] var b : [[access(read)]] S; [[stage(compute)]] fn f() { @@ -57,11 +55,9 @@ TEST_F(BindingRemapperTest, RemapBindingPoints) { struct S { }; -[[group(2), binding(1)]] var a : [[access(read)]] -S; +[[group(2), binding(1)]] var a : [[access(read)]] S; -[[group(3), binding(2)]] var b : [[access(read)]] -S; +[[group(3), binding(2)]] var b : [[access(read)]] S; [[stage(compute)]] fn f() { @@ -73,11 +69,9 @@ fn f() { struct S { }; -[[group(1), binding(2)]] var a : [[access(read)]] -S; +[[group(1), binding(2)]] var a : [[access(read)]] S; -[[group(3), binding(2)]] var b : [[access(read)]] -S; +[[group(3), binding(2)]] var b : [[access(read)]] S; [[stage(compute)]] fn f() { @@ -103,14 +97,11 @@ TEST_F(BindingRemapperTest, RemapAccessControls) { struct S { }; -[[group(2), binding(1)]] var a : [[access(read)]] -S; +[[group(2), binding(1)]] var a : [[access(read)]] S; -[[group(3), binding(2)]] var b : [[access(write)]] -S; +[[group(3), binding(2)]] var b : [[access(write)]] S; -[[group(4), binding(3)]] var c : [[access(read)]] -S; +[[group(4), binding(3)]] var c : [[access(read)]] S; [[stage(compute)]] fn f() { @@ -122,14 +113,11 @@ fn f() { struct S { }; -[[group(2), binding(1)]] var a : [[access(write)]] -S; +[[group(2), binding(1)]] var a : [[access(write)]] S; -[[group(3), binding(2)]] var b : [[access(write)]] -S; +[[group(3), binding(2)]] var b : [[access(write)]] S; -[[group(4), binding(3)]] var c : [[access(read)]] -S; +[[group(4), binding(3)]] var c : [[access(read)]] S; [[stage(compute)]] fn f() { @@ -157,11 +145,9 @@ TEST_F(BindingRemapperTest, DISABLED_RemapAccessControlsWithAliases) { struct S { }; -type ReadOnlyS = [[access(read)]] -S; +type ReadOnlyS = [[access(read)]] S; -type WriteOnlyS = [[access(write)]] -S; +type WriteOnlyS = [[access(write)]] S; type A = S; @@ -181,16 +167,13 @@ fn f() { struct S { }; -type ReadOnlyS = [[access(read)]] -S; +type ReadOnlyS = [[access(read)]] S; -type WriteOnlyS = [[access(write)]] -S; +type WriteOnlyS = [[access(write)]] S; type A = S; -[[group(2), binding(1)]] var a : [[access(write)]] -S; +[[group(2), binding(1)]] var a : [[access(write)]] S; [[group(3), binding(2)]] var b : WriteOnlyS; @@ -220,11 +203,9 @@ TEST_F(BindingRemapperTest, RemapAll) { struct S { }; -[[group(2), binding(1)]] var a : [[access(read)]] -S; +[[group(2), binding(1)]] var a : [[access(read)]] S; -[[group(3), binding(2)]] var b : [[access(read)]] -S; +[[group(3), binding(2)]] var b : [[access(read)]] S; [[stage(compute)]] fn f() { @@ -236,11 +217,9 @@ fn f() { struct S { }; -[[group(4), binding(5)]] var a : [[access(write)]] -S; +[[group(4), binding(5)]] var a : [[access(write)]] S; -[[group(6), binding(7)]] var b : [[access(write)]] -S; +[[group(6), binding(7)]] var b : [[access(write)]] S; [[stage(compute)]] fn f() { @@ -268,10 +247,8 @@ TEST_F(BindingRemapperTest, NoData) { struct S { }; -[[group(2), binding(1)]] var a : [[access(read)]] -S; -[[group(3), binding(2)]] var b : [[access(read)]] -S; +[[group(2), binding(1)]] var a : [[access(read)]] S; +[[group(3), binding(2)]] var b : [[access(read)]] S; [[stage(compute)]] fn f() {} diff --git a/src/transform/bound_array_accessors_test.cc b/src/transform/bound_array_accessors_test.cc index 72f2db131b..bda6258987 100644 --- a/src/transform/bound_array_accessors_test.cc +++ b/src/transform/bound_array_accessors_test.cc @@ -540,8 +540,7 @@ struct S { a : f32; b : array; }; -var s : [[access(read)]] -S; +var s : [[access(read)]] S; fn f() { var d : f32 = s.b[25]; @@ -555,8 +554,7 @@ struct S { b : array; }; -var s : [[access(read)]] -S; +var s : [[access(read)]] S; fn f() { var d : f32 = s.b[min(u32(25), (arrayLength(s.b) - 1u))]; @@ -603,8 +601,7 @@ struct S { b : array; }; -var s : [[access(read)]] -S; +var s : [[access(read)]] S; let c : u32 = 1u; @@ -622,8 +619,7 @@ struct S { b : array; }; -var s : [[access(read)]] -S; +var s : [[access(read)]] S; let c : u32 = 1u; diff --git a/src/transform/calculate_array_length_test.cc b/src/transform/calculate_array_length_test.cc index 91f1291749..7aefa51736 100644 --- a/src/transform/calculate_array_length_test.cc +++ b/src/transform/calculate_array_length_test.cc @@ -30,8 +30,7 @@ struct SB { arr : array; }; -var sb : [[access(read)]] -SB; +var sb : [[access(read)]] SB; [[stage(vertex)]] fn main() { @@ -49,8 +48,7 @@ struct SB { [[internal(intrinsic_buffer_size)]] fn tint_symbol(buffer : SB, result : ptr) -var sb : [[access(read)]] -SB; +var sb : [[access(read)]] SB; [[stage(vertex)]] fn main() { @@ -74,8 +72,7 @@ struct SB { arr : array; }; -var sb : [[access(read)]] -SB; +var sb : [[access(read)]] SB; [[stage(vertex)]] fn main() { @@ -95,8 +92,7 @@ struct SB { [[internal(intrinsic_buffer_size)]] fn tint_symbol(buffer : SB, result : ptr) -var sb : [[access(read)]] -SB; +var sb : [[access(read)]] SB; [[stage(vertex)]] fn main() { @@ -123,8 +119,7 @@ struct SB { arr : [[stride(64)]] array; }; -var sb : [[access(read)]] -SB; +var sb : [[access(read)]] SB; [[stage(vertex)]] fn main() { @@ -143,8 +138,7 @@ struct SB { [[internal(intrinsic_buffer_size)]] fn tint_symbol(buffer : SB, result : ptr) -var sb : [[access(read)]] -SB; +var sb : [[access(read)]] SB; [[stage(vertex)]] fn main() { @@ -168,8 +162,7 @@ struct SB { arr : array; }; -var sb : [[access(read)]] -SB; +var sb : [[access(read)]] SB; [[stage(vertex)]] fn main() { @@ -193,8 +186,7 @@ struct SB { [[internal(intrinsic_buffer_size)]] fn tint_symbol(buffer : SB, result : ptr) -var sb : [[access(read)]] -SB; +var sb : [[access(read)]] SB; [[stage(vertex)]] fn main() { @@ -233,11 +225,9 @@ struct SB2 { arr2 : array>; }; -var sb1 : [[access(read)]] -SB1; +var sb1 : [[access(read)]] SB1; -var sb2 : [[access(read)]] -SB2; +var sb2 : [[access(read)]] SB2; [[stage(vertex)]] fn main() { @@ -266,11 +256,9 @@ struct SB2 { [[internal(intrinsic_buffer_size)]] fn tint_symbol_3(buffer : SB2, result : ptr) -var sb1 : [[access(read)]] -SB1; +var sb1 : [[access(read)]] SB1; -var sb2 : [[access(read)]] -SB2; +var sb2 : [[access(read)]] SB2; [[stage(vertex)]] fn main() { diff --git a/src/transform/decompose_storage_access_test.cc b/src/transform/decompose_storage_access_test.cc index 29bbc781d8..683b69928f 100644 --- a/src/transform/decompose_storage_access_test.cc +++ b/src/transform/decompose_storage_access_test.cc @@ -50,8 +50,7 @@ struct SB { v : array, 2>; }; -var sb : [[access(read_write)]] -SB; +var sb : [[access(read_write)]] SB; [[stage(compute)]] fn main() { @@ -108,117 +107,91 @@ struct SB { }; [[internal(intrinsic_load_i32)]] -fn tint_symbol(buffer : [[access(read_write)]] -SB, offset : u32) -> i32 +fn tint_symbol(buffer : [[access(read_write)]] SB, offset : u32) -> i32 [[internal(intrinsic_load_u32)]] -fn tint_symbol_1(buffer : [[access(read_write)]] -SB, offset : u32) -> u32 +fn tint_symbol_1(buffer : [[access(read_write)]] SB, offset : u32) -> u32 [[internal(intrinsic_load_f32)]] -fn tint_symbol_2(buffer : [[access(read_write)]] -SB, offset : u32) -> f32 +fn tint_symbol_2(buffer : [[access(read_write)]] SB, offset : u32) -> f32 [[internal(intrinsic_load_vec2_i32)]] -fn tint_symbol_3(buffer : [[access(read_write)]] -SB, offset : u32) -> vec2 +fn tint_symbol_3(buffer : [[access(read_write)]] SB, offset : u32) -> vec2 [[internal(intrinsic_load_vec2_u32)]] -fn tint_symbol_4(buffer : [[access(read_write)]] -SB, offset : u32) -> vec2 +fn tint_symbol_4(buffer : [[access(read_write)]] SB, offset : u32) -> vec2 [[internal(intrinsic_load_vec2_f32)]] -fn tint_symbol_5(buffer : [[access(read_write)]] -SB, offset : u32) -> vec2 +fn tint_symbol_5(buffer : [[access(read_write)]] SB, offset : u32) -> vec2 [[internal(intrinsic_load_vec3_i32)]] -fn tint_symbol_6(buffer : [[access(read_write)]] -SB, offset : u32) -> vec3 +fn tint_symbol_6(buffer : [[access(read_write)]] SB, offset : u32) -> vec3 [[internal(intrinsic_load_vec3_u32)]] -fn tint_symbol_7(buffer : [[access(read_write)]] -SB, offset : u32) -> vec3 +fn tint_symbol_7(buffer : [[access(read_write)]] SB, offset : u32) -> vec3 [[internal(intrinsic_load_vec3_f32)]] -fn tint_symbol_8(buffer : [[access(read_write)]] -SB, offset : u32) -> vec3 +fn tint_symbol_8(buffer : [[access(read_write)]] SB, offset : u32) -> vec3 [[internal(intrinsic_load_vec4_i32)]] -fn tint_symbol_9(buffer : [[access(read_write)]] -SB, offset : u32) -> vec4 +fn tint_symbol_9(buffer : [[access(read_write)]] SB, offset : u32) -> vec4 [[internal(intrinsic_load_vec4_u32)]] -fn tint_symbol_10(buffer : [[access(read_write)]] -SB, offset : u32) -> vec4 +fn tint_symbol_10(buffer : [[access(read_write)]] SB, offset : u32) -> vec4 [[internal(intrinsic_load_vec4_f32)]] -fn tint_symbol_11(buffer : [[access(read_write)]] -SB, offset : u32) -> vec4 +fn tint_symbol_11(buffer : [[access(read_write)]] SB, offset : u32) -> vec4 [[internal(intrinsic_load_vec2_f32)]] -fn tint_symbol_12(buffer : [[access(read_write)]] -SB, offset : u32) -> vec2 +fn tint_symbol_12(buffer : [[access(read_write)]] SB, offset : u32) -> vec2 -fn tint_symbol_13(buffer : [[access(read_write)]] -SB, offset : u32) -> mat2x2 { +fn tint_symbol_13(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x2 { return mat2x2(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 8u))); } [[internal(intrinsic_load_vec3_f32)]] -fn tint_symbol_14(buffer : [[access(read_write)]] -SB, offset : u32) -> vec3 +fn tint_symbol_14(buffer : [[access(read_write)]] SB, offset : u32) -> vec3 -fn tint_symbol_15(buffer : [[access(read_write)]] -SB, offset : u32) -> mat2x3 { +fn tint_symbol_15(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x3 { return mat2x3(tint_symbol_14(buffer, (offset + 0u)), tint_symbol_14(buffer, (offset + 16u))); } [[internal(intrinsic_load_vec4_f32)]] -fn tint_symbol_16(buffer : [[access(read_write)]] -SB, offset : u32) -> vec4 +fn tint_symbol_16(buffer : [[access(read_write)]] SB, offset : u32) -> vec4 -fn tint_symbol_17(buffer : [[access(read_write)]] -SB, offset : u32) -> mat2x4 { +fn tint_symbol_17(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x4 { return mat2x4(tint_symbol_16(buffer, (offset + 0u)), tint_symbol_16(buffer, (offset + 16u))); } -fn tint_symbol_18(buffer : [[access(read_write)]] -SB, offset : u32) -> mat3x2 { +fn tint_symbol_18(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x2 { return mat3x2(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 8u)), tint_symbol_12(buffer, (offset + 16u))); } -fn tint_symbol_19(buffer : [[access(read_write)]] -SB, offset : u32) -> mat3x3 { +fn tint_symbol_19(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x3 { return mat3x3(tint_symbol_14(buffer, (offset + 0u)), tint_symbol_14(buffer, (offset + 16u)), tint_symbol_14(buffer, (offset + 32u))); } -fn tint_symbol_20(buffer : [[access(read_write)]] -SB, offset : u32) -> mat3x4 { +fn tint_symbol_20(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x4 { return mat3x4(tint_symbol_16(buffer, (offset + 0u)), tint_symbol_16(buffer, (offset + 16u)), tint_symbol_16(buffer, (offset + 32u))); } -fn tint_symbol_21(buffer : [[access(read_write)]] -SB, offset : u32) -> mat4x2 { +fn tint_symbol_21(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x2 { return mat4x2(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 8u)), tint_symbol_12(buffer, (offset + 16u)), tint_symbol_12(buffer, (offset + 24u))); } -fn tint_symbol_22(buffer : [[access(read_write)]] -SB, offset : u32) -> mat4x3 { +fn tint_symbol_22(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x3 { return mat4x3(tint_symbol_14(buffer, (offset + 0u)), tint_symbol_14(buffer, (offset + 16u)), tint_symbol_14(buffer, (offset + 32u)), tint_symbol_14(buffer, (offset + 48u))); } -fn tint_symbol_23(buffer : [[access(read_write)]] -SB, offset : u32) -> mat4x4 { +fn tint_symbol_23(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x4 { return mat4x4(tint_symbol_16(buffer, (offset + 0u)), tint_symbol_16(buffer, (offset + 16u)), tint_symbol_16(buffer, (offset + 32u)), tint_symbol_16(buffer, (offset + 48u))); } -fn tint_symbol_24(buffer : [[access(read_write)]] -SB, offset : u32) -> array, 2> { +fn tint_symbol_24(buffer : [[access(read_write)]] SB, offset : u32) -> array, 2> { return array, 2>(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u))); } -var sb : [[access(read_write)]] -SB; +var sb : [[access(read_write)]] SB; [[stage(compute)]] fn main() { @@ -280,8 +253,7 @@ struct SB { v : array, 2>; }; -var sb : [[access(read_write)]] -SB; +var sb : [[access(read_write)]] SB; [[stage(compute)]] fn main() { @@ -338,136 +310,110 @@ struct SB { }; [[internal(intrinsic_store_i32)]] -fn tint_symbol(buffer : [[access(read_write)]] -SB, offset : u32, value : i32) +fn tint_symbol(buffer : [[access(read_write)]] SB, offset : u32, value : i32) [[internal(intrinsic_store_u32)]] -fn tint_symbol_1(buffer : [[access(read_write)]] -SB, offset : u32, value : u32) +fn tint_symbol_1(buffer : [[access(read_write)]] SB, offset : u32, value : u32) [[internal(intrinsic_store_f32)]] -fn tint_symbol_2(buffer : [[access(read_write)]] -SB, offset : u32, value : f32) +fn tint_symbol_2(buffer : [[access(read_write)]] SB, offset : u32, value : f32) [[internal(intrinsic_store_vec2_u32)]] -fn tint_symbol_3(buffer : [[access(read_write)]] -SB, offset : u32, value : vec2) +fn tint_symbol_3(buffer : [[access(read_write)]] SB, offset : u32, value : vec2) [[internal(intrinsic_store_vec2_f32)]] -fn tint_symbol_4(buffer : [[access(read_write)]] -SB, offset : u32, value : vec2) +fn tint_symbol_4(buffer : [[access(read_write)]] SB, offset : u32, value : vec2) [[internal(intrinsic_store_vec2_i32)]] -fn tint_symbol_5(buffer : [[access(read_write)]] -SB, offset : u32, value : vec2) +fn tint_symbol_5(buffer : [[access(read_write)]] SB, offset : u32, value : vec2) [[internal(intrinsic_store_vec3_u32)]] -fn tint_symbol_6(buffer : [[access(read_write)]] -SB, offset : u32, value : vec3) +fn tint_symbol_6(buffer : [[access(read_write)]] SB, offset : u32, value : vec3) [[internal(intrinsic_store_vec3_f32)]] -fn tint_symbol_7(buffer : [[access(read_write)]] -SB, offset : u32, value : vec3) +fn tint_symbol_7(buffer : [[access(read_write)]] SB, offset : u32, value : vec3) [[internal(intrinsic_store_vec3_i32)]] -fn tint_symbol_8(buffer : [[access(read_write)]] -SB, offset : u32, value : vec3) +fn tint_symbol_8(buffer : [[access(read_write)]] SB, offset : u32, value : vec3) [[internal(intrinsic_store_vec4_u32)]] -fn tint_symbol_9(buffer : [[access(read_write)]] -SB, offset : u32, value : vec4) +fn tint_symbol_9(buffer : [[access(read_write)]] SB, offset : u32, value : vec4) [[internal(intrinsic_store_vec4_f32)]] -fn tint_symbol_10(buffer : [[access(read_write)]] -SB, offset : u32, value : vec4) +fn tint_symbol_10(buffer : [[access(read_write)]] SB, offset : u32, value : vec4) [[internal(intrinsic_store_vec4_i32)]] -fn tint_symbol_11(buffer : [[access(read_write)]] -SB, offset : u32, value : vec4) +fn tint_symbol_11(buffer : [[access(read_write)]] SB, offset : u32, value : vec4) [[internal(intrinsic_store_vec2_i32)]] -fn tint_symbol_12(buffer : [[access(read_write)]] -SB, offset : u32, value : vec2) +fn tint_symbol_12(buffer : [[access(read_write)]] SB, offset : u32, value : vec2) -fn tint_symbol_13(buffer : [[access(read_write)]] -SB, offset : u32, value : mat2x2) { +fn tint_symbol_13(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x2) { tint_symbol_12(buffer, (offset + 0u), value[0u]); tint_symbol_12(buffer, (offset + 8u), value[1u]); } [[internal(intrinsic_store_vec3_i32)]] -fn tint_symbol_14(buffer : [[access(read_write)]] -SB, offset : u32, value : vec3) +fn tint_symbol_14(buffer : [[access(read_write)]] SB, offset : u32, value : vec3) -fn tint_symbol_15(buffer : [[access(read_write)]] -SB, offset : u32, value : mat2x3) { +fn tint_symbol_15(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x3) { tint_symbol_14(buffer, (offset + 0u), value[0u]); tint_symbol_14(buffer, (offset + 16u), value[1u]); } [[internal(intrinsic_store_vec4_i32)]] -fn tint_symbol_16(buffer : [[access(read_write)]] -SB, offset : u32, value : vec4) +fn tint_symbol_16(buffer : [[access(read_write)]] SB, offset : u32, value : vec4) -fn tint_symbol_17(buffer : [[access(read_write)]] -SB, offset : u32, value : mat2x4) { +fn tint_symbol_17(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x4) { tint_symbol_16(buffer, (offset + 0u), value[0u]); tint_symbol_16(buffer, (offset + 16u), value[1u]); } -fn tint_symbol_18(buffer : [[access(read_write)]] -SB, offset : u32, value : mat3x2) { +fn tint_symbol_18(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x2) { tint_symbol_12(buffer, (offset + 0u), value[0u]); tint_symbol_12(buffer, (offset + 8u), value[1u]); tint_symbol_12(buffer, (offset + 16u), value[2u]); } -fn tint_symbol_19(buffer : [[access(read_write)]] -SB, offset : u32, value : mat3x3) { +fn tint_symbol_19(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x3) { tint_symbol_14(buffer, (offset + 0u), value[0u]); tint_symbol_14(buffer, (offset + 16u), value[1u]); tint_symbol_14(buffer, (offset + 32u), value[2u]); } -fn tint_symbol_20(buffer : [[access(read_write)]] -SB, offset : u32, value : mat3x4) { +fn tint_symbol_20(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x4) { tint_symbol_16(buffer, (offset + 0u), value[0u]); tint_symbol_16(buffer, (offset + 16u), value[1u]); tint_symbol_16(buffer, (offset + 32u), value[2u]); } -fn tint_symbol_21(buffer : [[access(read_write)]] -SB, offset : u32, value : mat4x2) { +fn tint_symbol_21(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x2) { tint_symbol_12(buffer, (offset + 0u), value[0u]); tint_symbol_12(buffer, (offset + 8u), value[1u]); tint_symbol_12(buffer, (offset + 16u), value[2u]); tint_symbol_12(buffer, (offset + 24u), value[3u]); } -fn tint_symbol_22(buffer : [[access(read_write)]] -SB, offset : u32, value : mat4x3) { +fn tint_symbol_22(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x3) { tint_symbol_14(buffer, (offset + 0u), value[0u]); tint_symbol_14(buffer, (offset + 16u), value[1u]); tint_symbol_14(buffer, (offset + 32u), value[2u]); tint_symbol_14(buffer, (offset + 48u), value[3u]); } -fn tint_symbol_23(buffer : [[access(read_write)]] -SB, offset : u32, value : mat4x4) { +fn tint_symbol_23(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x4) { tint_symbol_16(buffer, (offset + 0u), value[0u]); tint_symbol_16(buffer, (offset + 16u), value[1u]); tint_symbol_16(buffer, (offset + 32u), value[2u]); tint_symbol_16(buffer, (offset + 48u), value[3u]); } -fn tint_symbol_24(buffer : [[access(read_write)]] -SB, offset : u32, value : array, 2>) { +fn tint_symbol_24(buffer : [[access(read_write)]] SB, offset : u32, value : array, 2>) { tint_symbol_8(buffer, (offset + 0u), value[0u]); tint_symbol_8(buffer, (offset + 16u), value[1u]); } -var sb : [[access(read_write)]] -SB; +var sb : [[access(read_write)]] SB; [[stage(compute)]] fn main() { @@ -529,8 +475,7 @@ struct SB { v : array, 2>; }; -var sb : [[access(read_write)]] -SB; +var sb : [[access(read_write)]] SB; [[stage(compute)]] fn main() { @@ -566,122 +511,95 @@ struct SB { }; [[internal(intrinsic_load_i32)]] -fn tint_symbol(buffer : [[access(read_write)]] -SB, offset : u32) -> i32 +fn tint_symbol(buffer : [[access(read_write)]] SB, offset : u32) -> i32 [[internal(intrinsic_load_u32)]] -fn tint_symbol_1(buffer : [[access(read_write)]] -SB, offset : u32) -> u32 +fn tint_symbol_1(buffer : [[access(read_write)]] SB, offset : u32) -> u32 [[internal(intrinsic_load_f32)]] -fn tint_symbol_2(buffer : [[access(read_write)]] -SB, offset : u32) -> f32 +fn tint_symbol_2(buffer : [[access(read_write)]] SB, offset : u32) -> f32 [[internal(intrinsic_load_vec2_i32)]] -fn tint_symbol_3(buffer : [[access(read_write)]] -SB, offset : u32) -> vec2 +fn tint_symbol_3(buffer : [[access(read_write)]] SB, offset : u32) -> vec2 [[internal(intrinsic_load_vec2_u32)]] -fn tint_symbol_4(buffer : [[access(read_write)]] -SB, offset : u32) -> vec2 +fn tint_symbol_4(buffer : [[access(read_write)]] SB, offset : u32) -> vec2 [[internal(intrinsic_load_vec2_f32)]] -fn tint_symbol_5(buffer : [[access(read_write)]] -SB, offset : u32) -> vec2 +fn tint_symbol_5(buffer : [[access(read_write)]] SB, offset : u32) -> vec2 [[internal(intrinsic_load_vec3_i32)]] -fn tint_symbol_6(buffer : [[access(read_write)]] -SB, offset : u32) -> vec3 +fn tint_symbol_6(buffer : [[access(read_write)]] SB, offset : u32) -> vec3 [[internal(intrinsic_load_vec3_u32)]] -fn tint_symbol_7(buffer : [[access(read_write)]] -SB, offset : u32) -> vec3 +fn tint_symbol_7(buffer : [[access(read_write)]] SB, offset : u32) -> vec3 [[internal(intrinsic_load_vec3_f32)]] -fn tint_symbol_8(buffer : [[access(read_write)]] -SB, offset : u32) -> vec3 +fn tint_symbol_8(buffer : [[access(read_write)]] SB, offset : u32) -> vec3 [[internal(intrinsic_load_vec4_i32)]] -fn tint_symbol_9(buffer : [[access(read_write)]] -SB, offset : u32) -> vec4 +fn tint_symbol_9(buffer : [[access(read_write)]] SB, offset : u32) -> vec4 [[internal(intrinsic_load_vec4_u32)]] -fn tint_symbol_10(buffer : [[access(read_write)]] -SB, offset : u32) -> vec4 +fn tint_symbol_10(buffer : [[access(read_write)]] SB, offset : u32) -> vec4 [[internal(intrinsic_load_vec4_f32)]] -fn tint_symbol_11(buffer : [[access(read_write)]] -SB, offset : u32) -> vec4 +fn tint_symbol_11(buffer : [[access(read_write)]] SB, offset : u32) -> vec4 [[internal(intrinsic_load_vec2_f32)]] -fn tint_symbol_12(buffer : [[access(read_write)]] -SB, offset : u32) -> vec2 +fn tint_symbol_12(buffer : [[access(read_write)]] SB, offset : u32) -> vec2 -fn tint_symbol_13(buffer : [[access(read_write)]] -SB, offset : u32) -> mat2x2 { +fn tint_symbol_13(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x2 { return mat2x2(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 8u))); } [[internal(intrinsic_load_vec3_f32)]] -fn tint_symbol_14(buffer : [[access(read_write)]] -SB, offset : u32) -> vec3 +fn tint_symbol_14(buffer : [[access(read_write)]] SB, offset : u32) -> vec3 -fn tint_symbol_15(buffer : [[access(read_write)]] -SB, offset : u32) -> mat2x3 { +fn tint_symbol_15(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x3 { return mat2x3(tint_symbol_14(buffer, (offset + 0u)), tint_symbol_14(buffer, (offset + 16u))); } [[internal(intrinsic_load_vec4_f32)]] -fn tint_symbol_16(buffer : [[access(read_write)]] -SB, offset : u32) -> vec4 +fn tint_symbol_16(buffer : [[access(read_write)]] SB, offset : u32) -> vec4 -fn tint_symbol_17(buffer : [[access(read_write)]] -SB, offset : u32) -> mat2x4 { +fn tint_symbol_17(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x4 { return mat2x4(tint_symbol_16(buffer, (offset + 0u)), tint_symbol_16(buffer, (offset + 16u))); } -fn tint_symbol_18(buffer : [[access(read_write)]] -SB, offset : u32) -> mat3x2 { +fn tint_symbol_18(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x2 { return mat3x2(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 8u)), tint_symbol_12(buffer, (offset + 16u))); } -fn tint_symbol_19(buffer : [[access(read_write)]] -SB, offset : u32) -> mat3x3 { +fn tint_symbol_19(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x3 { return mat3x3(tint_symbol_14(buffer, (offset + 0u)), tint_symbol_14(buffer, (offset + 16u)), tint_symbol_14(buffer, (offset + 32u))); } -fn tint_symbol_20(buffer : [[access(read_write)]] -SB, offset : u32) -> mat3x4 { +fn tint_symbol_20(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x4 { return mat3x4(tint_symbol_16(buffer, (offset + 0u)), tint_symbol_16(buffer, (offset + 16u)), tint_symbol_16(buffer, (offset + 32u))); } -fn tint_symbol_21(buffer : [[access(read_write)]] -SB, offset : u32) -> mat4x2 { +fn tint_symbol_21(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x2 { return mat4x2(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 8u)), tint_symbol_12(buffer, (offset + 16u)), tint_symbol_12(buffer, (offset + 24u))); } -fn tint_symbol_22(buffer : [[access(read_write)]] -SB, offset : u32) -> mat4x3 { +fn tint_symbol_22(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x3 { return mat4x3(tint_symbol_14(buffer, (offset + 0u)), tint_symbol_14(buffer, (offset + 16u)), tint_symbol_14(buffer, (offset + 32u)), tint_symbol_14(buffer, (offset + 48u))); } -fn tint_symbol_23(buffer : [[access(read_write)]] -SB, offset : u32) -> mat4x4 { +fn tint_symbol_23(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x4 { return mat4x4(tint_symbol_16(buffer, (offset + 0u)), tint_symbol_16(buffer, (offset + 16u)), tint_symbol_16(buffer, (offset + 32u)), tint_symbol_16(buffer, (offset + 48u))); } -fn tint_symbol_24(buffer : [[access(read_write)]] -SB, offset : u32) -> array, 2> { +fn tint_symbol_24(buffer : [[access(read_write)]] SB, offset : u32) -> array, 2> { return array, 2>(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u))); } -fn tint_symbol_25(buffer : [[access(read_write)]] -SB, offset : u32) -> SB { +fn tint_symbol_25(buffer : [[access(read_write)]] SB, offset : u32) -> SB { return SB(tint_symbol(buffer, (offset + 0u)), tint_symbol_1(buffer, (offset + 4u)), tint_symbol_2(buffer, (offset + 8u)), tint_symbol_3(buffer, (offset + 16u)), tint_symbol_4(buffer, (offset + 24u)), tint_symbol_5(buffer, (offset + 32u)), tint_symbol_6(buffer, (offset + 48u)), tint_symbol_7(buffer, (offset + 64u)), tint_symbol_8(buffer, (offset + 80u)), tint_symbol_9(buffer, (offset + 96u)), tint_symbol_10(buffer, (offset + 112u)), tint_symbol_11(buffer, (offset + 128u)), tint_symbol_13(buffer, (offset + 144u)), tint_symbol_15(buffer, (offset + 160u)), tint_symbol_17(buffer, (offset + 192u)), tint_symbol_18(buffer, (offset + 224u)), tint_symbol_19(buffer, (offset + 256u)), tint_symbol_20(buffer, (offset + 304u)), tint_symbol_21(buffer, (offset + 352u)), tint_symbol_22(buffer, (offset + 384u)), tint_symbol_23(buffer, (offset + 448u)), tint_symbol_24(buffer, (offset + 512u))); } -var sb : [[access(read_write)]] -SB; +var sb : [[access(read_write)]] SB; [[stage(compute)]] fn main() { @@ -722,8 +640,7 @@ struct SB { v : array, 2>; }; -var sb : [[access(read_write)]] -SB; +var sb : [[access(read_write)]] SB; [[stage(compute)]] fn main() { @@ -759,136 +676,110 @@ struct SB { }; [[internal(intrinsic_store_i32)]] -fn tint_symbol(buffer : [[access(read_write)]] -SB, offset : u32, value : i32) +fn tint_symbol(buffer : [[access(read_write)]] SB, offset : u32, value : i32) [[internal(intrinsic_store_u32)]] -fn tint_symbol_1(buffer : [[access(read_write)]] -SB, offset : u32, value : u32) +fn tint_symbol_1(buffer : [[access(read_write)]] SB, offset : u32, value : u32) [[internal(intrinsic_store_f32)]] -fn tint_symbol_2(buffer : [[access(read_write)]] -SB, offset : u32, value : f32) +fn tint_symbol_2(buffer : [[access(read_write)]] SB, offset : u32, value : f32) [[internal(intrinsic_store_vec2_u32)]] -fn tint_symbol_3(buffer : [[access(read_write)]] -SB, offset : u32, value : vec2) +fn tint_symbol_3(buffer : [[access(read_write)]] SB, offset : u32, value : vec2) [[internal(intrinsic_store_vec2_f32)]] -fn tint_symbol_4(buffer : [[access(read_write)]] -SB, offset : u32, value : vec2) +fn tint_symbol_4(buffer : [[access(read_write)]] SB, offset : u32, value : vec2) [[internal(intrinsic_store_vec2_i32)]] -fn tint_symbol_5(buffer : [[access(read_write)]] -SB, offset : u32, value : vec2) +fn tint_symbol_5(buffer : [[access(read_write)]] SB, offset : u32, value : vec2) [[internal(intrinsic_store_vec3_u32)]] -fn tint_symbol_6(buffer : [[access(read_write)]] -SB, offset : u32, value : vec3) +fn tint_symbol_6(buffer : [[access(read_write)]] SB, offset : u32, value : vec3) [[internal(intrinsic_store_vec3_f32)]] -fn tint_symbol_7(buffer : [[access(read_write)]] -SB, offset : u32, value : vec3) +fn tint_symbol_7(buffer : [[access(read_write)]] SB, offset : u32, value : vec3) [[internal(intrinsic_store_vec3_i32)]] -fn tint_symbol_8(buffer : [[access(read_write)]] -SB, offset : u32, value : vec3) +fn tint_symbol_8(buffer : [[access(read_write)]] SB, offset : u32, value : vec3) [[internal(intrinsic_store_vec4_u32)]] -fn tint_symbol_9(buffer : [[access(read_write)]] -SB, offset : u32, value : vec4) +fn tint_symbol_9(buffer : [[access(read_write)]] SB, offset : u32, value : vec4) [[internal(intrinsic_store_vec4_f32)]] -fn tint_symbol_10(buffer : [[access(read_write)]] -SB, offset : u32, value : vec4) +fn tint_symbol_10(buffer : [[access(read_write)]] SB, offset : u32, value : vec4) [[internal(intrinsic_store_vec4_i32)]] -fn tint_symbol_11(buffer : [[access(read_write)]] -SB, offset : u32, value : vec4) +fn tint_symbol_11(buffer : [[access(read_write)]] SB, offset : u32, value : vec4) [[internal(intrinsic_store_vec2_i32)]] -fn tint_symbol_12(buffer : [[access(read_write)]] -SB, offset : u32, value : vec2) +fn tint_symbol_12(buffer : [[access(read_write)]] SB, offset : u32, value : vec2) -fn tint_symbol_13(buffer : [[access(read_write)]] -SB, offset : u32, value : mat2x2) { +fn tint_symbol_13(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x2) { tint_symbol_12(buffer, (offset + 0u), value[0u]); tint_symbol_12(buffer, (offset + 8u), value[1u]); } [[internal(intrinsic_store_vec3_i32)]] -fn tint_symbol_14(buffer : [[access(read_write)]] -SB, offset : u32, value : vec3) +fn tint_symbol_14(buffer : [[access(read_write)]] SB, offset : u32, value : vec3) -fn tint_symbol_15(buffer : [[access(read_write)]] -SB, offset : u32, value : mat2x3) { +fn tint_symbol_15(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x3) { tint_symbol_14(buffer, (offset + 0u), value[0u]); tint_symbol_14(buffer, (offset + 16u), value[1u]); } [[internal(intrinsic_store_vec4_i32)]] -fn tint_symbol_16(buffer : [[access(read_write)]] -SB, offset : u32, value : vec4) +fn tint_symbol_16(buffer : [[access(read_write)]] SB, offset : u32, value : vec4) -fn tint_symbol_17(buffer : [[access(read_write)]] -SB, offset : u32, value : mat2x4) { +fn tint_symbol_17(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x4) { tint_symbol_16(buffer, (offset + 0u), value[0u]); tint_symbol_16(buffer, (offset + 16u), value[1u]); } -fn tint_symbol_18(buffer : [[access(read_write)]] -SB, offset : u32, value : mat3x2) { +fn tint_symbol_18(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x2) { tint_symbol_12(buffer, (offset + 0u), value[0u]); tint_symbol_12(buffer, (offset + 8u), value[1u]); tint_symbol_12(buffer, (offset + 16u), value[2u]); } -fn tint_symbol_19(buffer : [[access(read_write)]] -SB, offset : u32, value : mat3x3) { +fn tint_symbol_19(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x3) { tint_symbol_14(buffer, (offset + 0u), value[0u]); tint_symbol_14(buffer, (offset + 16u), value[1u]); tint_symbol_14(buffer, (offset + 32u), value[2u]); } -fn tint_symbol_20(buffer : [[access(read_write)]] -SB, offset : u32, value : mat3x4) { +fn tint_symbol_20(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x4) { tint_symbol_16(buffer, (offset + 0u), value[0u]); tint_symbol_16(buffer, (offset + 16u), value[1u]); tint_symbol_16(buffer, (offset + 32u), value[2u]); } -fn tint_symbol_21(buffer : [[access(read_write)]] -SB, offset : u32, value : mat4x2) { +fn tint_symbol_21(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x2) { tint_symbol_12(buffer, (offset + 0u), value[0u]); tint_symbol_12(buffer, (offset + 8u), value[1u]); tint_symbol_12(buffer, (offset + 16u), value[2u]); tint_symbol_12(buffer, (offset + 24u), value[3u]); } -fn tint_symbol_22(buffer : [[access(read_write)]] -SB, offset : u32, value : mat4x3) { +fn tint_symbol_22(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x3) { tint_symbol_14(buffer, (offset + 0u), value[0u]); tint_symbol_14(buffer, (offset + 16u), value[1u]); tint_symbol_14(buffer, (offset + 32u), value[2u]); tint_symbol_14(buffer, (offset + 48u), value[3u]); } -fn tint_symbol_23(buffer : [[access(read_write)]] -SB, offset : u32, value : mat4x4) { +fn tint_symbol_23(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x4) { tint_symbol_16(buffer, (offset + 0u), value[0u]); tint_symbol_16(buffer, (offset + 16u), value[1u]); tint_symbol_16(buffer, (offset + 32u), value[2u]); tint_symbol_16(buffer, (offset + 48u), value[3u]); } -fn tint_symbol_24(buffer : [[access(read_write)]] -SB, offset : u32, value : array, 2>) { +fn tint_symbol_24(buffer : [[access(read_write)]] SB, offset : u32, value : array, 2>) { tint_symbol_8(buffer, (offset + 0u), value[0u]); tint_symbol_8(buffer, (offset + 16u), value[1u]); } -fn tint_symbol_25(buffer : [[access(read_write)]] -SB, offset : u32, value : SB) { +fn tint_symbol_25(buffer : [[access(read_write)]] SB, offset : u32, value : SB) { tint_symbol(buffer, (offset + 0u), value.a); tint_symbol_1(buffer, (offset + 4u), value.b); tint_symbol_2(buffer, (offset + 8u), value.c); @@ -913,8 +804,7 @@ SB, offset : u32, value : SB) { tint_symbol_24(buffer, (offset + 512u), value.v); } -var sb : [[access(read_write)]] -SB; +var sb : [[access(read_write)]] SB; [[stage(compute)]] fn main() { @@ -948,8 +838,7 @@ struct SB { b : [[stride(256)]] array; }; -var sb : [[access(read_write)]] -SB; +var sb : [[access(read_write)]] SB; [[stage(compute)]] fn main() { @@ -985,11 +874,9 @@ struct SB { }; [[internal(intrinsic_load_f32)]] -fn tint_symbol(buffer : [[access(read_write)]] -SB, offset : u32) -> f32 +fn tint_symbol(buffer : [[access(read_write)]] SB, offset : u32) -> f32 -var sb : [[access(read_write)]] -SB; +var sb : [[access(read_write)]] SB; [[stage(compute)]] fn main() { @@ -1023,8 +910,7 @@ struct SB { b : [[stride(256)]] array; }; -var sb : [[access(read_write)]] -SB; +var sb : [[access(read_write)]] SB; [[stage(compute)]] fn main() { @@ -1056,11 +942,9 @@ struct SB { }; [[internal(intrinsic_load_f32)]] -fn tint_symbol(buffer : [[access(read_write)]] -SB, offset : u32) -> f32 +fn tint_symbol(buffer : [[access(read_write)]] SB, offset : u32) -> f32 -var sb : [[access(read_write)]] -SB; +var sb : [[access(read_write)]] SB; [[stage(compute)]] fn main() { @@ -1105,8 +989,7 @@ struct SB { b : A2_Array; }; -var sb : [[access(read_write)]] -SB; +var sb : [[access(read_write)]] SB; [[stage(compute)]] fn main() { @@ -1146,11 +1029,9 @@ struct SB { }; [[internal(intrinsic_load_f32)]] -fn tint_symbol(buffer : [[access(read_write)]] -SB, offset : u32) -> f32 +fn tint_symbol(buffer : [[access(read_write)]] SB, offset : u32) -> f32 -var sb : [[access(read_write)]] -SB; +var sb : [[access(read_write)]] SB; [[stage(compute)]] fn main() { diff --git a/src/transform/vertex_pulling_test.cc b/src/transform/vertex_pulling_test.cc index 368921681c..bf319d61b4 100644 --- a/src/transform/vertex_pulling_test.cc +++ b/src/transform/vertex_pulling_test.cc @@ -118,8 +118,7 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] -TintVertexData; +[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; var var_a : f32; @@ -161,8 +160,7 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] -TintVertexData; +[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; var var_a : f32; @@ -204,8 +202,7 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(5)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] -TintVertexData; +[[binding(0), group(5)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; var var_a : f32; @@ -250,11 +247,9 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] -TintVertexData; +[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; -[[binding(1), group(4)]] var tint_pulling_vertex_buffer_1 : [[access(read)]] -TintVertexData; +[[binding(1), group(4)]] var tint_pulling_vertex_buffer_1 : [[access(read)]] TintVertexData; var var_a : f32; @@ -315,8 +310,7 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] -TintVertexData; +[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; var var_a : f32; @@ -366,14 +360,11 @@ struct TintVertexData { tint_vertex_data : [[stride(4)]] array; }; -[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] -TintVertexData; +[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData; -[[binding(1), group(4)]] var tint_pulling_vertex_buffer_1 : [[access(read)]] -TintVertexData; +[[binding(1), group(4)]] var tint_pulling_vertex_buffer_1 : [[access(read)]] TintVertexData; -[[binding(2), group(4)]] var tint_pulling_vertex_buffer_2 : [[access(read)]] -TintVertexData; +[[binding(2), group(4)]] var tint_pulling_vertex_buffer_2 : [[access(read)]] TintVertexData; var var_a : vec2; @@ -432,8 +423,7 @@ struct TintVertexData { tint_vertex_data_1 : [[stride(4)]] array; }; -[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0_1 : [[access(read)]] -TintVertexData; +[[binding(0), group(4)]] var tint_pulling_vertex_buffer_0_1 : [[access(read)]] TintVertexData; var var_a : f32; diff --git a/src/writer/wgsl/generator_impl.cc b/src/writer/wgsl/generator_impl.cc index 78242ecdac..5531f1b7b0 100644 --- a/src/writer/wgsl/generator_impl.cc +++ b/src/writer/wgsl/generator_impl.cc @@ -383,7 +383,7 @@ bool GeneratorImpl::EmitType(type::Type* type) { diagnostics_.add_error("invalid access control"); return false; } - out_ << ")]]" << std::endl; + out_ << ")]] "; if (!EmitType(ac->type())) { return false; } diff --git a/src/writer/wgsl/generator_impl_function_test.cc b/src/writer/wgsl/generator_impl_function_test.cc index 05bc689632..4f069932fa 100644 --- a/src/writer/wgsl/generator_impl_function_test.cc +++ b/src/writer/wgsl/generator_impl_function_test.cc @@ -256,8 +256,7 @@ struct Data { d : f32; }; -[[binding(0), group(0)]] var data : [[access(read_write)]] -Data; +[[binding(0), group(0)]] var data : [[access(read_write)]] Data; [[stage(compute)]] fn a() { diff --git a/src/writer/wgsl/generator_impl_type_test.cc b/src/writer/wgsl/generator_impl_type_test.cc index e77643601e..fddffcc1ff 100644 --- a/src/writer/wgsl/generator_impl_type_test.cc +++ b/src/writer/wgsl/generator_impl_type_test.cc @@ -53,7 +53,7 @@ TEST_F(WgslGeneratorImplTest, EmitType_AccessControl_Read) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(&a)) << gen.error(); - EXPECT_EQ(gen.result(), "[[access(read)]]\nS"); + EXPECT_EQ(gen.result(), "[[access(read)]] S"); } TEST_F(WgslGeneratorImplTest, EmitType_AccessControl_ReadWrite) { @@ -65,7 +65,7 @@ TEST_F(WgslGeneratorImplTest, EmitType_AccessControl_ReadWrite) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.EmitType(&a)) << gen.error(); - EXPECT_EQ(gen.result(), "[[access(read_write)]]\nS"); + EXPECT_EQ(gen.result(), "[[access(read_write)]] S"); } TEST_F(WgslGeneratorImplTest, EmitType_Array_Decoration) { @@ -451,35 +451,35 @@ INSTANTIATE_TEST_SUITE_P( StorageTextureData{type::ImageFormat::kR8Unorm, type::TextureDimension::k1d, ast::AccessControl::kReadOnly, - "[[access(read)]]\ntexture_storage_1d"}, + "[[access(read)]] texture_storage_1d"}, StorageTextureData{type::ImageFormat::kR8Unorm, type::TextureDimension::k2d, ast::AccessControl::kReadOnly, - "[[access(read)]]\ntexture_storage_2d"}, + "[[access(read)]] texture_storage_2d"}, StorageTextureData{ type::ImageFormat::kR8Unorm, type::TextureDimension::k2dArray, ast::AccessControl::kReadOnly, - "[[access(read)]]\ntexture_storage_2d_array"}, + "[[access(read)]] texture_storage_2d_array"}, StorageTextureData{type::ImageFormat::kR8Unorm, type::TextureDimension::k3d, ast::AccessControl::kReadOnly, - "[[access(read)]]\ntexture_storage_3d"}, + "[[access(read)]] texture_storage_3d"}, StorageTextureData{type::ImageFormat::kR8Unorm, type::TextureDimension::k1d, ast::AccessControl::kWriteOnly, - "[[access(write)]]\ntexture_storage_1d"}, + "[[access(write)]] texture_storage_1d"}, StorageTextureData{type::ImageFormat::kR8Unorm, type::TextureDimension::k2d, ast::AccessControl::kWriteOnly, - "[[access(write)]]\ntexture_storage_2d"}, + "[[access(write)]] texture_storage_2d"}, StorageTextureData{ type::ImageFormat::kR8Unorm, type::TextureDimension::k2dArray, ast::AccessControl::kWriteOnly, - "[[access(write)]]\ntexture_storage_2d_array"}, + "[[access(write)]] texture_storage_2d_array"}, StorageTextureData{type::ImageFormat::kR8Unorm, type::TextureDimension::k3d, ast::AccessControl::kWriteOnly, - "[[access(write)]]\ntexture_storage_3d"})); + "[[access(write)]] texture_storage_3d"})); struct ImageFormatData { type::ImageFormat fmt; diff --git a/src/writer/wgsl/generator_impl_variable_decl_statement_test.cc b/src/writer/wgsl/generator_impl_variable_decl_statement_test.cc index 545de83bb7..2878e430cd 100644 --- a/src/writer/wgsl/generator_impl_variable_decl_statement_test.cc +++ b/src/writer/wgsl/generator_impl_variable_decl_statement_test.cc @@ -98,7 +98,7 @@ TEST_F(WgslGeneratorImplTest, Emit_VariableDeclStatement_Texture) { gen.increment_indent(); ASSERT_TRUE(gen.EmitStatement(stmt)) << gen.error(); - EXPECT_EQ(gen.result(), " var t : [[access(read)]]\ntexture_1d;\n"); + EXPECT_EQ(gen.result(), " var t : [[access(read)]] texture_1d;\n"); } } // namespace