Resolver: Validate <storage> var types

https://gpuweb.github.io/gpuweb/wgsl/#variable-declaration
Variables in the storage storage class and variables with a storage
texture type must have an access attribute applied to the store type.

https://gpuweb.github.io/gpuweb/wgsl/#module-scope-variables
A variable in the storage storage class is a storage buffer variable. Its
store type must be a host-shareable structure type with block attribute,
satisfying the storage class constraints.

Fixup tests, including those that were producing warnings about `var <in>`

The WGSL writer seems to want to put a newline after every decoration block, leading to some ugly output. I'll fix this as a separate change.

Fixes: tint:531
Fixes: tint:692
Change-Id: If09d987477247ab4a7c635f6ee6e616a06061515
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/47763
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
Ben Clayton
2021-04-16 09:26:14 +00:00
committed by Commit Bot service account
parent 4485fcde64
commit 1773535e1c
19 changed files with 570 additions and 294 deletions

View File

@@ -30,9 +30,11 @@ TEST_F(BindingRemapperTest, NoRemappings) {
struct S {
};
[[group(2), binding(1)]] var<storage> a : S;
[[group(2), binding(1)]] var<storage> a : [[access(read)]]
S;
[[group(3), binding(2)]] var<storage> b : S;
[[group(3), binding(2)]] var<storage> b : [[access(read)]]
S;
[[stage(compute)]]
fn f() {
@@ -55,9 +57,11 @@ TEST_F(BindingRemapperTest, RemapBindingPoints) {
struct S {
};
[[group(2), binding(1)]] var<storage> a : S;
[[group(2), binding(1)]] var<storage> a : [[access(read)]]
S;
[[group(3), binding(2)]] var<storage> b : S;
[[group(3), binding(2)]] var<storage> b : [[access(read)]]
S;
[[stage(compute)]]
fn f() {
@@ -69,9 +73,11 @@ fn f() {
struct S {
};
[[group(1), binding(2)]] var<storage> a : S;
[[group(1), binding(2)]] var<storage> a : [[access(read)]]
S;
[[group(3), binding(2)]] var<storage> b : S;
[[group(3), binding(2)]] var<storage> b : [[access(read)]]
S;
[[stage(compute)]]
fn f() {
@@ -103,7 +109,8 @@ S;
[[group(3), binding(2)]] var<storage> b : [[access(write)]]
S;
[[group(4), binding(3)]] var<storage> c : S;
[[group(4), binding(3)]] var<storage> c : [[access(read)]]
S;
[[stage(compute)]]
fn f() {
@@ -216,7 +223,8 @@ struct S {
[[group(2), binding(1)]] var<storage> a : [[access(read)]]
S;
[[group(3), binding(2)]] var<storage> b : S;
[[group(3), binding(2)]] var<storage> b : [[access(read)]]
S;
[[stage(compute)]]
fn f() {
@@ -260,8 +268,10 @@ TEST_F(BindingRemapperTest, NoData) {
struct S {
};
[[group(2), binding(1)]] var<storage> a : S;
[[group(3), binding(2)]] var<storage> b : 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

@@ -24,22 +24,22 @@ using BoundArrayAccessorsTest = TransformTest;
TEST_F(BoundArrayAccessorsTest, Ptrs_Clamp) {
auto* src = R"(
var<storage> a : array<f32, 3>;
var<private> a : array<f32, 3>;
let c : u32 = 1u;
fn f() {
let b : ptr<storage, f32> = a[c];
let b : ptr<private, f32> = a[c];
}
)";
auto* expect = R"(
var<storage> a : array<f32, 3>;
var<private> a : array<f32, 3>;
let c : u32 = 1u;
fn f() {
let b : ptr<storage, f32> = a[min(u32(c), 2u)];
let b : ptr<private, f32> = a[min(u32(c), 2u)];
}
)";
@@ -50,11 +50,11 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Array_Idx_Nested_Scalar) {
auto* src = R"(
var<in> a : array<f32, 3>;
var<private> a : array<f32, 3>;
var<in> b : array<f32, 5>;
var<private> b : array<f32, 5>;
var<in> i : u32;
var<private> i : u32;
fn f() {
var c : f32 = a[ b[i] ];
@@ -62,11 +62,11 @@ fn f() {
)";
auto* expect = R"(
var<in> a : array<f32, 3>;
var<private> a : array<f32, 3>;
var<in> b : array<f32, 5>;
var<private> b : array<f32, 5>;
var<in> i : u32;
var<private> i : u32;
fn f() {
var c : f32 = a[min(u32(b[min(u32(i), 4u)]), 2u)];
@@ -80,7 +80,7 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Array_Idx_Scalar) {
auto* src = R"(
var<in> a : array<f32, 3>;
var<private> a : array<f32, 3>;
fn f() {
var b : f32 = a[1];
@@ -88,7 +88,7 @@ fn f() {
)";
auto* expect = R"(
var<in> a : array<f32, 3>;
var<private> a : array<f32, 3>;
fn f() {
var b : f32 = a[1];
@@ -102,9 +102,9 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Array_Idx_Expr) {
auto* src = R"(
var<in> a : array<f32, 3>;
var<private> a : array<f32, 3>;
var<in> c : i32;
var<private> c : i32;
fn f() {
var b : f32 = a[c + 2 - 3];
@@ -112,9 +112,9 @@ fn f() {
)";
auto* expect = R"(
var<in> a : array<f32, 3>;
var<private> a : array<f32, 3>;
var<in> c : i32;
var<private> c : i32;
fn f() {
var b : f32 = a[min(u32(((c + 2) - 3)), 2u)];
@@ -128,7 +128,7 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Array_Idx_Negative) {
auto* src = R"(
var<in> a : array<f32, 3>;
var<private> a : array<f32, 3>;
fn f() {
var b : f32 = a[-1];
@@ -136,7 +136,7 @@ fn f() {
)";
auto* expect = R"(
var<in> a : array<f32, 3>;
var<private> a : array<f32, 3>;
fn f() {
var b : f32 = a[0];
@@ -150,7 +150,7 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Array_Idx_OutOfBounds) {
auto* src = R"(
var<in> a : array<f32, 3>;
var<private> a : array<f32, 3>;
fn f() {
var b : f32 = a[3];
@@ -158,7 +158,7 @@ fn f() {
)";
auto* expect = R"(
var<in> a : array<f32, 3>;
var<private> a : array<f32, 3>;
fn f() {
var b : f32 = a[2];
@@ -172,7 +172,7 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Vector_Idx_Scalar) {
auto* src = R"(
var<in> a : vec3<f32>;
var<private> a : vec3<f32>;
fn f() {
var b : f32 = a[1];
@@ -180,7 +180,7 @@ fn f() {
)";
auto* expect = R"(
var<in> a : vec3<f32>;
var<private> a : vec3<f32>;
fn f() {
var b : f32 = a[1];
@@ -194,9 +194,9 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Vector_Idx_Expr) {
auto* src = R"(
var<in> a : vec3<f32>;
var<private> a : vec3<f32>;
var<in> c : i32;
var<private> c : i32;
fn f() {
var b : f32 = a[c + 2 - 3];
@@ -204,9 +204,9 @@ fn f() {
)";
auto* expect = R"(
var<in> a : vec3<f32>;
var<private> a : vec3<f32>;
var<in> c : i32;
var<private> c : i32;
fn f() {
var b : f32 = a[min(u32(((c + 2) - 3)), 2u)];
@@ -220,7 +220,7 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Vector_Swizzle_Idx_Scalar) {
auto* src = R"(
var<in> a : vec3<f32>;
var<private> a : vec3<f32>;
fn f() {
var b : f32 = a.xy[2];
@@ -228,7 +228,7 @@ fn f() {
)";
auto* expect = R"(
var<in> a : vec3<f32>;
var<private> a : vec3<f32>;
fn f() {
var b : f32 = a.xy[1];
@@ -242,9 +242,9 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Vector_Swizzle_Idx_Var) {
auto* src = R"(
var<in> a : vec3<f32>;
var<private> a : vec3<f32>;
var<in> c : i32;
var<private> c : i32;
fn f() {
var b : f32 = a.xy[c];
@@ -252,9 +252,9 @@ fn f() {
)";
auto* expect = R"(
var<in> a : vec3<f32>;
var<private> a : vec3<f32>;
var<in> c : i32;
var<private> c : i32;
fn f() {
var b : f32 = a.xy[min(u32(c), 1u)];
@@ -267,9 +267,9 @@ fn f() {
}
TEST_F(BoundArrayAccessorsTest, Vector_Swizzle_Idx_Expr) {
auto* src = R"(
var<in> a : vec3<f32>;
var<private> a : vec3<f32>;
var<in> c : i32;
var<private> c : i32;
fn f() {
var b : f32 = a.xy[c + 2 - 3];
@@ -277,9 +277,9 @@ fn f() {
)";
auto* expect = R"(
var<in> a : vec3<f32>;
var<private> a : vec3<f32>;
var<in> c : i32;
var<private> c : i32;
fn f() {
var b : f32 = a.xy[min(u32(((c + 2) - 3)), 1u)];
@@ -293,7 +293,7 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Vector_Idx_Negative) {
auto* src = R"(
var<in> a : vec3<f32>;
var<private> a : vec3<f32>;
fn f() {
var b : f32 = a[-1];
@@ -301,7 +301,7 @@ fn f() {
)";
auto* expect = R"(
var<in> a : vec3<f32>;
var<private> a : vec3<f32>;
fn f() {
var b : f32 = a[0];
@@ -315,7 +315,7 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Vector_Idx_OutOfBounds) {
auto* src = R"(
var<in> a : vec3<f32>;
var<private> a : vec3<f32>;
fn f() {
var b : f32 = a[3];
@@ -323,7 +323,7 @@ fn f() {
)";
auto* expect = R"(
var<in> a : vec3<f32>;
var<private> a : vec3<f32>;
fn f() {
var b : f32 = a[2];
@@ -337,7 +337,7 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Matrix_Idx_Scalar) {
auto* src = R"(
var<in> a : mat3x2<f32>;
var<private> a : mat3x2<f32>;
fn f() {
var b : f32 = a[2][1];
@@ -345,7 +345,7 @@ fn f() {
)";
auto* expect = R"(
var<in> a : mat3x2<f32>;
var<private> a : mat3x2<f32>;
fn f() {
var b : f32 = a[2][1];
@@ -359,9 +359,9 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Matrix_Idx_Expr_Column) {
auto* src = R"(
var<in> a : mat3x2<f32>;
var<private> a : mat3x2<f32>;
var<in> c : i32;
var<private> c : i32;
fn f() {
var b : f32 = a[c + 2 - 3][1];
@@ -369,9 +369,9 @@ fn f() {
)";
auto* expect = R"(
var<in> a : mat3x2<f32>;
var<private> a : mat3x2<f32>;
var<in> c : i32;
var<private> c : i32;
fn f() {
var b : f32 = a[min(u32(((c + 2) - 3)), 2u)][1];
@@ -385,9 +385,9 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Matrix_Idx_Expr_Row) {
auto* src = R"(
var<in> a : mat3x2<f32>;
var<private> a : mat3x2<f32>;
var<in> c : i32;
var<private> c : i32;
fn f() {
var b : f32 = a[1][c + 2 - 3];
@@ -395,9 +395,9 @@ fn f() {
)";
auto* expect = R"(
var<in> a : mat3x2<f32>;
var<private> a : mat3x2<f32>;
var<in> c : i32;
var<private> c : i32;
fn f() {
var b : f32 = a[1][min(u32(((c + 2) - 3)), 1u)];
@@ -411,7 +411,7 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Matrix_Idx_Negative_Column) {
auto* src = R"(
var<in> a : mat3x2<f32>;
var<private> a : mat3x2<f32>;
fn f() {
var b : f32 = a[-1][1];
@@ -419,7 +419,7 @@ fn f() {
)";
auto* expect = R"(
var<in> a : mat3x2<f32>;
var<private> a : mat3x2<f32>;
fn f() {
var b : f32 = a[0][1];
@@ -433,7 +433,7 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Matrix_Idx_Negative_Row) {
auto* src = R"(
var<in> a : mat3x2<f32>;
var<private> a : mat3x2<f32>;
fn f() {
var b : f32 = a[2][-1];
@@ -441,7 +441,7 @@ fn f() {
)";
auto* expect = R"(
var<in> a : mat3x2<f32>;
var<private> a : mat3x2<f32>;
fn f() {
var b : f32 = a[2][0];
@@ -455,7 +455,7 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Matrix_Idx_OutOfBounds_Column) {
auto* src = R"(
var<in> a : mat3x2<f32>;
var<private> a : mat3x2<f32>;
fn f() {
var b : f32 = a[5][1];
@@ -463,7 +463,7 @@ fn f() {
)";
auto* expect = R"(
var<in> a : mat3x2<f32>;
var<private> a : mat3x2<f32>;
fn f() {
var b : f32 = a[2][1];
@@ -477,7 +477,7 @@ fn f() {
TEST_F(BoundArrayAccessorsTest, Matrix_Idx_OutOfBounds_Row) {
auto* src = R"(
var<in> a : mat3x2<f32>;
var<private> a : mat3x2<f32>;
fn f() {
var b : f32 = a[2][5];
@@ -485,7 +485,7 @@ fn f() {
)";
auto* expect = R"(
var<in> a : mat3x2<f32>;
var<private> a : mat3x2<f32>;
fn f() {
var b : f32 = a[2][1];
@@ -540,7 +540,8 @@ struct S {
a : f32;
b : array<f32>;
};
var<storage> s : S;
var<storage> s : [[access(read)]]
S;
fn f() {
var d : f32 = s.b[25];
@@ -554,7 +555,8 @@ struct S {
b : array<f32>;
};
var<storage> s : S;
var<storage> s : [[access(read)]]
S;
fn f() {
var d : f32 = s.b[min(u32(25), (arrayLength(s.b) - 1u))];
@@ -601,7 +603,8 @@ struct S {
b : array<f32>;
};
var<storage> s : S;
var<storage> s : [[access(read)]]
S;
let c : u32 = 1u;
@@ -619,7 +622,8 @@ struct S {
b : array<f32>;
};
var<storage> s : S;
var<storage> s : [[access(read)]]
S;
let c : u32 = 1u;

View File

@@ -30,7 +30,8 @@ struct SB {
arr : array<i32>;
};
var<storage> sb : SB;
var<storage> sb : [[access(read)]]
SB;
[[stage(vertex)]]
fn main() {
@@ -48,7 +49,8 @@ struct SB {
[[internal(intrinsic_buffer_size)]]
fn tint_symbol(buffer : SB, result : ptr<function, u32>)
var<storage> sb : SB;
var<storage> sb : [[access(read)]]
SB;
[[stage(vertex)]]
fn main() {
@@ -72,7 +74,8 @@ struct SB {
arr : array<i32>;
};
var<storage> sb : SB;
var<storage> sb : [[access(read)]]
SB;
[[stage(vertex)]]
fn main() {
@@ -92,7 +95,8 @@ struct SB {
[[internal(intrinsic_buffer_size)]]
fn tint_symbol(buffer : SB, result : ptr<function, u32>)
var<storage> sb : SB;
var<storage> sb : [[access(read)]]
SB;
[[stage(vertex)]]
fn main() {
@@ -119,7 +123,8 @@ struct SB {
arr : [[stride(64)]] array<i32>;
};
var<storage> sb : SB;
var<storage> sb : [[access(read)]]
SB;
[[stage(vertex)]]
fn main() {
@@ -138,7 +143,8 @@ struct SB {
[[internal(intrinsic_buffer_size)]]
fn tint_symbol(buffer : SB, result : ptr<function, u32>)
var<storage> sb : SB;
var<storage> sb : [[access(read)]]
SB;
[[stage(vertex)]]
fn main() {
@@ -162,7 +168,8 @@ struct SB {
arr : array<i32>;
};
var<storage> sb : SB;
var<storage> sb : [[access(read)]]
SB;
[[stage(vertex)]]
fn main() {
@@ -186,7 +193,8 @@ struct SB {
[[internal(intrinsic_buffer_size)]]
fn tint_symbol(buffer : SB, result : ptr<function, u32>)
var<storage> sb : SB;
var<storage> sb : [[access(read)]]
SB;
[[stage(vertex)]]
fn main() {
@@ -225,9 +233,11 @@ struct SB2 {
arr2 : array<vec4<f32>>;
};
var<storage> sb1 : SB1;
var<storage> sb1 : [[access(read)]]
SB1;
var<storage> sb2 : SB2;
var<storage> sb2 : [[access(read)]]
SB2;
[[stage(vertex)]]
fn main() {
@@ -256,9 +266,11 @@ struct SB2 {
[[internal(intrinsic_buffer_size)]]
fn tint_symbol_3(buffer : SB2, result : ptr<function, u32>)
var<storage> sb1 : SB1;
var<storage> sb1 : [[access(read)]]
SB1;
var<storage> sb2 : SB2;
var<storage> sb2 : [[access(read)]]
SB2;
[[stage(vertex)]]
fn main() {

View File

@@ -50,7 +50,8 @@ struct SB {
v : array<vec3<f32>, 2>;
};
var<storage> sb : SB;
var<storage> sb : [[access(read_write)]]
SB;
[[stage(compute)]]
fn main() {
@@ -107,91 +108,117 @@ struct SB {
};
[[internal(intrinsic_load_i32)]]
fn tint_symbol(buffer : SB, offset : u32) -> i32
fn tint_symbol(buffer : [[access(read_write)]]
SB, offset : u32) -> i32
[[internal(intrinsic_load_u32)]]
fn tint_symbol_1(buffer : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : SB, offset : u32) -> vec2<f32>
fn tint_symbol_12(buffer : [[access(read_write)]]
SB, offset : u32) -> vec2<f32>
fn tint_symbol_13(buffer : 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 : SB, offset : u32) -> vec3<f32>
fn tint_symbol_14(buffer : [[access(read_write)]]
SB, offset : u32) -> vec3<f32>
fn tint_symbol_15(buffer : 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 : SB, offset : u32) -> vec4<f32>
fn tint_symbol_16(buffer : [[access(read_write)]]
SB, offset : u32) -> vec4<f32>
fn tint_symbol_17(buffer : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : SB;
var<storage> sb : [[access(read_write)]]
SB;
[[stage(compute)]]
fn main() {
@@ -253,7 +280,8 @@ struct SB {
v : array<vec3<f32>, 2>;
};
var<storage> sb : SB;
var<storage> sb : [[access(read_write)]]
SB;
[[stage(compute)]]
fn main() {
@@ -310,110 +338,136 @@ struct SB {
};
[[internal(intrinsic_store_i32)]]
fn tint_symbol(buffer : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : SB;
var<storage> sb : [[access(read_write)]]
SB;
[[stage(compute)]]
fn main() {
@@ -475,7 +529,8 @@ struct SB {
v : array<vec3<f32>, 2>;
};
var<storage> sb : SB;
var<storage> sb : [[access(read_write)]]
SB;
[[stage(compute)]]
fn main() {
@@ -511,95 +566,122 @@ struct SB {
};
[[internal(intrinsic_load_i32)]]
fn tint_symbol(buffer : SB, offset : u32) -> i32
fn tint_symbol(buffer : [[access(read_write)]]
SB, offset : u32) -> i32
[[internal(intrinsic_load_u32)]]
fn tint_symbol_1(buffer : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : SB, offset : u32) -> vec2<f32>
fn tint_symbol_12(buffer : [[access(read_write)]]
SB, offset : u32) -> vec2<f32>
fn tint_symbol_13(buffer : 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 : SB, offset : u32) -> vec3<f32>
fn tint_symbol_14(buffer : [[access(read_write)]]
SB, offset : u32) -> vec3<f32>
fn tint_symbol_15(buffer : 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 : SB, offset : u32) -> vec4<f32>
fn tint_symbol_16(buffer : [[access(read_write)]]
SB, offset : u32) -> vec4<f32>
fn tint_symbol_17(buffer : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : SB;
var<storage> sb : [[access(read_write)]]
SB;
[[stage(compute)]]
fn main() {
@@ -640,7 +722,8 @@ struct SB {
v : array<vec3<f32>, 2>;
};
var<storage> sb : SB;
var<storage> sb : [[access(read_write)]]
SB;
[[stage(compute)]]
fn main() {
@@ -676,110 +759,136 @@ struct SB {
};
[[internal(intrinsic_store_i32)]]
fn tint_symbol(buffer : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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 : 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);
@@ -804,7 +913,8 @@ fn tint_symbol_25(buffer : SB, offset : u32, value : SB) {
tint_symbol_24(buffer, (offset + 512u), value.v);
}
var<storage> sb : SB;
var<storage> sb : [[access(read_write)]]
SB;
[[stage(compute)]]
fn main() {
@@ -838,7 +948,8 @@ struct SB {
b : [[stride(256)]] array<S2>;
};
var<storage> sb : SB;
var<storage> sb : [[access(read_write)]]
SB;
[[stage(compute)]]
fn main() {
@@ -874,9 +985,11 @@ struct SB {
};
[[internal(intrinsic_load_f32)]]
fn tint_symbol(buffer : SB, offset : u32) -> f32
fn tint_symbol(buffer : [[access(read_write)]]
SB, offset : u32) -> f32
var<storage> sb : SB;
var<storage> sb : [[access(read_write)]]
SB;
[[stage(compute)]]
fn main() {
@@ -910,7 +1023,8 @@ struct SB {
b : [[stride(256)]] array<S2>;
};
var<storage> sb : SB;
var<storage> sb : [[access(read_write)]]
SB;
[[stage(compute)]]
fn main() {
@@ -942,9 +1056,11 @@ struct SB {
};
[[internal(intrinsic_load_f32)]]
fn tint_symbol(buffer : SB, offset : u32) -> f32
fn tint_symbol(buffer : [[access(read_write)]]
SB, offset : u32) -> f32
var<storage> sb : SB;
var<storage> sb : [[access(read_write)]]
SB;
[[stage(compute)]]
fn main() {
@@ -989,7 +1105,8 @@ struct SB {
b : A2_Array;
};
var<storage> sb : SB;
var<storage> sb : [[access(read_write)]]
SB;
[[stage(compute)]]
fn main() {
@@ -1029,9 +1146,11 @@ struct SB {
};
[[internal(intrinsic_load_f32)]]
fn tint_symbol(buffer : SB, offset : u32) -> f32
fn tint_symbol(buffer : [[access(read_write)]]
SB, offset : u32) -> f32
var<storage> sb : SB;
var<storage> sb : [[access(read_write)]]
SB;
[[stage(compute)]]
fn main() {

View File

@@ -209,12 +209,12 @@ struct State {
{
ctx.dst->create<ast::StructBlockDecoration>(),
});
auto* access =
ctx.dst->ty.access(ast::AccessControl::kReadOnly, struct_type);
for (uint32_t i = 0; i < cfg.vertex_state.size(); ++i) {
// The decorated variable with struct type
ctx.dst->Global(
GetVertexBufferName(i), struct_type, ast::StorageClass::kStorage,
nullptr,
GetVertexBufferName(i), access, ast::StorageClass::kStorage, nullptr,
ast::DecorationList{
ctx.dst->create<ast::BindingDecoration>(i),
ctx.dst->create<ast::GroupDecoration>(cfg.pulling_group),

View File

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