writer/wgsl: Omit the newline after [[access()]] decorations

Produces ugly code for the common case.

Change-Id: I8e5b1215e19fc6461dc40b8a91922db25f9cbd76
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/47764
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
Ben Clayton 2021-04-16 10:09:44 +00:00 committed by Commit Bot service account
parent bfae10525f
commit ed8332a0d1
10 changed files with 184 additions and 356 deletions

View File

@ -48,12 +48,9 @@ var g5 : [[access(read)]] texture_storage_2d<r32uint>;
var g6 : [[access(write)]] texture_storage_2d<rg32float>;
[[builtin(position)]] var<uniform> g7 : vec3<f32>;
[[group(10), binding(20)]] var<storage> g8 : [[access(write)]]
S;
[[group(10), binding(20)]] var<storage> g9 : [[access(read)]]
S;
[[group(10), binding(20)]] var<storage> g10 : [[access(read_write)]]
S;
[[group(10), binding(20)]] var<storage> g8 : [[access(write)]] S;
[[group(10), binding(20)]] var<storage> g9 : [[access(read)]] S;
[[group(10), binding(20)]] var<storage> g10 : [[access(read_write)]] S;
fn f0(p0 : bool) -> f32 {
if (p0) {

View File

@ -30,11 +30,9 @@ TEST_F(BindingRemapperTest, NoRemappings) {
struct S {
};
[[group(2), binding(1)]] var<storage> a : [[access(read)]]
S;
[[group(2), binding(1)]] var<storage> a : [[access(read)]] S;
[[group(3), binding(2)]] var<storage> b : [[access(read)]]
S;
[[group(3), binding(2)]] var<storage> b : [[access(read)]] S;
[[stage(compute)]]
fn f() {
@ -57,11 +55,9 @@ TEST_F(BindingRemapperTest, RemapBindingPoints) {
struct S {
};
[[group(2), binding(1)]] var<storage> a : [[access(read)]]
S;
[[group(2), binding(1)]] var<storage> a : [[access(read)]] S;
[[group(3), binding(2)]] var<storage> b : [[access(read)]]
S;
[[group(3), binding(2)]] var<storage> b : [[access(read)]] S;
[[stage(compute)]]
fn f() {
@ -73,11 +69,9 @@ fn f() {
struct S {
};
[[group(1), binding(2)]] var<storage> a : [[access(read)]]
S;
[[group(1), binding(2)]] var<storage> a : [[access(read)]] S;
[[group(3), binding(2)]] var<storage> b : [[access(read)]]
S;
[[group(3), binding(2)]] var<storage> b : [[access(read)]] S;
[[stage(compute)]]
fn f() {
@ -103,14 +97,11 @@ TEST_F(BindingRemapperTest, RemapAccessControls) {
struct S {
};
[[group(2), binding(1)]] var<storage> a : [[access(read)]]
S;
[[group(2), binding(1)]] var<storage> a : [[access(read)]] S;
[[group(3), binding(2)]] var<storage> b : [[access(write)]]
S;
[[group(3), binding(2)]] var<storage> b : [[access(write)]] S;
[[group(4), binding(3)]] var<storage> c : [[access(read)]]
S;
[[group(4), binding(3)]] var<storage> c : [[access(read)]] S;
[[stage(compute)]]
fn f() {
@ -122,14 +113,11 @@ fn f() {
struct S {
};
[[group(2), binding(1)]] var<storage> a : [[access(write)]]
S;
[[group(2), binding(1)]] var<storage> a : [[access(write)]] S;
[[group(3), binding(2)]] var<storage> b : [[access(write)]]
S;
[[group(3), binding(2)]] var<storage> b : [[access(write)]] S;
[[group(4), binding(3)]] var<storage> c : [[access(read)]]
S;
[[group(4), binding(3)]] var<storage> 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<storage> a : [[access(write)]]
S;
[[group(2), binding(1)]] var<storage> a : [[access(write)]] S;
[[group(3), binding(2)]] var<storage> b : WriteOnlyS;
@ -220,11 +203,9 @@ TEST_F(BindingRemapperTest, RemapAll) {
struct S {
};
[[group(2), binding(1)]] var<storage> a : [[access(read)]]
S;
[[group(2), binding(1)]] var<storage> a : [[access(read)]] S;
[[group(3), binding(2)]] var<storage> b : [[access(read)]]
S;
[[group(3), binding(2)]] var<storage> b : [[access(read)]] S;
[[stage(compute)]]
fn f() {
@ -236,11 +217,9 @@ fn f() {
struct S {
};
[[group(4), binding(5)]] var<storage> a : [[access(write)]]
S;
[[group(4), binding(5)]] var<storage> a : [[access(write)]] S;
[[group(6), binding(7)]] var<storage> b : [[access(write)]]
S;
[[group(6), binding(7)]] var<storage> b : [[access(write)]] S;
[[stage(compute)]]
fn f() {
@ -268,10 +247,8 @@ TEST_F(BindingRemapperTest, NoData) {
struct S {
};
[[group(2), binding(1)]] var<storage> a : [[access(read)]]
S;
[[group(3), binding(2)]] var<storage> b : [[access(read)]]
S;
[[group(2), binding(1)]] var<storage> a : [[access(read)]] S;
[[group(3), binding(2)]] var<storage> b : [[access(read)]] S;
[[stage(compute)]]
fn f() {}

View File

@ -540,8 +540,7 @@ struct S {
a : f32;
b : array<f32>;
};
var<storage> s : [[access(read)]]
S;
var<storage> s : [[access(read)]] S;
fn f() {
var d : f32 = s.b[25];
@ -555,8 +554,7 @@ struct S {
b : array<f32>;
};
var<storage> s : [[access(read)]]
S;
var<storage> 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<f32>;
};
var<storage> s : [[access(read)]]
S;
var<storage> s : [[access(read)]] S;
let c : u32 = 1u;
@ -622,8 +619,7 @@ struct S {
b : array<f32>;
};
var<storage> s : [[access(read)]]
S;
var<storage> s : [[access(read)]] S;
let c : u32 = 1u;

View File

@ -30,8 +30,7 @@ struct SB {
arr : array<i32>;
};
var<storage> sb : [[access(read)]]
SB;
var<storage> 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<function, u32>)
var<storage> sb : [[access(read)]]
SB;
var<storage> sb : [[access(read)]] SB;
[[stage(vertex)]]
fn main() {
@ -74,8 +72,7 @@ struct SB {
arr : array<i32>;
};
var<storage> sb : [[access(read)]]
SB;
var<storage> 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<function, u32>)
var<storage> sb : [[access(read)]]
SB;
var<storage> sb : [[access(read)]] SB;
[[stage(vertex)]]
fn main() {
@ -123,8 +119,7 @@ struct SB {
arr : [[stride(64)]] array<i32>;
};
var<storage> sb : [[access(read)]]
SB;
var<storage> 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<function, u32>)
var<storage> sb : [[access(read)]]
SB;
var<storage> sb : [[access(read)]] SB;
[[stage(vertex)]]
fn main() {
@ -168,8 +162,7 @@ struct SB {
arr : array<i32>;
};
var<storage> sb : [[access(read)]]
SB;
var<storage> 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<function, u32>)
var<storage> sb : [[access(read)]]
SB;
var<storage> sb : [[access(read)]] SB;
[[stage(vertex)]]
fn main() {
@ -233,11 +225,9 @@ struct SB2 {
arr2 : array<vec4<f32>>;
};
var<storage> sb1 : [[access(read)]]
SB1;
var<storage> sb1 : [[access(read)]] SB1;
var<storage> sb2 : [[access(read)]]
SB2;
var<storage> 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<function, u32>)
var<storage> sb1 : [[access(read)]]
SB1;
var<storage> sb1 : [[access(read)]] SB1;
var<storage> sb2 : [[access(read)]]
SB2;
var<storage> sb2 : [[access(read)]] SB2;
[[stage(vertex)]]
fn main() {

View File

@ -50,8 +50,7 @@ struct SB {
v : array<vec3<f32>, 2>;
};
var<storage> sb : [[access(read_write)]]
SB;
var<storage> 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<i32>
fn tint_symbol_3(buffer : [[access(read_write)]] SB, offset : u32) -> vec2<i32>
[[internal(intrinsic_load_vec2_u32)]]
fn tint_symbol_4(buffer : [[access(read_write)]]
SB, offset : u32) -> vec2<u32>
fn tint_symbol_4(buffer : [[access(read_write)]] SB, offset : u32) -> vec2<u32>
[[internal(intrinsic_load_vec2_f32)]]
fn tint_symbol_5(buffer : [[access(read_write)]]
SB, offset : u32) -> vec2<f32>
fn tint_symbol_5(buffer : [[access(read_write)]] SB, offset : u32) -> vec2<f32>
[[internal(intrinsic_load_vec3_i32)]]
fn tint_symbol_6(buffer : [[access(read_write)]]
SB, offset : u32) -> vec3<i32>
fn tint_symbol_6(buffer : [[access(read_write)]] SB, offset : u32) -> vec3<i32>
[[internal(intrinsic_load_vec3_u32)]]
fn tint_symbol_7(buffer : [[access(read_write)]]
SB, offset : u32) -> vec3<u32>
fn tint_symbol_7(buffer : [[access(read_write)]] SB, offset : u32) -> vec3<u32>
[[internal(intrinsic_load_vec3_f32)]]
fn tint_symbol_8(buffer : [[access(read_write)]]
SB, offset : u32) -> vec3<f32>
fn tint_symbol_8(buffer : [[access(read_write)]] SB, offset : u32) -> vec3<f32>
[[internal(intrinsic_load_vec4_i32)]]
fn tint_symbol_9(buffer : [[access(read_write)]]
SB, offset : u32) -> vec4<i32>
fn tint_symbol_9(buffer : [[access(read_write)]] SB, offset : u32) -> vec4<i32>
[[internal(intrinsic_load_vec4_u32)]]
fn tint_symbol_10(buffer : [[access(read_write)]]
SB, offset : u32) -> vec4<u32>
fn tint_symbol_10(buffer : [[access(read_write)]] SB, offset : u32) -> vec4<u32>
[[internal(intrinsic_load_vec4_f32)]]
fn tint_symbol_11(buffer : [[access(read_write)]]
SB, offset : u32) -> vec4<f32>
fn tint_symbol_11(buffer : [[access(read_write)]] SB, offset : u32) -> vec4<f32>
[[internal(intrinsic_load_vec2_f32)]]
fn tint_symbol_12(buffer : [[access(read_write)]]
SB, offset : u32) -> vec2<f32>
fn tint_symbol_12(buffer : [[access(read_write)]] SB, offset : u32) -> vec2<f32>
fn tint_symbol_13(buffer : [[access(read_write)]]
SB, offset : u32) -> mat2x2<f32> {
fn tint_symbol_13(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x2<f32> {
return mat2x2<f32>(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<f32>
fn tint_symbol_14(buffer : [[access(read_write)]] SB, offset : u32) -> vec3<f32>
fn tint_symbol_15(buffer : [[access(read_write)]]
SB, offset : u32) -> mat2x3<f32> {
fn tint_symbol_15(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x3<f32> {
return mat2x3<f32>(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<f32>
fn tint_symbol_16(buffer : [[access(read_write)]] SB, offset : u32) -> vec4<f32>
fn tint_symbol_17(buffer : [[access(read_write)]]
SB, offset : u32) -> mat2x4<f32> {
fn tint_symbol_17(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x4<f32> {
return mat2x4<f32>(tint_symbol_16(buffer, (offset + 0u)), tint_symbol_16(buffer, (offset + 16u)));
}
fn tint_symbol_18(buffer : [[access(read_write)]]
SB, offset : u32) -> mat3x2<f32> {
fn tint_symbol_18(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x2<f32> {
return mat3x2<f32>(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<f32> {
fn tint_symbol_19(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x3<f32> {
return mat3x3<f32>(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<f32> {
fn tint_symbol_20(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x4<f32> {
return mat3x4<f32>(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<f32> {
fn tint_symbol_21(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x2<f32> {
return mat4x2<f32>(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<f32> {
fn tint_symbol_22(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x3<f32> {
return mat4x3<f32>(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<f32> {
fn tint_symbol_23(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x4<f32> {
return mat4x4<f32>(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<vec3<f32>, 2> {
fn tint_symbol_24(buffer : [[access(read_write)]] SB, offset : u32) -> array<vec3<f32>, 2> {
return array<vec3<f32>, 2>(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u)));
}
var<storage> sb : [[access(read_write)]]
SB;
var<storage> sb : [[access(read_write)]] SB;
[[stage(compute)]]
fn main() {
@ -280,8 +253,7 @@ struct SB {
v : array<vec3<f32>, 2>;
};
var<storage> sb : [[access(read_write)]]
SB;
var<storage> 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<i32>)
fn tint_symbol_3(buffer : [[access(read_write)]] SB, offset : u32, value : vec2<i32>)
[[internal(intrinsic_store_vec2_f32)]]
fn tint_symbol_4(buffer : [[access(read_write)]]
SB, offset : u32, value : vec2<u32>)
fn tint_symbol_4(buffer : [[access(read_write)]] SB, offset : u32, value : vec2<u32>)
[[internal(intrinsic_store_vec2_i32)]]
fn tint_symbol_5(buffer : [[access(read_write)]]
SB, offset : u32, value : vec2<f32>)
fn tint_symbol_5(buffer : [[access(read_write)]] SB, offset : u32, value : vec2<f32>)
[[internal(intrinsic_store_vec3_u32)]]
fn tint_symbol_6(buffer : [[access(read_write)]]
SB, offset : u32, value : vec3<i32>)
fn tint_symbol_6(buffer : [[access(read_write)]] SB, offset : u32, value : vec3<i32>)
[[internal(intrinsic_store_vec3_f32)]]
fn tint_symbol_7(buffer : [[access(read_write)]]
SB, offset : u32, value : vec3<u32>)
fn tint_symbol_7(buffer : [[access(read_write)]] SB, offset : u32, value : vec3<u32>)
[[internal(intrinsic_store_vec3_i32)]]
fn tint_symbol_8(buffer : [[access(read_write)]]
SB, offset : u32, value : vec3<f32>)
fn tint_symbol_8(buffer : [[access(read_write)]] SB, offset : u32, value : vec3<f32>)
[[internal(intrinsic_store_vec4_u32)]]
fn tint_symbol_9(buffer : [[access(read_write)]]
SB, offset : u32, value : vec4<i32>)
fn tint_symbol_9(buffer : [[access(read_write)]] SB, offset : u32, value : vec4<i32>)
[[internal(intrinsic_store_vec4_f32)]]
fn tint_symbol_10(buffer : [[access(read_write)]]
SB, offset : u32, value : vec4<u32>)
fn tint_symbol_10(buffer : [[access(read_write)]] SB, offset : u32, value : vec4<u32>)
[[internal(intrinsic_store_vec4_i32)]]
fn tint_symbol_11(buffer : [[access(read_write)]]
SB, offset : u32, value : vec4<f32>)
fn tint_symbol_11(buffer : [[access(read_write)]] SB, offset : u32, value : vec4<f32>)
[[internal(intrinsic_store_vec2_i32)]]
fn tint_symbol_12(buffer : [[access(read_write)]]
SB, offset : u32, value : vec2<f32>)
fn tint_symbol_12(buffer : [[access(read_write)]] SB, offset : u32, value : vec2<f32>)
fn tint_symbol_13(buffer : [[access(read_write)]]
SB, offset : u32, value : mat2x2<f32>) {
fn tint_symbol_13(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x2<f32>) {
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<f32>)
fn tint_symbol_14(buffer : [[access(read_write)]] SB, offset : u32, value : vec3<f32>)
fn tint_symbol_15(buffer : [[access(read_write)]]
SB, offset : u32, value : mat2x3<f32>) {
fn tint_symbol_15(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x3<f32>) {
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<f32>)
fn tint_symbol_16(buffer : [[access(read_write)]] SB, offset : u32, value : vec4<f32>)
fn tint_symbol_17(buffer : [[access(read_write)]]
SB, offset : u32, value : mat2x4<f32>) {
fn tint_symbol_17(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x4<f32>) {
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<f32>) {
fn tint_symbol_18(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x2<f32>) {
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<f32>) {
fn tint_symbol_19(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x3<f32>) {
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<f32>) {
fn tint_symbol_20(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x4<f32>) {
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<f32>) {
fn tint_symbol_21(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x2<f32>) {
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<f32>) {
fn tint_symbol_22(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x3<f32>) {
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<f32>) {
fn tint_symbol_23(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x4<f32>) {
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<vec3<f32>, 2>) {
fn tint_symbol_24(buffer : [[access(read_write)]] SB, offset : u32, value : array<vec3<f32>, 2>) {
tint_symbol_8(buffer, (offset + 0u), value[0u]);
tint_symbol_8(buffer, (offset + 16u), value[1u]);
}
var<storage> sb : [[access(read_write)]]
SB;
var<storage> sb : [[access(read_write)]] SB;
[[stage(compute)]]
fn main() {
@ -529,8 +475,7 @@ struct SB {
v : array<vec3<f32>, 2>;
};
var<storage> sb : [[access(read_write)]]
SB;
var<storage> 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<i32>
fn tint_symbol_3(buffer : [[access(read_write)]] SB, offset : u32) -> vec2<i32>
[[internal(intrinsic_load_vec2_u32)]]
fn tint_symbol_4(buffer : [[access(read_write)]]
SB, offset : u32) -> vec2<u32>
fn tint_symbol_4(buffer : [[access(read_write)]] SB, offset : u32) -> vec2<u32>
[[internal(intrinsic_load_vec2_f32)]]
fn tint_symbol_5(buffer : [[access(read_write)]]
SB, offset : u32) -> vec2<f32>
fn tint_symbol_5(buffer : [[access(read_write)]] SB, offset : u32) -> vec2<f32>
[[internal(intrinsic_load_vec3_i32)]]
fn tint_symbol_6(buffer : [[access(read_write)]]
SB, offset : u32) -> vec3<i32>
fn tint_symbol_6(buffer : [[access(read_write)]] SB, offset : u32) -> vec3<i32>
[[internal(intrinsic_load_vec3_u32)]]
fn tint_symbol_7(buffer : [[access(read_write)]]
SB, offset : u32) -> vec3<u32>
fn tint_symbol_7(buffer : [[access(read_write)]] SB, offset : u32) -> vec3<u32>
[[internal(intrinsic_load_vec3_f32)]]
fn tint_symbol_8(buffer : [[access(read_write)]]
SB, offset : u32) -> vec3<f32>
fn tint_symbol_8(buffer : [[access(read_write)]] SB, offset : u32) -> vec3<f32>
[[internal(intrinsic_load_vec4_i32)]]
fn tint_symbol_9(buffer : [[access(read_write)]]
SB, offset : u32) -> vec4<i32>
fn tint_symbol_9(buffer : [[access(read_write)]] SB, offset : u32) -> vec4<i32>
[[internal(intrinsic_load_vec4_u32)]]
fn tint_symbol_10(buffer : [[access(read_write)]]
SB, offset : u32) -> vec4<u32>
fn tint_symbol_10(buffer : [[access(read_write)]] SB, offset : u32) -> vec4<u32>
[[internal(intrinsic_load_vec4_f32)]]
fn tint_symbol_11(buffer : [[access(read_write)]]
SB, offset : u32) -> vec4<f32>
fn tint_symbol_11(buffer : [[access(read_write)]] SB, offset : u32) -> vec4<f32>
[[internal(intrinsic_load_vec2_f32)]]
fn tint_symbol_12(buffer : [[access(read_write)]]
SB, offset : u32) -> vec2<f32>
fn tint_symbol_12(buffer : [[access(read_write)]] SB, offset : u32) -> vec2<f32>
fn tint_symbol_13(buffer : [[access(read_write)]]
SB, offset : u32) -> mat2x2<f32> {
fn tint_symbol_13(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x2<f32> {
return mat2x2<f32>(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<f32>
fn tint_symbol_14(buffer : [[access(read_write)]] SB, offset : u32) -> vec3<f32>
fn tint_symbol_15(buffer : [[access(read_write)]]
SB, offset : u32) -> mat2x3<f32> {
fn tint_symbol_15(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x3<f32> {
return mat2x3<f32>(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<f32>
fn tint_symbol_16(buffer : [[access(read_write)]] SB, offset : u32) -> vec4<f32>
fn tint_symbol_17(buffer : [[access(read_write)]]
SB, offset : u32) -> mat2x4<f32> {
fn tint_symbol_17(buffer : [[access(read_write)]] SB, offset : u32) -> mat2x4<f32> {
return mat2x4<f32>(tint_symbol_16(buffer, (offset + 0u)), tint_symbol_16(buffer, (offset + 16u)));
}
fn tint_symbol_18(buffer : [[access(read_write)]]
SB, offset : u32) -> mat3x2<f32> {
fn tint_symbol_18(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x2<f32> {
return mat3x2<f32>(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<f32> {
fn tint_symbol_19(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x3<f32> {
return mat3x3<f32>(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<f32> {
fn tint_symbol_20(buffer : [[access(read_write)]] SB, offset : u32) -> mat3x4<f32> {
return mat3x4<f32>(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<f32> {
fn tint_symbol_21(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x2<f32> {
return mat4x2<f32>(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<f32> {
fn tint_symbol_22(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x3<f32> {
return mat4x3<f32>(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<f32> {
fn tint_symbol_23(buffer : [[access(read_write)]] SB, offset : u32) -> mat4x4<f32> {
return mat4x4<f32>(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<vec3<f32>, 2> {
fn tint_symbol_24(buffer : [[access(read_write)]] SB, offset : u32) -> array<vec3<f32>, 2> {
return array<vec3<f32>, 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<storage> sb : [[access(read_write)]]
SB;
var<storage> sb : [[access(read_write)]] SB;
[[stage(compute)]]
fn main() {
@ -722,8 +640,7 @@ struct SB {
v : array<vec3<f32>, 2>;
};
var<storage> sb : [[access(read_write)]]
SB;
var<storage> 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<i32>)
fn tint_symbol_3(buffer : [[access(read_write)]] SB, offset : u32, value : vec2<i32>)
[[internal(intrinsic_store_vec2_f32)]]
fn tint_symbol_4(buffer : [[access(read_write)]]
SB, offset : u32, value : vec2<u32>)
fn tint_symbol_4(buffer : [[access(read_write)]] SB, offset : u32, value : vec2<u32>)
[[internal(intrinsic_store_vec2_i32)]]
fn tint_symbol_5(buffer : [[access(read_write)]]
SB, offset : u32, value : vec2<f32>)
fn tint_symbol_5(buffer : [[access(read_write)]] SB, offset : u32, value : vec2<f32>)
[[internal(intrinsic_store_vec3_u32)]]
fn tint_symbol_6(buffer : [[access(read_write)]]
SB, offset : u32, value : vec3<i32>)
fn tint_symbol_6(buffer : [[access(read_write)]] SB, offset : u32, value : vec3<i32>)
[[internal(intrinsic_store_vec3_f32)]]
fn tint_symbol_7(buffer : [[access(read_write)]]
SB, offset : u32, value : vec3<u32>)
fn tint_symbol_7(buffer : [[access(read_write)]] SB, offset : u32, value : vec3<u32>)
[[internal(intrinsic_store_vec3_i32)]]
fn tint_symbol_8(buffer : [[access(read_write)]]
SB, offset : u32, value : vec3<f32>)
fn tint_symbol_8(buffer : [[access(read_write)]] SB, offset : u32, value : vec3<f32>)
[[internal(intrinsic_store_vec4_u32)]]
fn tint_symbol_9(buffer : [[access(read_write)]]
SB, offset : u32, value : vec4<i32>)
fn tint_symbol_9(buffer : [[access(read_write)]] SB, offset : u32, value : vec4<i32>)
[[internal(intrinsic_store_vec4_f32)]]
fn tint_symbol_10(buffer : [[access(read_write)]]
SB, offset : u32, value : vec4<u32>)
fn tint_symbol_10(buffer : [[access(read_write)]] SB, offset : u32, value : vec4<u32>)
[[internal(intrinsic_store_vec4_i32)]]
fn tint_symbol_11(buffer : [[access(read_write)]]
SB, offset : u32, value : vec4<f32>)
fn tint_symbol_11(buffer : [[access(read_write)]] SB, offset : u32, value : vec4<f32>)
[[internal(intrinsic_store_vec2_i32)]]
fn tint_symbol_12(buffer : [[access(read_write)]]
SB, offset : u32, value : vec2<f32>)
fn tint_symbol_12(buffer : [[access(read_write)]] SB, offset : u32, value : vec2<f32>)
fn tint_symbol_13(buffer : [[access(read_write)]]
SB, offset : u32, value : mat2x2<f32>) {
fn tint_symbol_13(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x2<f32>) {
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<f32>)
fn tint_symbol_14(buffer : [[access(read_write)]] SB, offset : u32, value : vec3<f32>)
fn tint_symbol_15(buffer : [[access(read_write)]]
SB, offset : u32, value : mat2x3<f32>) {
fn tint_symbol_15(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x3<f32>) {
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<f32>)
fn tint_symbol_16(buffer : [[access(read_write)]] SB, offset : u32, value : vec4<f32>)
fn tint_symbol_17(buffer : [[access(read_write)]]
SB, offset : u32, value : mat2x4<f32>) {
fn tint_symbol_17(buffer : [[access(read_write)]] SB, offset : u32, value : mat2x4<f32>) {
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<f32>) {
fn tint_symbol_18(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x2<f32>) {
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<f32>) {
fn tint_symbol_19(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x3<f32>) {
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<f32>) {
fn tint_symbol_20(buffer : [[access(read_write)]] SB, offset : u32, value : mat3x4<f32>) {
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<f32>) {
fn tint_symbol_21(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x2<f32>) {
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<f32>) {
fn tint_symbol_22(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x3<f32>) {
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<f32>) {
fn tint_symbol_23(buffer : [[access(read_write)]] SB, offset : u32, value : mat4x4<f32>) {
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<vec3<f32>, 2>) {
fn tint_symbol_24(buffer : [[access(read_write)]] SB, offset : u32, value : array<vec3<f32>, 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<storage> sb : [[access(read_write)]]
SB;
var<storage> sb : [[access(read_write)]] SB;
[[stage(compute)]]
fn main() {
@ -948,8 +838,7 @@ struct SB {
b : [[stride(256)]] array<S2>;
};
var<storage> sb : [[access(read_write)]]
SB;
var<storage> 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<storage> sb : [[access(read_write)]]
SB;
var<storage> sb : [[access(read_write)]] SB;
[[stage(compute)]]
fn main() {
@ -1023,8 +910,7 @@ struct SB {
b : [[stride(256)]] array<S2>;
};
var<storage> sb : [[access(read_write)]]
SB;
var<storage> 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<storage> sb : [[access(read_write)]]
SB;
var<storage> sb : [[access(read_write)]] SB;
[[stage(compute)]]
fn main() {
@ -1105,8 +989,7 @@ struct SB {
b : A2_Array;
};
var<storage> sb : [[access(read_write)]]
SB;
var<storage> 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<storage> sb : [[access(read_write)]]
SB;
var<storage> sb : [[access(read_write)]] SB;
[[stage(compute)]]
fn main() {

View File

@ -118,8 +118,7 @@ struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
[[binding(0), group(4)]] var<storage> tint_pulling_vertex_buffer_0 : [[access(read)]]
TintVertexData;
[[binding(0), group(4)]] var<storage> tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData;
var<private> var_a : f32;
@ -161,8 +160,7 @@ struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
[[binding(0), group(4)]] var<storage> tint_pulling_vertex_buffer_0 : [[access(read)]]
TintVertexData;
[[binding(0), group(4)]] var<storage> tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData;
var<private> var_a : f32;
@ -204,8 +202,7 @@ struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
[[binding(0), group(5)]] var<storage> tint_pulling_vertex_buffer_0 : [[access(read)]]
TintVertexData;
[[binding(0), group(5)]] var<storage> tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData;
var<private> var_a : f32;
@ -250,11 +247,9 @@ struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
[[binding(0), group(4)]] var<storage> tint_pulling_vertex_buffer_0 : [[access(read)]]
TintVertexData;
[[binding(0), group(4)]] var<storage> tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData;
[[binding(1), group(4)]] var<storage> tint_pulling_vertex_buffer_1 : [[access(read)]]
TintVertexData;
[[binding(1), group(4)]] var<storage> tint_pulling_vertex_buffer_1 : [[access(read)]] TintVertexData;
var<private> var_a : f32;
@ -315,8 +310,7 @@ struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
[[binding(0), group(4)]] var<storage> tint_pulling_vertex_buffer_0 : [[access(read)]]
TintVertexData;
[[binding(0), group(4)]] var<storage> tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData;
var<private> var_a : f32;
@ -366,14 +360,11 @@ struct TintVertexData {
tint_vertex_data : [[stride(4)]] array<u32>;
};
[[binding(0), group(4)]] var<storage> tint_pulling_vertex_buffer_0 : [[access(read)]]
TintVertexData;
[[binding(0), group(4)]] var<storage> tint_pulling_vertex_buffer_0 : [[access(read)]] TintVertexData;
[[binding(1), group(4)]] var<storage> tint_pulling_vertex_buffer_1 : [[access(read)]]
TintVertexData;
[[binding(1), group(4)]] var<storage> tint_pulling_vertex_buffer_1 : [[access(read)]] TintVertexData;
[[binding(2), group(4)]] var<storage> tint_pulling_vertex_buffer_2 : [[access(read)]]
TintVertexData;
[[binding(2), group(4)]] var<storage> tint_pulling_vertex_buffer_2 : [[access(read)]] TintVertexData;
var<private> var_a : vec2<f32>;
@ -432,8 +423,7 @@ struct TintVertexData {
tint_vertex_data_1 : [[stride(4)]] array<u32>;
};
[[binding(0), group(4)]] var<storage> tint_pulling_vertex_buffer_0_1 : [[access(read)]]
TintVertexData;
[[binding(0), group(4)]] var<storage> tint_pulling_vertex_buffer_0_1 : [[access(read)]] TintVertexData;
var<private> var_a : f32;

View File

@ -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;
}

View File

@ -256,8 +256,7 @@ struct Data {
d : f32;
};
[[binding(0), group(0)]] var<storage> data : [[access(read_write)]]
Data;
[[binding(0), group(0)]] var<storage> data : [[access(read_write)]] Data;
[[stage(compute)]]
fn a() {

View File

@ -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<r8unorm>"},
"[[access(read)]] texture_storage_1d<r8unorm>"},
StorageTextureData{type::ImageFormat::kR8Unorm,
type::TextureDimension::k2d,
ast::AccessControl::kReadOnly,
"[[access(read)]]\ntexture_storage_2d<r8unorm>"},
"[[access(read)]] texture_storage_2d<r8unorm>"},
StorageTextureData{
type::ImageFormat::kR8Unorm, type::TextureDimension::k2dArray,
ast::AccessControl::kReadOnly,
"[[access(read)]]\ntexture_storage_2d_array<r8unorm>"},
"[[access(read)]] texture_storage_2d_array<r8unorm>"},
StorageTextureData{type::ImageFormat::kR8Unorm,
type::TextureDimension::k3d,
ast::AccessControl::kReadOnly,
"[[access(read)]]\ntexture_storage_3d<r8unorm>"},
"[[access(read)]] texture_storage_3d<r8unorm>"},
StorageTextureData{type::ImageFormat::kR8Unorm,
type::TextureDimension::k1d,
ast::AccessControl::kWriteOnly,
"[[access(write)]]\ntexture_storage_1d<r8unorm>"},
"[[access(write)]] texture_storage_1d<r8unorm>"},
StorageTextureData{type::ImageFormat::kR8Unorm,
type::TextureDimension::k2d,
ast::AccessControl::kWriteOnly,
"[[access(write)]]\ntexture_storage_2d<r8unorm>"},
"[[access(write)]] texture_storage_2d<r8unorm>"},
StorageTextureData{
type::ImageFormat::kR8Unorm, type::TextureDimension::k2dArray,
ast::AccessControl::kWriteOnly,
"[[access(write)]]\ntexture_storage_2d_array<r8unorm>"},
"[[access(write)]] texture_storage_2d_array<r8unorm>"},
StorageTextureData{type::ImageFormat::kR8Unorm,
type::TextureDimension::k3d,
ast::AccessControl::kWriteOnly,
"[[access(write)]]\ntexture_storage_3d<r8unorm>"}));
"[[access(write)]] texture_storage_3d<r8unorm>"}));
struct ImageFormatData {
type::ImageFormat fmt;

View File

@ -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<f32>;\n");
EXPECT_EQ(gen.result(), " var t : [[access(read)]] texture_1d<f32>;\n");
}
} // namespace