[ast,msl]: packed_vec3: Unroll loop for small composite copy
Many (but not all) unit tests were forked into *_Small and *_Large
variants to exercise both paths.
Bug: dawn:2330
Change-Id: I4ed464377a69dc4de756df2e55804ad8d2573646
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/170060
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: David Neto <dneto@google.com>
diff --git a/src/tint/lang/msl/writer/ast_raise/packed_vec3.cc b/src/tint/lang/msl/writer/ast_raise/packed_vec3.cc
index 9d651c6..6ef52b2 100644
--- a/src/tint/lang/msl/writer/ast_raise/packed_vec3.cc
+++ b/src/tint/lang/msl/writer/ast_raise/packed_vec3.cc
@@ -58,6 +58,10 @@
namespace tint::msl::writer {
+// Arrays larger than this will be packed/unpacked with a for loop.
+// Arrays up to this size will be packed/unpacked with a sequence of statements.
+static constexpr uint32_t kMaxSeriallyUnpackedArraySize = 8;
+
/// PIMPL state for the transform
struct PackedVec3::State {
/// Constructor
@@ -242,7 +246,6 @@
const std::function<ast::Type()>& out_type) {
// Allocate a variable to hold the return value of the function.
tint::Vector<const ast::Statement*, 4> statements;
- statements.Push(b.Decl(b.Var("result", out_type())));
// Helper that generates a loop to copy and pack/unpack elements of an array to the result:
// for (var i = 0u; i < num_elements; i = i + 1) {
@@ -250,15 +253,28 @@
// }
auto copy_array_elements = [&](uint32_t num_elements,
const core::type::Type* element_type) {
- // Generate an expression for packing or unpacking an element of the array.
- auto* element = pack_or_unpack_element(b.IndexAccessor("in", "i"), element_type);
- statements.Push(b.For( //
- b.Decl(b.Var("i", b.ty.u32())), //
- b.LessThan("i", u32(num_elements)), //
- b.Assign("i", b.Add("i", 1_a)), //
- b.Block(tint::Vector{
- b.Assign(b.IndexAccessor("result", "i"), element),
- })));
+ // Generate code for unpacking the array.
+ if (num_elements <= kMaxSeriallyUnpackedArraySize) {
+ // Generate a variable with an explicit initializer.
+ tint::Vector<const ast::Expression*, 8> elements;
+ for (uint32_t i = 0; i < num_elements; i++) {
+ elements.Push(pack_or_unpack_element(
+ b.IndexAccessor("in", b.Expr(core::AInt(i))), element_type));
+ }
+ statements.Push(b.Decl(b.Var("result", b.Call(out_type(), b.ExprList(elements)))));
+ } else {
+ statements.Push(b.Decl(b.Var("result", out_type())));
+ // Generate a for loop.
+ // Generate an expression for packing or unpacking an element of the array.
+ auto* element = pack_or_unpack_element(b.IndexAccessor("in", "i"), element_type);
+ statements.Push(b.For( //
+ b.Decl(b.Var("i", b.ty.u32())), //
+ b.LessThan("i", u32(num_elements)), //
+ b.Assign("i", b.Add("i", 1_a)), //
+ b.Block(tint::Vector{
+ b.Assign(b.IndexAccessor("result", "i"), element),
+ })));
+ }
};
// Copy the elements of the value over to the result.
@@ -272,6 +288,7 @@
copy_array_elements(mat->columns(), mat->ColumnType());
},
[&](const core::type::Struct* str) {
+ statements.Push(b.Decl(b.Var("result", out_type())));
// Copy the struct members over one at a time, packing/unpacking as necessary.
for (auto* member : str->Members()) {
const ast::Expression* element =
diff --git a/src/tint/lang/msl/writer/ast_raise/packed_vec3_test.cc b/src/tint/lang/msl/writer/ast_raise/packed_vec3_test.cc
index 220dabb..cc002ba 100644
--- a/src/tint/lang/msl/writer/ast_raise/packed_vec3_test.cc
+++ b/src/tint/lang/msl/writer/ast_raise/packed_vec3_test.cc
@@ -502,7 +502,7 @@
EXPECT_EQ(expect, str(got));
}
-TEST_F(PackedVec3Test, ArrayOfVec3_ReadArray) {
+TEST_F(PackedVec3Test, ArrayOfVec3_ReadArray_Small) {
auto* src = R"(
@group(0) @binding(0) var<storage> arr : array<vec3<f32>, 4>;
@@ -520,14 +520,49 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 4u>) -> array<vec3<f32>, 4u> {
- var result : array<vec3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
+ var result = array<vec3<f32>, 4u>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements), vec3<f32>(in[3].elements));
+ return result;
+}
+
+@group(0) @binding(0) var<storage> arr : array<tint_packed_vec3_f32_array_element, 4u>;
+
+fn f() {
+ let x = tint_unpack_vec3_in_composite(arr);
+}
+)";
+
+ ast::transform::DataMap data;
+ auto got = Run<PackedVec3>(src, data);
+
+ EXPECT_EQ(expect, str(got));
+}
+
+TEST_F(PackedVec3Test, ArrayOfVec3_ReadArray_Large) {
+ auto* src = R"(
+@group(0) @binding(0) var<storage> arr : array<vec3<f32>, 9>;
+
+fn f() {
+ let x = arr;
+}
+)";
+
+ auto* expect = R"(
+enable chromium_internal_relaxed_uniform_layout;
+
+struct tint_packed_vec3_f32_array_element {
+ @align(16)
+ elements : __packed_vec3<f32>,
+}
+
+fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 9u>) -> array<vec3<f32>, 9u> {
+ var result : array<vec3<f32>, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
result[i] = vec3<f32>(in[i].elements);
}
return result;
}
-@group(0) @binding(0) var<storage> arr : array<tint_packed_vec3_f32_array_element, 4u>;
+@group(0) @binding(0) var<storage> arr : array<tint_packed_vec3_f32_array_element, 9u>;
fn f() {
let x = tint_unpack_vec3_in_composite(arr);
@@ -630,7 +665,7 @@
EXPECT_EQ(expect, str(got));
}
-TEST_F(PackedVec3Test, ArrayOfVec3_WriteArray_ValueRHS) {
+TEST_F(PackedVec3Test, ArrayOfVec3_WriteArray_ValueRHS_Small) {
auto* src = R"(
@group(0) @binding(0) var<storage, read_write> arr : array<vec3<f32>, 2>;
@@ -648,10 +683,7 @@
}
fn tint_pack_vec3_in_composite(in : array<vec3<f32>, 2u>) -> array<tint_packed_vec3_f32_array_element, 2u> {
- var result : array<tint_packed_vec3_f32_array_element, 2u>;
- for(var i : u32; (i < 2u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 2u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])));
return result;
}
@@ -668,6 +700,52 @@
EXPECT_EQ(expect, str(got));
}
+TEST_F(PackedVec3Test, ArrayOfVec3_WriteArray_ValueRHS_Large) {
+ auto* src = R"(
+@group(0) @binding(0) var<storage, read_write> arr : array<vec3<f32>, 9>;
+
+fn f() {
+ arr = array(vec3(1.5, 2.5, 3.5),
+ vec3(4.5, 5.5, 6.5),
+ vec3(7.5, 8.5, 9.5),
+ vec3(7.5, 8.5, 9.5),
+ vec3(7.5, 8.5, 9.5),
+ vec3(7.5, 8.5, 9.5),
+ vec3(7.5, 8.5, 9.5),
+ vec3(7.5, 8.5, 9.5),
+ vec3(7.5, 8.5, 9.5));
+}
+)";
+
+ auto* expect = R"(
+enable chromium_internal_relaxed_uniform_layout;
+
+struct tint_packed_vec3_f32_array_element {
+ @align(16)
+ elements : __packed_vec3<f32>,
+}
+
+fn tint_pack_vec3_in_composite(in : array<vec3<f32>, 9u>) -> array<tint_packed_vec3_f32_array_element, 9u> {
+ var result : array<tint_packed_vec3_f32_array_element, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
+ result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
+ }
+ return result;
+}
+
+@group(0) @binding(0) var<storage, read_write> arr : array<tint_packed_vec3_f32_array_element, 9u>;
+
+fn f() {
+ arr = tint_pack_vec3_in_composite(array(vec3(1.5, 2.5, 3.5), vec3(4.5, 5.5, 6.5), vec3(7.5, 8.5, 9.5), vec3(7.5, 8.5, 9.5), vec3(7.5, 8.5, 9.5), vec3(7.5, 8.5, 9.5), vec3(7.5, 8.5, 9.5), vec3(7.5, 8.5, 9.5), vec3(7.5, 8.5, 9.5)));
+}
+)";
+
+ ast::transform::DataMap data;
+ auto got = Run<PackedVec3>(src, data);
+
+ EXPECT_EQ(expect, str(got));
+}
+
TEST_F(PackedVec3Test, ArrayOfVec3_WriteArray_RefRHS) {
auto* src = R"(
@group(0) @binding(0) var<storage, read_write> arr : array<vec3<f32>, 2>;
@@ -731,7 +809,7 @@
EXPECT_EQ(expect, str(got));
}
-TEST_F(PackedVec3Test, ArrayOfVec3_WriteVector_RefRHS) {
+TEST_F(PackedVec3Test, ArrayOfVec3_WriteVector_RefRHS_Small) {
auto* src = R"(
@group(0) @binding(0) var<storage, read_write> arr : array<vec3<f32>, 4>;
@group(0) @binding(1) var<uniform> in_arr : array<vec3<f32>, 4>;
@@ -769,6 +847,44 @@
EXPECT_EQ(expect, str(got));
}
+TEST_F(PackedVec3Test, ArrayOfVec3_WriteVector_RefRHS_Large) {
+ auto* src = R"(
+@group(0) @binding(0) var<storage, read_write> arr : array<vec3<f32>, 9>;
+@group(0) @binding(1) var<uniform> in_arr : array<vec3<f32>, 9>;
+@group(0) @binding(2) var<uniform> in_vec : vec3<f32>;
+
+fn f() {
+ arr[0] = in_arr[0];
+ arr[1] = in_vec;
+}
+)";
+
+ auto* expect = R"(
+enable chromium_internal_relaxed_uniform_layout;
+
+struct tint_packed_vec3_f32_array_element {
+ @align(16)
+ elements : __packed_vec3<f32>,
+}
+
+@group(0) @binding(0) var<storage, read_write> arr : array<tint_packed_vec3_f32_array_element, 9u>;
+
+@group(0) @binding(1) var<uniform> in_arr : array<tint_packed_vec3_f32_array_element, 9u>;
+
+@group(0) @binding(2) var<uniform> in_vec : __packed_vec3<f32>;
+
+fn f() {
+ arr[0].elements = in_arr[0].elements;
+ arr[1].elements = in_vec;
+}
+)";
+
+ ast::transform::DataMap data;
+ auto got = Run<PackedVec3>(src, data);
+
+ EXPECT_EQ(expect, str(got));
+}
+
TEST_F(PackedVec3Test, ArrayOfVec3_WriteComponent_MemberAccessor) {
auto* src = R"(
@group(0) @binding(0) var<storage, read_write> arr : array<vec3<f32>, 4>;
@@ -847,10 +963,7 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
@@ -975,10 +1088,7 @@
}
fn tint_pack_vec3_in_composite(in : mat3x3<f32>) -> array<tint_packed_vec3_f32_array_element, 3u> {
- var result : array<tint_packed_vec3_f32_array_element, 3u>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 3u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])));
return result;
}
@@ -1156,7 +1266,7 @@
EXPECT_EQ(expect, str(got));
}
-TEST_F(PackedVec3Test, ArrayOfMatrix_ReadArray) {
+TEST_F(PackedVec3Test, ArrayOfMatrix_ReadArray_Small) {
auto* src = R"(
@group(0) @binding(0) var<storage> arr : array<mat3x3<f32>, 4>;
@@ -1174,22 +1284,59 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
fn tint_unpack_vec3_in_composite_1(in : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>) -> array<mat3x3<f32>, 4u> {
- var result : array<mat3x3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
+ var result = array<mat3x3<f32>, 4u>(tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3]));
+ return result;
+}
+
+@group(0) @binding(0) var<storage> arr : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>;
+
+fn f() {
+ let x = tint_unpack_vec3_in_composite_1(arr);
+}
+)";
+
+ ast::transform::DataMap data;
+ auto got = Run<PackedVec3>(src, data);
+
+ EXPECT_EQ(expect, str(got));
+}
+
+TEST_F(PackedVec3Test, ArrayOfMatrix_ReadArray_Large) {
+ auto* src = R"(
+@group(0) @binding(0) var<storage> arr : array<mat3x3<f32>, 9>;
+
+fn f() {
+ let x = arr;
+}
+)";
+
+ auto* expect = R"(
+enable chromium_internal_relaxed_uniform_layout;
+
+struct tint_packed_vec3_f32_array_element {
+ @align(16)
+ elements : __packed_vec3<f32>,
+}
+
+fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
+ return result;
+}
+
+fn tint_unpack_vec3_in_composite_1(in : array<array<tint_packed_vec3_f32_array_element, 3u>, 9u>) -> array<mat3x3<f32>, 9u> {
+ var result : array<mat3x3<f32>, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
-@group(0) @binding(0) var<storage> arr : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>;
+@group(0) @binding(0) var<storage> arr : array<array<tint_packed_vec3_f32_array_element, 3u>, 9u>;
fn f() {
let x = tint_unpack_vec3_in_composite_1(arr);
@@ -1220,10 +1367,7 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
@@ -1330,7 +1474,7 @@
EXPECT_EQ(expect, str(got));
}
-TEST_F(PackedVec3Test, ArrayOfMatrix_WriteArray_ValueRHS) {
+TEST_F(PackedVec3Test, ArrayOfMatrix_WriteArray_ValueRHS_Small) {
auto* src = R"(
@group(0) @binding(0) var<storage, read_write> arr : array<mat3x3<f32>, 2>;
@@ -1348,18 +1492,12 @@
}
fn tint_pack_vec3_in_composite(in : mat3x3<f32>) -> array<tint_packed_vec3_f32_array_element, 3u> {
- var result : array<tint_packed_vec3_f32_array_element, 3u>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 3u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])));
return result;
}
fn tint_pack_vec3_in_composite_1(in : array<mat3x3<f32>, 2u>) -> array<array<tint_packed_vec3_f32_array_element, 3u>, 2u> {
- var result : array<array<tint_packed_vec3_f32_array_element, 3u>, 2u>;
- for(var i : u32; (i < 2u); i = (i + 1)) {
- result[i] = tint_pack_vec3_in_composite(in[i]);
- }
+ var result = array<array<tint_packed_vec3_f32_array_element, 3u>, 2u>(tint_pack_vec3_in_composite(in[0]), tint_pack_vec3_in_composite(in[1]));
return result;
}
@@ -1376,6 +1514,57 @@
EXPECT_EQ(expect, str(got));
}
+TEST_F(PackedVec3Test, ArrayOfMatrix_WriteArray_ValueRHS_Large) {
+ auto* src = R"(
+@group(0) @binding(0) var<storage, read_write> arr : array<mat3x3<f32>, 9>;
+
+fn f() {
+ arr = array(mat3x3<f32>(),
+ mat3x3(1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5),
+ mat3x3f(),
+ mat3x3f(),
+ mat3x3f(),
+ mat3x3f(),
+ mat3x3f(),
+ mat3x3f(),
+ mat3x3f());
+}
+)";
+
+ auto* expect = R"(
+enable chromium_internal_relaxed_uniform_layout;
+
+struct tint_packed_vec3_f32_array_element {
+ @align(16)
+ elements : __packed_vec3<f32>,
+}
+
+fn tint_pack_vec3_in_composite(in : mat3x3<f32>) -> array<tint_packed_vec3_f32_array_element, 3u> {
+ var result = array<tint_packed_vec3_f32_array_element, 3u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])));
+ return result;
+}
+
+fn tint_pack_vec3_in_composite_1(in : array<mat3x3<f32>, 9u>) -> array<array<tint_packed_vec3_f32_array_element, 3u>, 9u> {
+ var result : array<array<tint_packed_vec3_f32_array_element, 3u>, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
+ result[i] = tint_pack_vec3_in_composite(in[i]);
+ }
+ return result;
+}
+
+@group(0) @binding(0) var<storage, read_write> arr : array<array<tint_packed_vec3_f32_array_element, 3u>, 9u>;
+
+fn f() {
+ arr = tint_pack_vec3_in_composite_1(array(mat3x3<f32>(), mat3x3(1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5), mat3x3f(), mat3x3f(), mat3x3f(), mat3x3f(), mat3x3f(), mat3x3f(), mat3x3f()));
+}
+)";
+
+ ast::transform::DataMap data;
+ auto got = Run<PackedVec3>(src, data);
+
+ EXPECT_EQ(expect, str(got));
+}
+
TEST_F(PackedVec3Test, ArrayOfMatrix_WriteArray_RefRHS) {
auto* src = R"(
@group(0) @binding(0) var<storage, read_write> arr : array<mat3x3<f32>, 2>;
@@ -1427,10 +1616,7 @@
}
fn tint_pack_vec3_in_composite(in : mat3x3<f32>) -> array<tint_packed_vec3_f32_array_element, 3u> {
- var result : array<tint_packed_vec3_f32_array_element, 3u>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 3u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])));
return result;
}
@@ -2025,7 +2211,7 @@
EXPECT_EQ(expect, str(got));
}
-TEST_F(PackedVec3Test, StructMember_ArrayOfVec3_ReadStruct) {
+TEST_F(PackedVec3Test, StructMember_ArrayOfVec3_ReadStruct_Small) {
auto* src = R"(
struct S {
arr : array<vec3<f32>, 4>,
@@ -2052,10 +2238,7 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 4u>) -> array<vec3<f32>, 4u> {
- var result : array<vec3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = array<vec3<f32>, 4u>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements), vec3<f32>(in[3].elements));
return result;
}
@@ -2082,7 +2265,64 @@
EXPECT_EQ(expect, str(got));
}
-TEST_F(PackedVec3Test, StructMember_ArrayOfVec3_ReadArray) {
+TEST_F(PackedVec3Test, StructMember_ArrayOfVec3_ReadStruct_Large) {
+ auto* src = R"(
+struct S {
+ arr : array<vec3<f32>, 9>,
+}
+
+@group(0) @binding(0) var<storage> P : S;
+
+fn f() {
+ let x = P;
+}
+)";
+
+ auto* expect = R"(
+enable chromium_internal_relaxed_uniform_layout;
+
+struct tint_packed_vec3_f32_array_element {
+ @align(16)
+ elements : __packed_vec3<f32>,
+}
+
+struct S_tint_packed_vec3 {
+ @align(16)
+ arr : array<tint_packed_vec3_f32_array_element, 9u>,
+}
+
+fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 9u>) -> array<vec3<f32>, 9u> {
+ var result : array<vec3<f32>, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
+ result[i] = vec3<f32>(in[i].elements);
+ }
+ return result;
+}
+
+fn tint_unpack_vec3_in_composite_1(in : S_tint_packed_vec3) -> S {
+ var result : S;
+ result.arr = tint_unpack_vec3_in_composite(in.arr);
+ return result;
+}
+
+struct S {
+ arr : array<vec3<f32>, 9>,
+}
+
+@group(0) @binding(0) var<storage> P : S_tint_packed_vec3;
+
+fn f() {
+ let x = tint_unpack_vec3_in_composite_1(P);
+}
+)";
+
+ ast::transform::DataMap data;
+ auto got = Run<PackedVec3>(src, data);
+
+ EXPECT_EQ(expect, str(got));
+}
+
+TEST_F(PackedVec3Test, StructMember_ArrayOfVec3_ReadArray_Small) {
auto* src = R"(
struct S {
arr : array<vec3<f32>, 4>,
@@ -2109,15 +2349,63 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 4u>) -> array<vec3<f32>, 4u> {
- var result : array<vec3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
+ var result = array<vec3<f32>, 4u>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements), vec3<f32>(in[3].elements));
+ return result;
+}
+
+struct S {
+ arr : array<vec3<f32>, 4>,
+}
+
+@group(0) @binding(0) var<storage> P : S_tint_packed_vec3;
+
+fn f() {
+ let x = tint_unpack_vec3_in_composite(P.arr);
+}
+)";
+
+ ast::transform::DataMap data;
+ auto got = Run<PackedVec3>(src, data);
+
+ EXPECT_EQ(expect, str(got));
+}
+
+TEST_F(PackedVec3Test, StructMember_ArrayOfVec3_ReadArray_Large) {
+ auto* src = R"(
+struct S {
+ arr : array<vec3<f32>, 9>,
+}
+
+@group(0) @binding(0) var<storage> P : S;
+
+fn f() {
+ let x = P.arr;
+}
+)";
+
+ auto* expect = R"(
+enable chromium_internal_relaxed_uniform_layout;
+
+struct tint_packed_vec3_f32_array_element {
+ @align(16)
+ elements : __packed_vec3<f32>,
+}
+
+struct S_tint_packed_vec3 {
+ @align(16)
+ arr : array<tint_packed_vec3_f32_array_element, 9u>,
+}
+
+fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 9u>) -> array<vec3<f32>, 9u> {
+ var result : array<vec3<f32>, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
result[i] = vec3<f32>(in[i].elements);
}
return result;
}
struct S {
- arr : array<vec3<f32>, 4>,
+ arr : array<vec3<f32>, 9>,
}
@group(0) @binding(0) var<storage> P : S_tint_packed_vec3;
@@ -2262,7 +2550,7 @@
EXPECT_EQ(expect, str(got));
}
-TEST_F(PackedVec3Test, StructMember_ArrayOfVec3_WriteStruct_ValueRHS) {
+TEST_F(PackedVec3Test, StructMember_ArrayOfVec3_WriteStruct_ValueRHS_Small) {
auto* src = R"(
struct S {
arr : array<vec3<f32>, 2>,
@@ -2290,10 +2578,7 @@
}
fn tint_pack_vec3_in_composite(in : array<vec3<f32>, 2u>) -> array<tint_packed_vec3_f32_array_element, 2u> {
- var result : array<tint_packed_vec3_f32_array_element, 2u>;
- for(var i : u32; (i < 2u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 2u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])));
return result;
}
@@ -2320,6 +2605,72 @@
EXPECT_EQ(expect, str(got));
}
+TEST_F(PackedVec3Test, StructMember_ArrayOfVec3_WriteStruct_ValueRHS_Large) {
+ auto* src = R"(
+struct S {
+ arr : array<vec3<f32>, 9>,
+}
+
+@group(0) @binding(0) var<storage, read_write> P : S;
+
+fn f() {
+ P = S(array(vec3(1.5, 4.5, 7.5),
+ vec3(9.5, 6.5, 3.5),
+ vec3(9.5, 6.5, 3.5),
+ vec3(9.5, 6.5, 3.5),
+ vec3(9.5, 6.5, 3.5),
+ vec3(9.5, 6.5, 3.5),
+ vec3(9.5, 6.5, 3.5),
+ vec3(9.5, 6.5, 3.5),
+ vec3(9.5, 6.5, 3.5)));
+}
+)";
+
+ auto* expect =
+ R"(
+enable chromium_internal_relaxed_uniform_layout;
+
+struct tint_packed_vec3_f32_array_element {
+ @align(16)
+ elements : __packed_vec3<f32>,
+}
+
+struct S_tint_packed_vec3 {
+ @align(16)
+ arr : array<tint_packed_vec3_f32_array_element, 9u>,
+}
+
+fn tint_pack_vec3_in_composite(in : array<vec3<f32>, 9u>) -> array<tint_packed_vec3_f32_array_element, 9u> {
+ var result : array<tint_packed_vec3_f32_array_element, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
+ result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
+ }
+ return result;
+}
+
+fn tint_pack_vec3_in_composite_1(in : S) -> S_tint_packed_vec3 {
+ var result : S_tint_packed_vec3;
+ result.arr = tint_pack_vec3_in_composite(in.arr);
+ return result;
+}
+
+struct S {
+ arr : array<vec3<f32>, 9>,
+}
+
+@group(0) @binding(0) var<storage, read_write> P : S_tint_packed_vec3;
+
+fn f() {
+ P = tint_pack_vec3_in_composite_1(S(array(vec3(1.5, 4.5, 7.5), vec3(9.5, 6.5, 3.5), vec3(9.5, 6.5, 3.5), vec3(9.5, 6.5, 3.5), vec3(9.5, 6.5, 3.5), vec3(9.5, 6.5, 3.5), vec3(9.5, 6.5, 3.5), vec3(9.5, 6.5, 3.5), vec3(9.5, 6.5, 3.5))));
+}
+)";
+
+ ast::transform::DataMap data;
+ auto got = Run<PackedVec3>(src, data);
+
+ EXPECT_EQ(expect, str(got));
+}
+
TEST_F(PackedVec3Test, StructMember_ArrayOfVec3_WriteStruct_RefRHS) {
auto* src = R"(
struct S {
@@ -2366,7 +2717,7 @@
EXPECT_EQ(expect, str(got));
}
-TEST_F(PackedVec3Test, StructMember_ArrayOfVec3_WriteArray_ValueRHS) {
+TEST_F(PackedVec3Test, StructMember_ArrayOfVec3_WriteArray_ValueRHS_Small) {
auto* src = R"(
struct S {
arr : array<vec3<f32>, 2>,
@@ -2393,10 +2744,7 @@
}
fn tint_pack_vec3_in_composite(in : array<vec3<f32>, 2u>) -> array<tint_packed_vec3_f32_array_element, 2u> {
- var result : array<tint_packed_vec3_f32_array_element, 2u>;
- for(var i : u32; (i < 2u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 2u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])));
return result;
}
@@ -2417,6 +2765,65 @@
EXPECT_EQ(expect, str(got));
}
+TEST_F(PackedVec3Test, StructMember_ArrayOfVec3_WriteArray_ValueRHS_Large) {
+ auto* src = R"(
+struct S {
+ arr : array<vec3<f32>, 9>,
+}
+
+@group(0) @binding(0) var<storage, read_write> P : S;
+
+fn f() {
+ P.arr = array(vec3(1.5, 4.5, 7.5),
+ vec3(9.5, 6.5, 3.5),
+ vec3(9.5, 6.5, 3.5),
+ vec3(9.5, 6.5, 3.5),
+ vec3(9.5, 6.5, 3.5),
+ vec3(9.5, 6.5, 3.5),
+ vec3(9.5, 6.5, 3.5),
+ vec3(9.5, 6.5, 3.5),
+ vec3(9.5, 6.5, 3.5));
+}
+)";
+
+ auto* expect = R"(
+enable chromium_internal_relaxed_uniform_layout;
+
+struct tint_packed_vec3_f32_array_element {
+ @align(16)
+ elements : __packed_vec3<f32>,
+}
+
+struct S_tint_packed_vec3 {
+ @align(16)
+ arr : array<tint_packed_vec3_f32_array_element, 9u>,
+}
+
+fn tint_pack_vec3_in_composite(in : array<vec3<f32>, 9u>) -> array<tint_packed_vec3_f32_array_element, 9u> {
+ var result : array<tint_packed_vec3_f32_array_element, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
+ result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
+ }
+ return result;
+}
+
+struct S {
+ arr : array<vec3<f32>, 9>,
+}
+
+@group(0) @binding(0) var<storage, read_write> P : S_tint_packed_vec3;
+
+fn f() {
+ P.arr = tint_pack_vec3_in_composite(array(vec3(1.5, 4.5, 7.5), vec3(9.5, 6.5, 3.5), vec3(9.5, 6.5, 3.5), vec3(9.5, 6.5, 3.5), vec3(9.5, 6.5, 3.5), vec3(9.5, 6.5, 3.5), vec3(9.5, 6.5, 3.5), vec3(9.5, 6.5, 3.5), vec3(9.5, 6.5, 3.5)));
+}
+)";
+
+ ast::transform::DataMap data;
+ auto got = Run<PackedVec3>(src, data);
+
+ EXPECT_EQ(expect, str(got));
+}
+
TEST_F(PackedVec3Test, StructMember_ArrayOfVec3_WriteArray_RefRHS) {
auto* src = R"(
struct S {
@@ -2684,10 +3091,7 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
@@ -2741,10 +3145,7 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
@@ -2922,10 +3323,7 @@
}
fn tint_pack_vec3_in_composite(in : mat3x3<f32>) -> array<tint_packed_vec3_f32_array_element, 3u> {
- var result : array<tint_packed_vec3_f32_array_element, 3u>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 3u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])));
return result;
}
@@ -3025,10 +3423,7 @@
}
fn tint_pack_vec3_in_composite(in : mat3x3<f32>) -> array<tint_packed_vec3_f32_array_element, 3u> {
- var result : array<tint_packed_vec3_f32_array_element, 3u>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 3u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])));
return result;
}
@@ -3289,7 +3684,7 @@
EXPECT_EQ(expect, str(got));
}
-TEST_F(PackedVec3Test, StructMember_ArrayOfMatrix_ReadStruct) {
+TEST_F(PackedVec3Test, StructMember_ArrayOfMatrix_ReadStruct_Small) {
auto* src = R"(
struct S {
arr : array<mat3x3<f32>, 4>,
@@ -3316,18 +3711,12 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
fn tint_unpack_vec3_in_composite_1(in : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>) -> array<mat3x3<f32>, 4u> {
- var result : array<mat3x3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ var result = array<mat3x3<f32>, 4u>(tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3]));
return result;
}
@@ -3354,10 +3743,72 @@
EXPECT_EQ(expect, str(got));
}
+TEST_F(PackedVec3Test, StructMember_ArrayOfMatrix_ReadStruct_Large) {
+ auto* src = R"(
+struct S {
+ arr : array<mat3x3<f32>, 9>,
+}
+
+@group(0) @binding(0) var<storage> P : S;
+
+fn f() {
+ let x = P;
+}
+)";
+
+ auto* expect = R"(
+enable chromium_internal_relaxed_uniform_layout;
+
+struct tint_packed_vec3_f32_array_element {
+ @align(16)
+ elements : __packed_vec3<f32>,
+}
+
+struct S_tint_packed_vec3 {
+ @align(16)
+ arr : array<array<tint_packed_vec3_f32_array_element, 3u>, 9u>,
+}
+
+fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
+ return result;
+}
+
+fn tint_unpack_vec3_in_composite_1(in : array<array<tint_packed_vec3_f32_array_element, 3u>, 9u>) -> array<mat3x3<f32>, 9u> {
+ var result : array<mat3x3<f32>, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
+ result[i] = tint_unpack_vec3_in_composite(in[i]);
+ }
+ return result;
+}
+
+fn tint_unpack_vec3_in_composite_2(in : S_tint_packed_vec3) -> S {
+ var result : S;
+ result.arr = tint_unpack_vec3_in_composite_1(in.arr);
+ return result;
+}
+
+struct S {
+ arr : array<mat3x3<f32>, 9>,
+}
+
+@group(0) @binding(0) var<storage> P : S_tint_packed_vec3;
+
+fn f() {
+ let x = tint_unpack_vec3_in_composite_2(P);
+}
+)";
+
+ ast::transform::DataMap data;
+ auto got = Run<PackedVec3>(src, data);
+
+ EXPECT_EQ(expect, str(got));
+}
+
TEST_F(PackedVec3Test, StructMember_ArrayOfMatrix_ReadArray) {
auto* src = R"(
struct S {
- arr : array<mat3x3<f32>, 4>,
+ arr : array<mat3x3<f32>, 9>,
}
@group(0) @binding(0) var<storage> P : S;
@@ -3377,27 +3828,24 @@
struct S_tint_packed_vec3 {
@align(16)
- arr : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>,
+ arr : array<array<tint_packed_vec3_f32_array_element, 3u>, 9u>,
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
-fn tint_unpack_vec3_in_composite_1(in : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>) -> array<mat3x3<f32>, 4u> {
- var result : array<mat3x3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
+fn tint_unpack_vec3_in_composite_1(in : array<array<tint_packed_vec3_f32_array_element, 3u>, 9u>) -> array<mat3x3<f32>, 9u> {
+ var result : array<mat3x3<f32>, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
result[i] = tint_unpack_vec3_in_composite(in[i]);
}
return result;
}
struct S {
- arr : array<mat3x3<f32>, 4>,
+ arr : array<mat3x3<f32>, 9>,
}
@group(0) @binding(0) var<storage> P : S_tint_packed_vec3;
@@ -3440,10 +3888,7 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
@@ -3621,18 +4066,12 @@
}
fn tint_pack_vec3_in_composite(in : mat3x3<f32>) -> array<tint_packed_vec3_f32_array_element, 3u> {
- var result : array<tint_packed_vec3_f32_array_element, 3u>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 3u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])));
return result;
}
fn tint_pack_vec3_in_composite_1(in : array<mat3x3<f32>, 2u>) -> array<array<tint_packed_vec3_f32_array_element, 3u>, 2u> {
- var result : array<array<tint_packed_vec3_f32_array_element, 3u>, 2u>;
- for(var i : u32; (i < 2u); i = (i + 1)) {
- result[i] = tint_pack_vec3_in_composite(in[i]);
- }
+ var result = array<array<tint_packed_vec3_f32_array_element, 3u>, 2u>(tint_pack_vec3_in_composite(in[0]), tint_pack_vec3_in_composite(in[1]));
return result;
}
@@ -3732,18 +4171,12 @@
}
fn tint_pack_vec3_in_composite(in : mat3x3<f32>) -> array<tint_packed_vec3_f32_array_element, 3u> {
- var result : array<tint_packed_vec3_f32_array_element, 3u>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 3u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])));
return result;
}
fn tint_pack_vec3_in_composite_1(in : array<mat3x3<f32>, 2u>) -> array<array<tint_packed_vec3_f32_array_element, 3u>, 2u> {
- var result : array<array<tint_packed_vec3_f32_array_element, 3u>, 2u>;
- for(var i : u32; (i < 2u); i = (i + 1)) {
- result[i] = tint_pack_vec3_in_composite(in[i]);
- }
+ var result = array<array<tint_packed_vec3_f32_array_element, 3u>, 2u>(tint_pack_vec3_in_composite(in[0]), tint_pack_vec3_in_composite(in[1]));
return result;
}
@@ -3846,10 +4279,7 @@
}
fn tint_pack_vec3_in_composite(in : mat3x3<f32>) -> array<tint_packed_vec3_f32_array_element, 3u> {
- var result : array<tint_packed_vec3_f32_array_element, 3u>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 3u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])));
return result;
}
@@ -4510,10 +4940,7 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 4u>) -> array<vec3<f32>, 4u> {
- var result : array<vec3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = array<vec3<f32>, 4u>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements), vec3<f32>(in[3].elements));
return result;
}
@@ -4528,10 +4955,7 @@
}
fn tint_pack_vec3_in_composite(in : array<vec3<f32>, 4u>) -> array<tint_packed_vec3_f32_array_element, 4u> {
- var result : array<tint_packed_vec3_f32_array_element, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 4u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[3])));
return result;
}
@@ -4759,10 +5183,7 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 4u>) -> array<vec3<f32>, 4u> {
- var result : array<vec3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = array<vec3<f32>, 4u>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements), vec3<f32>(in[3].elements));
return result;
}
@@ -4965,18 +5386,12 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
fn tint_pack_vec3_in_composite(in : mat3x3<f32>) -> array<tint_packed_vec3_f32_array_element, 3u> {
- var result : array<tint_packed_vec3_f32_array_element, 3u>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 3u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])));
return result;
}
@@ -5047,18 +5462,12 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 4u>) -> array<vec3<f32>, 4u> {
- var result : array<vec3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = array<vec3<f32>, 4u>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements), vec3<f32>(in[3].elements));
return result;
}
fn tint_pack_vec3_in_composite(in : array<vec3<f32>, 4u>) -> array<tint_packed_vec3_f32_array_element, 4u> {
- var result : array<tint_packed_vec3_f32_array_element, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 4u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[3])));
return result;
}
@@ -5120,34 +5529,22 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
fn tint_unpack_vec3_in_composite_1(in : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>) -> array<mat3x3<f32>, 4u> {
- var result : array<mat3x3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ var result = array<mat3x3<f32>, 4u>(tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3]));
return result;
}
fn tint_pack_vec3_in_composite(in : mat3x3<f32>) -> array<tint_packed_vec3_f32_array_element, 3u> {
- var result : array<tint_packed_vec3_f32_array_element, 3u>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 3u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])));
return result;
}
fn tint_pack_vec3_in_composite_1(in : array<mat3x3<f32>, 4u>) -> array<array<tint_packed_vec3_f32_array_element, 3u>, 4u> {
- var result : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_pack_vec3_in_composite(in[i]);
- }
+ var result = array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>(tint_pack_vec3_in_composite(in[0]), tint_pack_vec3_in_composite(in[1]), tint_pack_vec3_in_composite(in[2]), tint_pack_vec3_in_composite(in[3]));
return result;
}
@@ -5213,26 +5610,17 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
fn tint_unpack_vec3_in_composite_1(in : array<tint_packed_vec3_f32_array_element, 4u>) -> array<vec3<f32>, 4u> {
- var result : array<vec3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = array<vec3<f32>, 4u>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements), vec3<f32>(in[3].elements));
return result;
}
fn tint_unpack_vec3_in_composite_2(in : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>) -> array<mat3x3<f32>, 4u> {
- var result : array<mat3x3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ var result = array<mat3x3<f32>, 4u>(tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3]));
return result;
}
@@ -5246,26 +5634,17 @@
}
fn tint_pack_vec3_in_composite(in : mat3x3<f32>) -> array<tint_packed_vec3_f32_array_element, 3u> {
- var result : array<tint_packed_vec3_f32_array_element, 3u>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 3u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])));
return result;
}
fn tint_pack_vec3_in_composite_1(in : array<vec3<f32>, 4u>) -> array<tint_packed_vec3_f32_array_element, 4u> {
- var result : array<tint_packed_vec3_f32_array_element, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 4u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[3])));
return result;
}
fn tint_pack_vec3_in_composite_2(in : array<mat3x3<f32>, 4u>) -> array<array<tint_packed_vec3_f32_array_element, 3u>, 4u> {
- var result : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_pack_vec3_in_composite(in[i]);
- }
+ var result = array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>(tint_pack_vec3_in_composite(in[0]), tint_pack_vec3_in_composite(in[1]), tint_pack_vec3_in_composite(in[2]), tint_pack_vec3_in_composite(in[3]));
return result;
}
@@ -5460,18 +5839,12 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
fn tint_pack_vec3_in_composite(in : mat3x3<f32>) -> array<tint_packed_vec3_f32_array_element, 3u> {
- var result : array<tint_packed_vec3_f32_array_element, 3u>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 3u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])));
return result;
}
@@ -5551,18 +5924,12 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 4u>) -> array<vec3<f32>, 4u> {
- var result : array<vec3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = array<vec3<f32>, 4u>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements), vec3<f32>(in[3].elements));
return result;
}
fn tint_pack_vec3_in_composite(in : array<vec3<f32>, 4u>) -> array<tint_packed_vec3_f32_array_element, 4u> {
- var result : array<tint_packed_vec3_f32_array_element, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 4u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[3])));
return result;
}
@@ -5635,34 +6002,22 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
fn tint_unpack_vec3_in_composite_1(in : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>) -> array<mat3x3<f32>, 4u> {
- var result : array<mat3x3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ var result = array<mat3x3<f32>, 4u>(tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3]));
return result;
}
fn tint_pack_vec3_in_composite(in : mat3x3<f32>) -> array<tint_packed_vec3_f32_array_element, 3u> {
- var result : array<tint_packed_vec3_f32_array_element, 3u>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 3u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])));
return result;
}
fn tint_pack_vec3_in_composite_1(in : array<mat3x3<f32>, 4u>) -> array<array<tint_packed_vec3_f32_array_element, 3u>, 4u> {
- var result : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_pack_vec3_in_composite(in[i]);
- }
+ var result = array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>(tint_pack_vec3_in_composite(in[0]), tint_pack_vec3_in_composite(in[1]), tint_pack_vec3_in_composite(in[2]), tint_pack_vec3_in_composite(in[3]));
return result;
}
@@ -5741,26 +6096,17 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
fn tint_unpack_vec3_in_composite_1(in : array<tint_packed_vec3_f32_array_element, 4u>) -> array<vec3<f32>, 4u> {
- var result : array<vec3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = array<vec3<f32>, 4u>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements), vec3<f32>(in[3].elements));
return result;
}
fn tint_unpack_vec3_in_composite_2(in : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>) -> array<mat3x3<f32>, 4u> {
- var result : array<mat3x3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ var result = array<mat3x3<f32>, 4u>(tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3]));
return result;
}
@@ -5774,26 +6120,17 @@
}
fn tint_pack_vec3_in_composite(in : mat3x3<f32>) -> array<tint_packed_vec3_f32_array_element, 3u> {
- var result : array<tint_packed_vec3_f32_array_element, 3u>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 3u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])));
return result;
}
fn tint_pack_vec3_in_composite_1(in : array<vec3<f32>, 4u>) -> array<tint_packed_vec3_f32_array_element, 4u> {
- var result : array<tint_packed_vec3_f32_array_element, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 4u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[3])));
return result;
}
fn tint_pack_vec3_in_composite_2(in : array<mat3x3<f32>, 4u>) -> array<array<tint_packed_vec3_f32_array_element, 3u>, 4u> {
- var result : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_pack_vec3_in_composite(in[i]);
- }
+ var result = array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>(tint_pack_vec3_in_composite(in[0]), tint_pack_vec3_in_composite(in[1]), tint_pack_vec3_in_composite(in[2]), tint_pack_vec3_in_composite(in[3]));
return result;
}
@@ -5868,10 +6205,7 @@
}
fn tint_pack_vec3_in_composite(in : array<vec3<f32>, 4u>) -> array<tint_packed_vec3_f32_array_element, 4u> {
- var result : array<tint_packed_vec3_f32_array_element, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 4u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[3])));
return result;
}
@@ -5947,10 +6281,7 @@
}
fn tint_pack_vec3_in_composite(in : array<vec3<f32>, 4u>) -> array<tint_packed_vec3_f32_array_element, 4u> {
- var result : array<tint_packed_vec3_f32_array_element, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 4u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[3])));
return result;
}
@@ -6041,10 +6372,7 @@
}
fn tint_pack_vec3_in_composite(in : array<vec3<f32>, 4u>) -> array<tint_packed_vec3_f32_array_element, 4u> {
- var result : array<tint_packed_vec3_f32_array_element, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 4u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[3])));
return result;
}
@@ -6133,26 +6461,17 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
fn tint_unpack_vec3_in_composite_1(in : array<tint_packed_vec3_f32_array_element, 4u>) -> array<vec3<f32>, 4u> {
- var result : array<vec3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = array<vec3<f32>, 4u>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements), vec3<f32>(in[3].elements));
return result;
}
fn tint_unpack_vec3_in_composite_2(in : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>) -> array<mat3x3<f32>, 4u> {
- var result : array<mat3x3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ var result = array<mat3x3<f32>, 4u>(tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3]));
return result;
}
@@ -6239,26 +6558,17 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
fn tint_unpack_vec3_in_composite_1(in : array<tint_packed_vec3_f32_array_element, 4u>) -> array<vec3<f32>, 4u> {
- var result : array<vec3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = array<vec3<f32>, 4u>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements), vec3<f32>(in[3].elements));
return result;
}
fn tint_unpack_vec3_in_composite_2(in : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>) -> array<mat3x3<f32>, 4u> {
- var result : array<mat3x3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ var result = array<mat3x3<f32>, 4u>(tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3]));
return result;
}
@@ -6484,10 +6794,7 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
@@ -6706,10 +7013,7 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
@@ -6933,10 +7237,7 @@
}
fn tint_pack_vec3_in_composite(in : array<vec3<f32>, 4u>) -> array<tint_packed_vec3_f32_array_element, 4u> {
- var result : array<tint_packed_vec3_f32_array_element, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 4u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[3])));
return result;
}
@@ -7000,18 +7301,12 @@
}
fn tint_pack_vec3_in_composite(in : array<vec3<f32>, 4u>) -> array<tint_packed_vec3_f32_array_element, 4u> {
- var result : array<tint_packed_vec3_f32_array_element, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 4u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[3])));
return result;
}
fn tint_pack_vec3_in_composite_1(in : array<array<vec3<f32>, 4u>, 4u>) -> array<array<tint_packed_vec3_f32_array_element, 4u>, 4u> {
- var result : array<array<tint_packed_vec3_f32_array_element, 4u>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_pack_vec3_in_composite(in[i]);
- }
+ var result = array<array<tint_packed_vec3_f32_array_element, 4u>, 4u>(tint_pack_vec3_in_composite(in[0]), tint_pack_vec3_in_composite(in[1]), tint_pack_vec3_in_composite(in[2]), tint_pack_vec3_in_composite(in[3]));
return result;
}
@@ -7075,10 +7370,7 @@
}
fn tint_pack_vec3_in_composite(in : mat3x3<f32>) -> array<tint_packed_vec3_f32_array_element, 3u> {
- var result : array<tint_packed_vec3_f32_array_element, 3u>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 3u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])));
return result;
}
@@ -7140,18 +7432,12 @@
}
fn tint_pack_vec3_in_composite(in : mat3x3<f32>) -> array<tint_packed_vec3_f32_array_element, 3u> {
- var result : array<tint_packed_vec3_f32_array_element, 3u>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[i]));
- }
+ var result = array<tint_packed_vec3_f32_array_element, 3u>(tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[0])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[1])), tint_packed_vec3_f32_array_element(__packed_vec3<f32>(in[2])));
return result;
}
fn tint_pack_vec3_in_composite_1(in : array<mat3x3<f32>, 4u>) -> array<array<tint_packed_vec3_f32_array_element, 3u>, 4u> {
- var result : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_pack_vec3_in_composite(in[i]);
- }
+ var result = array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>(tint_pack_vec3_in_composite(in[0]), tint_pack_vec3_in_composite(in[1]), tint_pack_vec3_in_composite(in[2]), tint_pack_vec3_in_composite(in[3]));
return result;
}
@@ -7222,42 +7508,27 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 4u>) -> array<vec3<f32>, 4u> {
- var result : array<vec3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = array<vec3<f32>, 4u>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements), vec3<f32>(in[3].elements));
return result;
}
fn tint_unpack_vec3_in_composite_1(in : array<array<tint_packed_vec3_f32_array_element, 4u>, 4u>) -> array<array<vec3<f32>, 4u>, 4u> {
- var result : array<array<vec3<f32>, 4u>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ var result = array<array<vec3<f32>, 4u>, 4u>(tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3]));
return result;
}
fn tint_unpack_vec3_in_composite_2(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
fn tint_unpack_vec3_in_composite_3(in : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>) -> array<mat3x3<f32>, 4u> {
- var result : array<mat3x3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite_2(in[i]);
- }
+ var result = array<mat3x3<f32>, 4u>(tint_unpack_vec3_in_composite_2(in[0]), tint_unpack_vec3_in_composite_2(in[1]), tint_unpack_vec3_in_composite_2(in[2]), tint_unpack_vec3_in_composite_2(in[3]));
return result;
}
fn tint_unpack_vec3_in_composite_4(in : array<array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>, 4u>) -> array<array<mat3x3<f32>, 4u>, 4u> {
- var result : array<array<mat3x3<f32>, 4u>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite_3(in[i]);
- }
+ var result = array<array<mat3x3<f32>, 4u>, 4u>(tint_unpack_vec3_in_composite_3(in[0]), tint_unpack_vec3_in_composite_3(in[1]), tint_unpack_vec3_in_composite_3(in[2]), tint_unpack_vec3_in_composite_3(in[3]));
return result;
}
@@ -7269,10 +7540,7 @@
}
fn tint_unpack_vec3_in_composite_6(in : array<S_tint_packed_vec3, 4u>) -> array<S, 4u> {
- var result : array<S, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite_5(in[i]);
- }
+ var result = array<S, 4u>(tint_unpack_vec3_in_composite_5(in[0]), tint_unpack_vec3_in_composite_5(in[1]), tint_unpack_vec3_in_composite_5(in[2]), tint_unpack_vec3_in_composite_5(in[3]));
return result;
}
@@ -7304,7 +7572,7 @@
EXPECT_EQ(expect, str(got));
}
-TEST_F(PackedVec3Test, NestedArrays_VarInit) {
+TEST_F(PackedVec3Test, NestedArrays_VarInit_Small) {
auto* src = R"(
struct S {
arr_v : array<array<vec3<f32>, 4>, 4>,
@@ -7345,42 +7613,27 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 4u>) -> array<vec3<f32>, 4u> {
- var result : array<vec3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = array<vec3<f32>, 4u>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements), vec3<f32>(in[3].elements));
return result;
}
fn tint_unpack_vec3_in_composite_1(in : array<array<tint_packed_vec3_f32_array_element, 4u>, 4u>) -> array<array<vec3<f32>, 4u>, 4u> {
- var result : array<array<vec3<f32>, 4u>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ var result = array<array<vec3<f32>, 4u>, 4u>(tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3]));
return result;
}
fn tint_unpack_vec3_in_composite_2(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
fn tint_unpack_vec3_in_composite_3(in : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>) -> array<mat3x3<f32>, 4u> {
- var result : array<mat3x3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite_2(in[i]);
- }
+ var result = array<mat3x3<f32>, 4u>(tint_unpack_vec3_in_composite_2(in[0]), tint_unpack_vec3_in_composite_2(in[1]), tint_unpack_vec3_in_composite_2(in[2]), tint_unpack_vec3_in_composite_2(in[3]));
return result;
}
fn tint_unpack_vec3_in_composite_4(in : array<array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>, 4u>) -> array<array<mat3x3<f32>, 4u>, 4u> {
- var result : array<array<mat3x3<f32>, 4u>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite_3(in[i]);
- }
+ var result = array<array<mat3x3<f32>, 4u>, 4u>(tint_unpack_vec3_in_composite_3(in[0]), tint_unpack_vec3_in_composite_3(in[1]), tint_unpack_vec3_in_composite_3(in[2]), tint_unpack_vec3_in_composite_3(in[3]));
return result;
}
@@ -7392,10 +7645,7 @@
}
fn tint_unpack_vec3_in_composite_6(in : array<S_tint_packed_vec3, 4u>) -> array<S, 4u> {
- var result : array<S, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite_5(in[i]);
- }
+ var result = array<S, 4u>(tint_unpack_vec3_in_composite_5(in[0]), tint_unpack_vec3_in_composite_5(in[1]), tint_unpack_vec3_in_composite_5(in[2]), tint_unpack_vec3_in_composite_5(in[3]));
return result;
}
@@ -7427,7 +7677,127 @@
EXPECT_EQ(expect, str(got));
}
-TEST_F(PackedVec3Test, NestedArrays_VarAssignment) {
+TEST_F(PackedVec3Test, NestedArrays_VarInit_Large) {
+ auto* src = R"(
+struct S {
+ arr_v : array<array<vec3<f32>, 9>, 9>,
+ arr_m : array<array<mat3x3<f32>, 9>, 9>,
+}
+
+@group(0) @binding(0) var<storage, read_write> arr_s : array<S, 9>;
+
+fn f() {
+ var full_var : array<S, 9> = arr_s;
+ var struct_var : S = arr_s[0];
+ var outer_arr_v_var : array<array<vec3<f32>, 9>, 9> = arr_s[0].arr_v;
+ var inner_arr_v_var : array<vec3<f32>, 9> = arr_s[0].arr_v[1];
+ var v_var : vec3<f32> = arr_s[0].arr_v[1][2];
+ var v_element_var : f32 = arr_s[0].arr_v[1][2].y;
+ var outer_arr_m_var : array<array<mat3x3<f32>, 9>, 9> = arr_s[0].arr_m;
+ var inner_arr_m_var : array<mat3x3<f32>, 9> = arr_s[0].arr_m[1];
+ var m_var : mat3x3<f32> = arr_s[0].arr_m[1][2];
+ var m_col_var : vec3<f32> = arr_s[0].arr_m[1][2][0];
+ var m_element_var : f32 = arr_s[0].arr_m[1][2][0].y;
+}
+)";
+
+ auto* expect =
+ R"(
+enable chromium_internal_relaxed_uniform_layout;
+
+struct tint_packed_vec3_f32_array_element {
+ @align(16)
+ elements : __packed_vec3<f32>,
+}
+
+struct S_tint_packed_vec3 {
+ @align(16)
+ arr_v : array<array<tint_packed_vec3_f32_array_element, 9u>, 9u>,
+ @align(16)
+ arr_m : array<array<array<tint_packed_vec3_f32_array_element, 3u>, 9u>, 9u>,
+}
+
+fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 9u>) -> array<vec3<f32>, 9u> {
+ var result : array<vec3<f32>, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
+ result[i] = vec3<f32>(in[i].elements);
+ }
+ return result;
+}
+
+fn tint_unpack_vec3_in_composite_1(in : array<array<tint_packed_vec3_f32_array_element, 9u>, 9u>) -> array<array<vec3<f32>, 9u>, 9u> {
+ var result : array<array<vec3<f32>, 9u>, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
+ result[i] = tint_unpack_vec3_in_composite(in[i]);
+ }
+ return result;
+}
+
+fn tint_unpack_vec3_in_composite_2(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
+ return result;
+}
+
+fn tint_unpack_vec3_in_composite_3(in : array<array<tint_packed_vec3_f32_array_element, 3u>, 9u>) -> array<mat3x3<f32>, 9u> {
+ var result : array<mat3x3<f32>, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
+ result[i] = tint_unpack_vec3_in_composite_2(in[i]);
+ }
+ return result;
+}
+
+fn tint_unpack_vec3_in_composite_4(in : array<array<array<tint_packed_vec3_f32_array_element, 3u>, 9u>, 9u>) -> array<array<mat3x3<f32>, 9u>, 9u> {
+ var result : array<array<mat3x3<f32>, 9u>, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
+ result[i] = tint_unpack_vec3_in_composite_3(in[i]);
+ }
+ return result;
+}
+
+fn tint_unpack_vec3_in_composite_5(in : S_tint_packed_vec3) -> S {
+ var result : S;
+ result.arr_v = tint_unpack_vec3_in_composite_1(in.arr_v);
+ result.arr_m = tint_unpack_vec3_in_composite_4(in.arr_m);
+ return result;
+}
+
+fn tint_unpack_vec3_in_composite_6(in : array<S_tint_packed_vec3, 9u>) -> array<S, 9u> {
+ var result : array<S, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
+ result[i] = tint_unpack_vec3_in_composite_5(in[i]);
+ }
+ return result;
+}
+
+struct S {
+ arr_v : array<array<vec3<f32>, 9>, 9>,
+ arr_m : array<array<mat3x3<f32>, 9>, 9>,
+}
+
+@group(0) @binding(0) var<storage, read_write> arr_s : array<S_tint_packed_vec3, 9u>;
+
+fn f() {
+ var full_var : array<S, 9> = tint_unpack_vec3_in_composite_6(arr_s);
+ var struct_var : S = tint_unpack_vec3_in_composite_5(arr_s[0]);
+ var outer_arr_v_var : array<array<vec3<f32>, 9>, 9> = tint_unpack_vec3_in_composite_1(arr_s[0].arr_v);
+ var inner_arr_v_var : array<vec3<f32>, 9> = tint_unpack_vec3_in_composite(arr_s[0].arr_v[1]);
+ var v_var : vec3<f32> = vec3<f32>(arr_s[0].arr_v[1][2].elements);
+ var v_element_var : f32 = arr_s[0].arr_v[1][2].elements.y;
+ var outer_arr_m_var : array<array<mat3x3<f32>, 9>, 9> = tint_unpack_vec3_in_composite_4(arr_s[0].arr_m);
+ var inner_arr_m_var : array<mat3x3<f32>, 9> = tint_unpack_vec3_in_composite_3(arr_s[0].arr_m[1]);
+ var m_var : mat3x3<f32> = tint_unpack_vec3_in_composite_2(arr_s[0].arr_m[1][2]);
+ var m_col_var : vec3<f32> = vec3<f32>(arr_s[0].arr_m[1][2][0].elements);
+ var m_element_var : f32 = arr_s[0].arr_m[1][2][0].elements.y;
+}
+)";
+
+ ast::transform::DataMap data;
+ auto got = Run<PackedVec3>(src, data);
+
+ EXPECT_EQ(expect, str(got));
+}
+
+TEST_F(PackedVec3Test, NestedArrays_VarAssignment_Small) {
auto* src = R"(
struct S {
arr_v : array<array<vec3<f32>, 4>, 4>,
@@ -7480,42 +7850,27 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 4u>) -> array<vec3<f32>, 4u> {
- var result : array<vec3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = array<vec3<f32>, 4u>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements), vec3<f32>(in[3].elements));
return result;
}
fn tint_unpack_vec3_in_composite_1(in : array<array<tint_packed_vec3_f32_array_element, 4u>, 4u>) -> array<array<vec3<f32>, 4u>, 4u> {
- var result : array<array<vec3<f32>, 4u>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ var result = array<array<vec3<f32>, 4u>, 4u>(tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3]));
return result;
}
fn tint_unpack_vec3_in_composite_2(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
fn tint_unpack_vec3_in_composite_3(in : array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>) -> array<mat3x3<f32>, 4u> {
- var result : array<mat3x3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite_2(in[i]);
- }
+ var result = array<mat3x3<f32>, 4u>(tint_unpack_vec3_in_composite_2(in[0]), tint_unpack_vec3_in_composite_2(in[1]), tint_unpack_vec3_in_composite_2(in[2]), tint_unpack_vec3_in_composite_2(in[3]));
return result;
}
fn tint_unpack_vec3_in_composite_4(in : array<array<array<tint_packed_vec3_f32_array_element, 3u>, 4u>, 4u>) -> array<array<mat3x3<f32>, 4u>, 4u> {
- var result : array<array<mat3x3<f32>, 4u>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite_3(in[i]);
- }
+ var result = array<array<mat3x3<f32>, 4u>, 4u>(tint_unpack_vec3_in_composite_3(in[0]), tint_unpack_vec3_in_composite_3(in[1]), tint_unpack_vec3_in_composite_3(in[2]), tint_unpack_vec3_in_composite_3(in[3]));
return result;
}
@@ -7527,10 +7882,7 @@
}
fn tint_unpack_vec3_in_composite_6(in : array<S_tint_packed_vec3, 4u>) -> array<S, 4u> {
- var result : array<S, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = tint_unpack_vec3_in_composite_5(in[i]);
- }
+ var result = array<S, 4u>(tint_unpack_vec3_in_composite_5(in[0]), tint_unpack_vec3_in_composite_5(in[1]), tint_unpack_vec3_in_composite_5(in[2]), tint_unpack_vec3_in_composite_5(in[3]));
return result;
}
@@ -7573,6 +7925,149 @@
EXPECT_EQ(expect, str(got));
}
+TEST_F(PackedVec3Test, NestedArrays_VarAssignment_Large) {
+ auto* src = R"(
+struct S {
+ arr_v : array<array<vec3<f32>, 9>, 9>,
+ arr_m : array<array<mat3x3<f32>, 9>, 9>,
+}
+
+@group(0) @binding(0) var<storage, read_write> arr_s : array<S, 9>;
+
+fn f() {
+ var full_var : array<S, 9>;
+ var struct_var : S;
+ var outer_arr_v_var : array<array<vec3<f32>, 9>, 9>;
+ var inner_arr_v_var : array<vec3<f32>, 9>;
+ var v_var : vec3<f32>;
+ var v_element_var : f32;
+ var outer_arr_m_var : array<array<mat3x3<f32>, 9>, 9>;
+ var inner_arr_m_var : array<mat3x3<f32>, 9>;
+ var m_var : mat3x3<f32>;
+ var m_col_var : vec3<f32>;
+ var m_element_var : f32;
+
+ full_var = arr_s;
+ struct_var = arr_s[0];
+ outer_arr_v_var = arr_s[0].arr_v;
+ inner_arr_v_var = arr_s[0].arr_v[1];
+ v_var = arr_s[0].arr_v[1][2];
+ v_element_var = arr_s[0].arr_v[1][2].y;
+ outer_arr_m_var = arr_s[0].arr_m;
+ inner_arr_m_var = arr_s[0].arr_m[1];
+ m_var = arr_s[0].arr_m[1][2];
+ m_col_var = arr_s[0].arr_m[1][2][0];
+ m_element_var = arr_s[0].arr_m[1][2][0].y;
+}
+)";
+
+ auto* expect =
+ R"(
+enable chromium_internal_relaxed_uniform_layout;
+
+struct tint_packed_vec3_f32_array_element {
+ @align(16)
+ elements : __packed_vec3<f32>,
+}
+
+struct S_tint_packed_vec3 {
+ @align(16)
+ arr_v : array<array<tint_packed_vec3_f32_array_element, 9u>, 9u>,
+ @align(16)
+ arr_m : array<array<array<tint_packed_vec3_f32_array_element, 3u>, 9u>, 9u>,
+}
+
+fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 9u>) -> array<vec3<f32>, 9u> {
+ var result : array<vec3<f32>, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
+ result[i] = vec3<f32>(in[i].elements);
+ }
+ return result;
+}
+
+fn tint_unpack_vec3_in_composite_1(in : array<array<tint_packed_vec3_f32_array_element, 9u>, 9u>) -> array<array<vec3<f32>, 9u>, 9u> {
+ var result : array<array<vec3<f32>, 9u>, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
+ result[i] = tint_unpack_vec3_in_composite(in[i]);
+ }
+ return result;
+}
+
+fn tint_unpack_vec3_in_composite_2(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
+ return result;
+}
+
+fn tint_unpack_vec3_in_composite_3(in : array<array<tint_packed_vec3_f32_array_element, 3u>, 9u>) -> array<mat3x3<f32>, 9u> {
+ var result : array<mat3x3<f32>, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
+ result[i] = tint_unpack_vec3_in_composite_2(in[i]);
+ }
+ return result;
+}
+
+fn tint_unpack_vec3_in_composite_4(in : array<array<array<tint_packed_vec3_f32_array_element, 3u>, 9u>, 9u>) -> array<array<mat3x3<f32>, 9u>, 9u> {
+ var result : array<array<mat3x3<f32>, 9u>, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
+ result[i] = tint_unpack_vec3_in_composite_3(in[i]);
+ }
+ return result;
+}
+
+fn tint_unpack_vec3_in_composite_5(in : S_tint_packed_vec3) -> S {
+ var result : S;
+ result.arr_v = tint_unpack_vec3_in_composite_1(in.arr_v);
+ result.arr_m = tint_unpack_vec3_in_composite_4(in.arr_m);
+ return result;
+}
+
+fn tint_unpack_vec3_in_composite_6(in : array<S_tint_packed_vec3, 9u>) -> array<S, 9u> {
+ var result : array<S, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
+ result[i] = tint_unpack_vec3_in_composite_5(in[i]);
+ }
+ return result;
+}
+
+struct S {
+ arr_v : array<array<vec3<f32>, 9>, 9>,
+ arr_m : array<array<mat3x3<f32>, 9>, 9>,
+}
+
+@group(0) @binding(0) var<storage, read_write> arr_s : array<S_tint_packed_vec3, 9u>;
+
+fn f() {
+ var full_var : array<S, 9>;
+ var struct_var : S;
+ var outer_arr_v_var : array<array<vec3<f32>, 9>, 9>;
+ var inner_arr_v_var : array<vec3<f32>, 9>;
+ var v_var : vec3<f32>;
+ var v_element_var : f32;
+ var outer_arr_m_var : array<array<mat3x3<f32>, 9>, 9>;
+ var inner_arr_m_var : array<mat3x3<f32>, 9>;
+ var m_var : mat3x3<f32>;
+ var m_col_var : vec3<f32>;
+ var m_element_var : f32;
+ full_var = tint_unpack_vec3_in_composite_6(arr_s);
+ struct_var = tint_unpack_vec3_in_composite_5(arr_s[0]);
+ outer_arr_v_var = tint_unpack_vec3_in_composite_1(arr_s[0].arr_v);
+ inner_arr_v_var = tint_unpack_vec3_in_composite(arr_s[0].arr_v[1]);
+ v_var = vec3<f32>(arr_s[0].arr_v[1][2].elements);
+ v_element_var = arr_s[0].arr_v[1][2].elements.y;
+ outer_arr_m_var = tint_unpack_vec3_in_composite_4(arr_s[0].arr_m);
+ inner_arr_m_var = tint_unpack_vec3_in_composite_3(arr_s[0].arr_m[1]);
+ m_var = tint_unpack_vec3_in_composite_2(arr_s[0].arr_m[1][2]);
+ m_col_var = vec3<f32>(arr_s[0].arr_m[1][2][0].elements);
+ m_element_var = arr_s[0].arr_m[1][2][0].elements.y;
+}
+)";
+
+ ast::transform::DataMap data;
+ auto got = Run<PackedVec3>(src, data);
+
+ EXPECT_EQ(expect, str(got));
+}
+
TEST_F(PackedVec3Test, RuntimeSizedArray) {
auto* src = R"(
struct S {
@@ -7817,10 +8312,7 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
@@ -7939,10 +8431,7 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 3u>) -> mat3x3<f32> {
- var result : mat3x3<f32>;
- for(var i : u32; (i < 3u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = mat3x3<f32>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements));
return result;
}
@@ -8048,7 +8537,7 @@
EXPECT_EQ(expect, str(got));
}
-TEST_F(PackedVec3Test, Aliases) {
+TEST_F(PackedVec3Test, Aliases_Small) {
auto* src = R"(
alias VecArray = array<vec3<f32>, 4>;
alias MatArray = array<mat3x3<f32>, 4>;
@@ -8097,10 +8586,7 @@
}
fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 4u>) -> array<vec3<f32>, 4u> {
- var result : array<vec3<f32>, 4u>;
- for(var i : u32; (i < 4u); i = (i + 1)) {
- result[i] = vec3<f32>(in[i].elements);
- }
+ var result = array<vec3<f32>, 4u>(vec3<f32>(in[0].elements), vec3<f32>(in[1].elements), vec3<f32>(in[2].elements), vec3<f32>(in[3].elements));
return result;
}
@@ -8142,6 +8628,100 @@
EXPECT_EQ(expect, str(got));
}
+TEST_F(PackedVec3Test, Aliases_Large) {
+ auto* src = R"(
+alias VecArray = array<vec3<f32>, 9>;
+alias MatArray = array<mat3x3<f32>, 9>;
+alias NestedArray = array<VecArray, 9>;
+
+struct S {
+ v : VecArray,
+ m : MatArray,
+ n : NestedArray,
+}
+
+@group(0) @binding(0) var<storage, read_write> s : S;
+@group(0) @binding(1) var<storage, read_write> arr_v : VecArray;
+@group(0) @binding(2) var<storage, read_write> arr_m : MatArray;
+@group(0) @binding(3) var<storage, read_write> arr_n : NestedArray;
+
+fn g(p : ptr<function, VecArray>) {
+}
+
+fn f() {
+ var f_arr_v : VecArray = s.v;
+ g(&f_arr_v);
+
+ arr_v = s.v;
+ arr_m[0] = s.m[0];
+ arr_n[1][2] = s.n[1][2];
+}
+)";
+
+ auto* expect =
+ R"(
+enable chromium_internal_relaxed_uniform_layout;
+
+struct tint_packed_vec3_f32_array_element {
+ @align(16)
+ elements : __packed_vec3<f32>,
+}
+
+struct S_tint_packed_vec3 {
+ @align(16)
+ v : array<tint_packed_vec3_f32_array_element, 9u>,
+ @align(16)
+ m : array<array<tint_packed_vec3_f32_array_element, 3u>, 9u>,
+ @align(16)
+ n : array<array<tint_packed_vec3_f32_array_element, 9u>, 9u>,
+}
+
+fn tint_unpack_vec3_in_composite(in : array<tint_packed_vec3_f32_array_element, 9u>) -> array<vec3<f32>, 9u> {
+ var result : array<vec3<f32>, 9u>;
+ for(var i : u32; (i < 9u); i = (i + 1)) {
+ result[i] = vec3<f32>(in[i].elements);
+ }
+ return result;
+}
+
+alias VecArray = array<vec3<f32>, 9>;
+
+alias MatArray = array<mat3x3<f32>, 9>;
+
+alias NestedArray = array<VecArray, 9>;
+
+struct S {
+ v : VecArray,
+ m : MatArray,
+ n : NestedArray,
+}
+
+@group(0) @binding(0) var<storage, read_write> s : S_tint_packed_vec3;
+
+@group(0) @binding(1) var<storage, read_write> arr_v : array<tint_packed_vec3_f32_array_element, 9u>;
+
+@group(0) @binding(2) var<storage, read_write> arr_m : array<array<tint_packed_vec3_f32_array_element, 3u>, 9u>;
+
+@group(0) @binding(3) var<storage, read_write> arr_n : array<array<tint_packed_vec3_f32_array_element, 9u>, 9u>;
+
+fn g(p : ptr<function, VecArray>) {
+}
+
+fn f() {
+ var f_arr_v : VecArray = tint_unpack_vec3_in_composite(s.v);
+ g(&(f_arr_v));
+ arr_v = s.v;
+ arr_m[0] = s.m[0];
+ arr_n[1][2].elements = s.n[1][2].elements;
+}
+)";
+
+ ast::transform::DataMap data;
+ auto got = Run<PackedVec3>(src, data);
+
+ EXPECT_EQ(expect, str(got));
+}
+
TEST_F(PackedVec3Test, Vec3Bool) {
// Make sure that we don't rewrite vec3<bool> types, as the `packed_bool<n>` types are reserved
// in MSL and might not be supported everywhere.
diff --git a/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.msl b/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.msl
index a545fd1..46bcf9d 100644
--- a/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.msl
+++ b/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.msl
@@ -55,38 +55,22 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
float3x3 tint_unpack_vec3_in_composite_1(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
float4x3 tint_unpack_vec3_in_composite_2(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
tint_array<float3, 2> tint_unpack_vec3_in_composite_3(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- tint_array<float3, 2> result = {};
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ tint_array<float3, 2> result = tint_array<float3, 2>{float3(in[0].elements), float3(in[1].elements)};
return result;
}
diff --git a/test/tint/buffer/storage/dynamic_index/read_f16.wgsl.expected.msl b/test/tint/buffer/storage/dynamic_index/read_f16.wgsl.expected.msl
index 61b1043..24fd000 100644
--- a/test/tint/buffer/storage/dynamic_index/read_f16.wgsl.expected.msl
+++ b/test/tint/buffer/storage/dynamic_index/read_f16.wgsl.expected.msl
@@ -78,65 +78,37 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
float3x3 tint_unpack_vec3_in_composite_1(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
float4x3 tint_unpack_vec3_in_composite_2(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
half2x3 tint_unpack_vec3_in_composite_3(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
half3x3 tint_unpack_vec3_in_composite_4(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
half4x3 tint_unpack_vec3_in_composite_5(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
tint_array<float3, 2> tint_unpack_vec3_in_composite_6(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- tint_array<float3, 2> result = {};
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ tint_array<float3, 2> result = tint_array<float3, 2>{float3(in[0].elements), float3(in[1].elements)};
return result;
}
diff --git a/test/tint/buffer/storage/static_index/read.wgsl.expected.msl b/test/tint/buffer/storage/static_index/read.wgsl.expected.msl
index 15c7f94..86b6182 100644
--- a/test/tint/buffer/storage/static_index/read.wgsl.expected.msl
+++ b/test/tint/buffer/storage/static_index/read.wgsl.expected.msl
@@ -59,38 +59,22 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
float3x3 tint_unpack_vec3_in_composite_1(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
float4x3 tint_unpack_vec3_in_composite_2(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
tint_array<float3, 2> tint_unpack_vec3_in_composite_3(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- tint_array<float3, 2> result = {};
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ tint_array<float3, 2> result = tint_array<float3, 2>{float3(in[0].elements), float3(in[1].elements)};
return result;
}
diff --git a/test/tint/buffer/storage/static_index/read_f16.wgsl.expected.msl b/test/tint/buffer/storage/static_index/read_f16.wgsl.expected.msl
index bbca88a..25223fa 100644
--- a/test/tint/buffer/storage/static_index/read_f16.wgsl.expected.msl
+++ b/test/tint/buffer/storage/static_index/read_f16.wgsl.expected.msl
@@ -84,65 +84,37 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
float3x3 tint_unpack_vec3_in_composite_1(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
float4x3 tint_unpack_vec3_in_composite_2(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
half2x3 tint_unpack_vec3_in_composite_3(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
half3x3 tint_unpack_vec3_in_composite_4(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
half4x3 tint_unpack_vec3_in_composite_5(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
tint_array<float3, 2> tint_unpack_vec3_in_composite_6(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- tint_array<float3, 2> result = {};
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ tint_array<float3, 2> result = tint_array<float3, 2>{float3(in[0].elements), float3(in[1].elements)};
return result;
}
diff --git a/test/tint/buffer/storage/types/mat2x3_f16.wgsl.expected.msl b/test/tint/buffer/storage/types/mat2x3_f16.wgsl.expected.msl
index d42c35e..ed270d1 100644
--- a/test/tint/buffer/storage/types/mat2x3_f16.wgsl.expected.msl
+++ b/test/tint/buffer/storage/types/mat2x3_f16.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/storage/types/mat2x3_f32.wgsl.expected.msl b/test/tint/buffer/storage/types/mat2x3_f32.wgsl.expected.msl
index 326df90..19d1dd0 100644
--- a/test/tint/buffer/storage/types/mat2x3_f32.wgsl.expected.msl
+++ b/test/tint/buffer/storage/types/mat2x3_f32.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/storage/types/mat3x3_f16.wgsl.expected.msl b/test/tint/buffer/storage/types/mat3x3_f16.wgsl.expected.msl
index e5901a6..60139a7 100644
--- a/test/tint/buffer/storage/types/mat3x3_f16.wgsl.expected.msl
+++ b/test/tint/buffer/storage/types/mat3x3_f16.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/storage/types/mat3x3_f32.wgsl.expected.msl b/test/tint/buffer/storage/types/mat3x3_f32.wgsl.expected.msl
index bb4912a..ce10963 100644
--- a/test/tint/buffer/storage/types/mat3x3_f32.wgsl.expected.msl
+++ b/test/tint/buffer/storage/types/mat3x3_f32.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/storage/types/mat4x3_f16.wgsl.expected.msl b/test/tint/buffer/storage/types/mat4x3_f16.wgsl.expected.msl
index 602e00c..1c18a7a 100644
--- a/test/tint/buffer/storage/types/mat4x3_f16.wgsl.expected.msl
+++ b/test/tint/buffer/storage/types/mat4x3_f16.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/storage/types/mat4x3_f32.wgsl.expected.msl b/test/tint/buffer/storage/types/mat4x3_f32.wgsl.expected.msl
index 49f2d3d..9603c0d 100644
--- a/test/tint/buffer/storage/types/mat4x3_f32.wgsl.expected.msl
+++ b/test/tint/buffer/storage/types/mat4x3_f32.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.msl b/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.msl
index a10666c..b820506 100644
--- a/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.msl
@@ -55,38 +55,22 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
float3x3 tint_unpack_vec3_in_composite_1(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
float4x3 tint_unpack_vec3_in_composite_2(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
tint_array<float3, 2> tint_unpack_vec3_in_composite_3(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- tint_array<float3, 2> result = {};
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ tint_array<float3, 2> result = tint_array<float3, 2>{float3(in[0].elements), float3(in[1].elements)};
return result;
}
diff --git a/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.msl b/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.msl
index 3a0ba94..2d124a8 100644
--- a/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.msl
@@ -78,65 +78,37 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
float3x3 tint_unpack_vec3_in_composite_1(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
float4x3 tint_unpack_vec3_in_composite_2(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
half2x3 tint_unpack_vec3_in_composite_3(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
half3x3 tint_unpack_vec3_in_composite_4(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
half4x3 tint_unpack_vec3_in_composite_5(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
tint_array<float3, 2> tint_unpack_vec3_in_composite_6(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- tint_array<float3, 2> result = {};
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ tint_array<float3, 2> result = tint_array<float3, 2>{float3(in[0].elements), float3(in[1].elements)};
return result;
}
diff --git a/test/tint/buffer/uniform/static_index/read.wgsl.expected.msl b/test/tint/buffer/uniform/static_index/read.wgsl.expected.msl
index 37f1ec2..af6bdf1 100644
--- a/test/tint/buffer/uniform/static_index/read.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/static_index/read.wgsl.expected.msl
@@ -60,38 +60,22 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
float3x3 tint_unpack_vec3_in_composite_1(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
float4x3 tint_unpack_vec3_in_composite_2(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
tint_array<float3, 2> tint_unpack_vec3_in_composite_3(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- tint_array<float3, 2> result = {};
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ tint_array<float3, 2> result = tint_array<float3, 2>{float3(in[0].elements), float3(in[1].elements)};
return result;
}
diff --git a/test/tint/buffer/uniform/static_index/read_f16.wgsl.expected.msl b/test/tint/buffer/uniform/static_index/read_f16.wgsl.expected.msl
index 71a600e..ccc2f32 100644
--- a/test/tint/buffer/uniform/static_index/read_f16.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/static_index/read_f16.wgsl.expected.msl
@@ -83,65 +83,37 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
float3x3 tint_unpack_vec3_in_composite_1(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
float4x3 tint_unpack_vec3_in_composite_2(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
half2x3 tint_unpack_vec3_in_composite_3(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
half3x3 tint_unpack_vec3_in_composite_4(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
half4x3 tint_unpack_vec3_in_composite_5(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
tint_array<float3, 2> tint_unpack_vec3_in_composite_6(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- tint_array<float3, 2> result = {};
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ tint_array<float3, 2> result = tint_array<float3, 2>{float3(in[0].elements), float3(in[1].elements)};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
index e72842a..9d29cc2 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
@@ -24,20 +24,12 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
tint_array<half2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4> in) {
- tint_array<half2x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<half2x3, 4> result = tint_array<half2x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/static_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f16/static_index_via_ptr.wgsl.expected.msl
index 7091008..24d1d7f 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/static_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/static_index_via_ptr.wgsl.expected.msl
@@ -20,20 +20,12 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
tint_array<half2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4> in) {
- tint_array<half2x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<half2x3, 4> result = tint_array<half2x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_builtin.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_builtin.wgsl.expected.msl
index 618594e..b7329bb 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_builtin.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_builtin.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_fn.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_fn.wgsl.expected.msl
index 38d2710..5a52afa 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_fn.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_fn.wgsl.expected.msl
@@ -20,20 +20,12 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
tint_array<half2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4> in) {
- tint_array<half2x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<half2x3, 4> result = tint_array<half2x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_private.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_private.wgsl.expected.msl
index 27f9954..a0e7753 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_private.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_private.wgsl.expected.msl
@@ -24,20 +24,12 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
tint_array<half2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4> in) {
- tint_array<half2x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<half2x3, 4> result = tint_array<half2x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_storage.wgsl.expected.msl
index 1a97187..87a9625 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_storage.wgsl.expected.msl
@@ -20,20 +20,12 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
tint_array<half2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4> in) {
- tint_array<half2x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<half2x3, 4> result = tint_array<half2x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_workgroup.wgsl.expected.msl
index ca335d1..3543956 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_workgroup.wgsl.expected.msl
@@ -24,20 +24,12 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
tint_array<half2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 2>, 4> in) {
- tint_array<half2x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<half2x3, 4> result = tint_array<half2x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
index e9efa8d..93df986 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
@@ -24,20 +24,12 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
tint_array<float2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4> in) {
- tint_array<float2x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float2x3, 4> result = tint_array<float2x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/static_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/static_index_via_ptr.wgsl.expected.msl
index f021b61..10051bb 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/static_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/static_index_via_ptr.wgsl.expected.msl
@@ -20,20 +20,12 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
tint_array<float2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4> in) {
- tint_array<float2x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float2x3, 4> result = tint_array<float2x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_builtin.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_builtin.wgsl.expected.msl
index 54ed768..e001b45 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_builtin.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_builtin.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_fn.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_fn.wgsl.expected.msl
index 8a252f0..b9f17aa 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_fn.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_fn.wgsl.expected.msl
@@ -20,20 +20,12 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
tint_array<float2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4> in) {
- tint_array<float2x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float2x3, 4> result = tint_array<float2x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_private.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_private.wgsl.expected.msl
index 6c5e9a5..4f12c29 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_private.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_private.wgsl.expected.msl
@@ -24,20 +24,12 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
tint_array<float2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4> in) {
- tint_array<float2x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float2x3, 4> result = tint_array<float2x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.msl
index 1e1c612..9bfa849 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.msl
@@ -20,20 +20,12 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
tint_array<float2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4> in) {
- tint_array<float2x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float2x3, 4> result = tint_array<float2x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.msl
index 87008b8..0b49f03 100644
--- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.msl
@@ -24,20 +24,12 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
tint_array<float2x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 2>, 4> in) {
- tint_array<float2x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float2x3, 4> result = tint_array<float2x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
index 1c3ace3..912d2ba 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
@@ -24,20 +24,12 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
tint_array<float3x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4> in) {
- tint_array<float3x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float3x3, 4> result = tint_array<float3x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/static_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/static_index_via_ptr.wgsl.expected.msl
index 7fbd2bd..a96e906 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/static_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/static_index_via_ptr.wgsl.expected.msl
@@ -20,20 +20,12 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
tint_array<float3x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4> in) {
- tint_array<float3x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float3x3, 4> result = tint_array<float3x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_builtin.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_builtin.wgsl.expected.msl
index fecc53b..84b8b31 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_builtin.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_builtin.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_fn.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_fn.wgsl.expected.msl
index 298ba81..d39d0e3 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_fn.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_fn.wgsl.expected.msl
@@ -20,20 +20,12 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
tint_array<float3x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4> in) {
- tint_array<float3x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float3x3, 4> result = tint_array<float3x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_private.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_private.wgsl.expected.msl
index 1a790e9..3d98745 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_private.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_private.wgsl.expected.msl
@@ -24,20 +24,12 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
tint_array<float3x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4> in) {
- tint_array<float3x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float3x3, 4> result = tint_array<float3x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.msl
index 86fd953..2efe350 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.msl
@@ -20,20 +20,12 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
tint_array<float3x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4> in) {
- tint_array<float3x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float3x3, 4> result = tint_array<float3x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.msl
index a917036..4eae64c 100644
--- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.msl
@@ -24,20 +24,12 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
tint_array<float3x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 3>, 4> in) {
- tint_array<float3x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float3x3, 4> result = tint_array<float3x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
index f752820..4fb4eb95 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
@@ -24,20 +24,12 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
tint_array<half4x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 4>, 4> in) {
- tint_array<half4x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<half4x3, 4> result = tint_array<half4x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/static_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f16/static_index_via_ptr.wgsl.expected.msl
index 2886aba..606d37f 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/static_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/static_index_via_ptr.wgsl.expected.msl
@@ -20,20 +20,12 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
tint_array<half4x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 4>, 4> in) {
- tint_array<half4x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<half4x3, 4> result = tint_array<half4x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_builtin.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_builtin.wgsl.expected.msl
index c7ba240..1bf4113 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_builtin.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_builtin.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_fn.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_fn.wgsl.expected.msl
index e1d2d3f..5be76c0 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_fn.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_fn.wgsl.expected.msl
@@ -20,20 +20,12 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
tint_array<half4x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 4>, 4> in) {
- tint_array<half4x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<half4x3, 4> result = tint_array<half4x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_private.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_private.wgsl.expected.msl
index 794e840..f232711 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_private.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_private.wgsl.expected.msl
@@ -24,20 +24,12 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
tint_array<half4x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 4>, 4> in) {
- tint_array<half4x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<half4x3, 4> result = tint_array<half4x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_storage.wgsl.expected.msl
index 3d4a519..7ae0b35 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_storage.wgsl.expected.msl
@@ -20,20 +20,12 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
tint_array<half4x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 4>, 4> in) {
- tint_array<half4x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<half4x3, 4> result = tint_array<half4x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_workgroup.wgsl.expected.msl
index 414b146..ade6756 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_workgroup.wgsl.expected.msl
@@ -24,20 +24,12 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
tint_array<half4x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f16_array_element, 4>, 4> in) {
- tint_array<half4x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<half4x3, 4> result = tint_array<half4x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
index 144014b..1283bf3 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
@@ -24,20 +24,12 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
tint_array<float4x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 4>, 4> in) {
- tint_array<float4x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float4x3, 4> result = tint_array<float4x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/static_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/static_index_via_ptr.wgsl.expected.msl
index 911ebae..07cba05 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/static_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/static_index_via_ptr.wgsl.expected.msl
@@ -20,20 +20,12 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
tint_array<float4x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 4>, 4> in) {
- tint_array<float4x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float4x3, 4> result = tint_array<float4x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_builtin.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_builtin.wgsl.expected.msl
index 6848467..371c670 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_builtin.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_builtin.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_fn.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_fn.wgsl.expected.msl
index ab0fbcd..c06c267 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_fn.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_fn.wgsl.expected.msl
@@ -20,20 +20,12 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
tint_array<float4x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 4>, 4> in) {
- tint_array<float4x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float4x3, 4> result = tint_array<float4x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_private.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_private.wgsl.expected.msl
index b6ce0d3..06590b7 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_private.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_private.wgsl.expected.msl
@@ -24,20 +24,12 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
tint_array<float4x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 4>, 4> in) {
- tint_array<float4x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float4x3, 4> result = tint_array<float4x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.msl
index 661ffcb..9b88b8f 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.msl
@@ -20,20 +20,12 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
tint_array<float4x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 4>, 4> in) {
- tint_array<float4x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float4x3, 4> result = tint_array<float4x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.msl
index c420ac2..d06150d 100644
--- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.msl
@@ -24,20 +24,12 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
tint_array<float4x3, 4> tint_unpack_vec3_in_composite_1(tint_array<tint_array<tint_packed_vec3_f32_array_element, 4>, 4> in) {
- tint_array<float4x3, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite(in[i]);
- }
+ tint_array<float4x3, 4> result = tint_array<float4x3, 4>{tint_unpack_vec3_in_composite(in[0]), tint_unpack_vec3_in_composite(in[1]), tint_unpack_vec3_in_composite(in[2]), tint_unpack_vec3_in_composite(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
index b8a19e0..49c0c0b 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
@@ -33,11 +33,7 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
@@ -52,11 +48,7 @@
}
tint_array<Inner, 4> tint_unpack_vec3_in_composite_2(tint_array<Inner_tint_packed_vec3, 4> in) {
- tint_array<Inner, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<Inner, 4> result = tint_array<Inner, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
@@ -71,11 +63,7 @@
}
tint_array<Outer, 4> tint_unpack_vec3_in_composite_4(tint_array<Outer_tint_packed_vec3, 4> in) {
- tint_array<Outer, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_3(in[i]);
- }
+ tint_array<Outer, 4> result = tint_array<Outer, 4>{tint_unpack_vec3_in_composite_3(in[0]), tint_unpack_vec3_in_composite_3(in[1]), tint_unpack_vec3_in_composite_3(in[2]), tint_unpack_vec3_in_composite_3(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/static_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/static_index_via_ptr.wgsl.expected.msl
index f40977b..f1f96bf 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/static_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/static_index_via_ptr.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
@@ -48,11 +44,7 @@
}
tint_array<Inner, 4> tint_unpack_vec3_in_composite_2(tint_array<Inner_tint_packed_vec3, 4> in) {
- tint_array<Inner, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<Inner, 4> result = tint_array<Inner, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
@@ -67,11 +59,7 @@
}
tint_array<Outer, 4> tint_unpack_vec3_in_composite_4(tint_array<Outer_tint_packed_vec3, 4> in) {
- tint_array<Outer, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_3(in[i]);
- }
+ tint_array<Outer, 4> result = tint_array<Outer, 4>{tint_unpack_vec3_in_composite_3(in[0]), tint_unpack_vec3_in_composite_3(in[1]), tint_unpack_vec3_in_composite_3(in[2]), tint_unpack_vec3_in_composite_3(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_builtin.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_builtin.wgsl.expected.msl
index e1c5d9c..bb5ba60 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_builtin.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_builtin.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_fn.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_fn.wgsl.expected.msl
index 1b2e965..4363f27 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_fn.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_fn.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
@@ -52,11 +48,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_private.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_private.wgsl.expected.msl
index 37755f3..c514746 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_private.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_private.wgsl.expected.msl
@@ -39,11 +39,7 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
@@ -56,11 +52,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.msl
index c727e17..f4659e2 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
@@ -52,11 +48,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.msl
index 74f9824..3da4e4d 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.msl
@@ -39,11 +39,7 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
@@ -56,11 +52,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
index d4b482b..7d84c9c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
@@ -33,11 +33,7 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
@@ -52,11 +48,7 @@
}
tint_array<Inner, 4> tint_unpack_vec3_in_composite_2(tint_array<Inner_tint_packed_vec3, 4> in) {
- tint_array<Inner, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<Inner, 4> result = tint_array<Inner, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
@@ -71,11 +63,7 @@
}
tint_array<Outer, 4> tint_unpack_vec3_in_composite_4(tint_array<Outer_tint_packed_vec3, 4> in) {
- tint_array<Outer, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_3(in[i]);
- }
+ tint_array<Outer, 4> result = tint_array<Outer, 4>{tint_unpack_vec3_in_composite_3(in[0]), tint_unpack_vec3_in_composite_3(in[1]), tint_unpack_vec3_in_composite_3(in[2]), tint_unpack_vec3_in_composite_3(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.msl
index 55314d1..7693255 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
@@ -48,11 +44,7 @@
}
tint_array<Inner, 4> tint_unpack_vec3_in_composite_2(tint_array<Inner_tint_packed_vec3, 4> in) {
- tint_array<Inner, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<Inner, 4> result = tint_array<Inner, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
@@ -67,11 +59,7 @@
}
tint_array<Outer, 4> tint_unpack_vec3_in_composite_4(tint_array<Outer_tint_packed_vec3, 4> in) {
- tint_array<Outer, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_3(in[i]);
- }
+ tint_array<Outer, 4> result = tint_array<Outer, 4>{tint_unpack_vec3_in_composite_3(in[0]), tint_unpack_vec3_in_composite_3(in[1]), tint_unpack_vec3_in_composite_3(in[2]), tint_unpack_vec3_in_composite_3(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_builtin.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_builtin.wgsl.expected.msl
index a68f229..9cdb01e 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_builtin.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_builtin.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.msl
index 3907fba..451cfbb 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
@@ -52,11 +48,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.msl
index 089f859..e3ecfad 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.msl
@@ -39,11 +39,7 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
@@ -56,11 +52,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.msl
index 3fe251b..73a8802 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
@@ -52,11 +48,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.msl
index 447ce74..bf35778 100644
--- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.msl
@@ -39,11 +39,7 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
@@ -56,11 +52,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
index 34e7e96..56d6624 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
@@ -33,11 +33,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
@@ -52,11 +48,7 @@
}
tint_array<Inner, 4> tint_unpack_vec3_in_composite_2(tint_array<Inner_tint_packed_vec3, 4> in) {
- tint_array<Inner, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<Inner, 4> result = tint_array<Inner, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
@@ -71,11 +63,7 @@
}
tint_array<Outer, 4> tint_unpack_vec3_in_composite_4(tint_array<Outer_tint_packed_vec3, 4> in) {
- tint_array<Outer, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_3(in[i]);
- }
+ tint_array<Outer, 4> result = tint_array<Outer, 4>{tint_unpack_vec3_in_composite_3(in[0]), tint_unpack_vec3_in_composite_3(in[1]), tint_unpack_vec3_in_composite_3(in[2]), tint_unpack_vec3_in_composite_3(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/static_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/static_index_via_ptr.wgsl.expected.msl
index 1e7ec6a..8ca581a 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/static_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/static_index_via_ptr.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
@@ -48,11 +44,7 @@
}
tint_array<Inner, 4> tint_unpack_vec3_in_composite_2(tint_array<Inner_tint_packed_vec3, 4> in) {
- tint_array<Inner, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<Inner, 4> result = tint_array<Inner, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
@@ -67,11 +59,7 @@
}
tint_array<Outer, 4> tint_unpack_vec3_in_composite_4(tint_array<Outer_tint_packed_vec3, 4> in) {
- tint_array<Outer, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_3(in[i]);
- }
+ tint_array<Outer, 4> result = tint_array<Outer, 4>{tint_unpack_vec3_in_composite_3(in[0]), tint_unpack_vec3_in_composite_3(in[1]), tint_unpack_vec3_in_composite_3(in[2]), tint_unpack_vec3_in_composite_3(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_builtin.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_builtin.wgsl.expected.msl
index d245d11..ad54e42 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_builtin.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_builtin.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_fn.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_fn.wgsl.expected.msl
index f16b13b..4049a0d 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_fn.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_fn.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
@@ -52,11 +48,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_private.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_private.wgsl.expected.msl
index dcc3d06..fc14101 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_private.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_private.wgsl.expected.msl
@@ -39,11 +39,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
@@ -56,11 +52,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.msl
index 43ba4a6..e40b77b 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
@@ -52,11 +48,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.msl
index 92099fe..4a381a8 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.msl
@@ -39,11 +39,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
@@ -56,11 +52,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
index bce9b6d..b7721ec 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
@@ -33,11 +33,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
@@ -52,11 +48,7 @@
}
tint_array<Inner, 4> tint_unpack_vec3_in_composite_2(tint_array<Inner_tint_packed_vec3, 4> in) {
- tint_array<Inner, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<Inner, 4> result = tint_array<Inner, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
@@ -71,11 +63,7 @@
}
tint_array<Outer, 4> tint_unpack_vec3_in_composite_4(tint_array<Outer_tint_packed_vec3, 4> in) {
- tint_array<Outer, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_3(in[i]);
- }
+ tint_array<Outer, 4> result = tint_array<Outer, 4>{tint_unpack_vec3_in_composite_3(in[0]), tint_unpack_vec3_in_composite_3(in[1]), tint_unpack_vec3_in_composite_3(in[2]), tint_unpack_vec3_in_composite_3(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.msl
index e991c88..d7e7368 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
@@ -48,11 +44,7 @@
}
tint_array<Inner, 4> tint_unpack_vec3_in_composite_2(tint_array<Inner_tint_packed_vec3, 4> in) {
- tint_array<Inner, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<Inner, 4> result = tint_array<Inner, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
@@ -67,11 +59,7 @@
}
tint_array<Outer, 4> tint_unpack_vec3_in_composite_4(tint_array<Outer_tint_packed_vec3, 4> in) {
- tint_array<Outer, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_3(in[i]);
- }
+ tint_array<Outer, 4> result = tint_array<Outer, 4>{tint_unpack_vec3_in_composite_3(in[0]), tint_unpack_vec3_in_composite_3(in[1]), tint_unpack_vec3_in_composite_3(in[2]), tint_unpack_vec3_in_composite_3(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_builtin.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_builtin.wgsl.expected.msl
index 4bb8278..466853c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_builtin.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_builtin.wgsl.expected.msl
@@ -28,11 +28,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.msl
index c0ffebc..54d016e 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.msl
@@ -28,11 +28,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
@@ -51,11 +47,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.msl
index 647d181..46713a8 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.msl
@@ -38,11 +38,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
@@ -55,11 +51,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.msl
index 634ffb0..92efeb1 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.msl
@@ -28,11 +28,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
@@ -51,11 +47,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.msl
index c9f0553..9f4531c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.msl
@@ -38,11 +38,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
@@ -55,11 +51,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
index 20857b0..e3d1ef1 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
@@ -33,11 +33,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
@@ -52,11 +48,7 @@
}
tint_array<Inner, 4> tint_unpack_vec3_in_composite_2(tint_array<Inner_tint_packed_vec3, 4> in) {
- tint_array<Inner, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<Inner, 4> result = tint_array<Inner, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
@@ -71,11 +63,7 @@
}
tint_array<Outer, 4> tint_unpack_vec3_in_composite_4(tint_array<Outer_tint_packed_vec3, 4> in) {
- tint_array<Outer, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_3(in[i]);
- }
+ tint_array<Outer, 4> result = tint_array<Outer, 4>{tint_unpack_vec3_in_composite_3(in[0]), tint_unpack_vec3_in_composite_3(in[1]), tint_unpack_vec3_in_composite_3(in[2]), tint_unpack_vec3_in_composite_3(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/static_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/static_index_via_ptr.wgsl.expected.msl
index c0fcb1e..969f827 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/static_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/static_index_via_ptr.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
@@ -48,11 +44,7 @@
}
tint_array<Inner, 4> tint_unpack_vec3_in_composite_2(tint_array<Inner_tint_packed_vec3, 4> in) {
- tint_array<Inner, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<Inner, 4> result = tint_array<Inner, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
@@ -67,11 +59,7 @@
}
tint_array<Outer, 4> tint_unpack_vec3_in_composite_4(tint_array<Outer_tint_packed_vec3, 4> in) {
- tint_array<Outer, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_3(in[i]);
- }
+ tint_array<Outer, 4> result = tint_array<Outer, 4>{tint_unpack_vec3_in_composite_3(in[0]), tint_unpack_vec3_in_composite_3(in[1]), tint_unpack_vec3_in_composite_3(in[2]), tint_unpack_vec3_in_composite_3(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_builtin.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_builtin.wgsl.expected.msl
index 22b576a..b559ddf 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_builtin.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_builtin.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_fn.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_fn.wgsl.expected.msl
index 83803d9..11b4c1c 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_fn.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_fn.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
@@ -52,11 +48,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_private.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_private.wgsl.expected.msl
index 33ab4b6..0e032b7 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_private.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_private.wgsl.expected.msl
@@ -39,11 +39,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
@@ -56,11 +52,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.msl
index f93db23..2cecf05 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
@@ -52,11 +48,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.msl
index 446962e..ce4b9c8 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.msl
@@ -39,11 +39,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
@@ -56,11 +52,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
index 0a1a62d..c37d597 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
@@ -32,11 +32,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
@@ -51,11 +47,7 @@
}
tint_array<Inner, 4> tint_unpack_vec3_in_composite_2(tint_array<Inner_tint_packed_vec3, 4> in) {
- tint_array<Inner, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<Inner, 4> result = tint_array<Inner, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
@@ -70,11 +62,7 @@
}
tint_array<Outer, 4> tint_unpack_vec3_in_composite_4(tint_array<Outer_tint_packed_vec3, 4> in) {
- tint_array<Outer, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_3(in[i]);
- }
+ tint_array<Outer, 4> result = tint_array<Outer, 4>{tint_unpack_vec3_in_composite_3(in[0]), tint_unpack_vec3_in_composite_3(in[1]), tint_unpack_vec3_in_composite_3(in[2]), tint_unpack_vec3_in_composite_3(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.msl
index c75a238..582d74f 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.msl
@@ -28,11 +28,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
@@ -47,11 +43,7 @@
}
tint_array<Inner, 4> tint_unpack_vec3_in_composite_2(tint_array<Inner_tint_packed_vec3, 4> in) {
- tint_array<Inner, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<Inner, 4> result = tint_array<Inner, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
@@ -66,11 +58,7 @@
}
tint_array<Outer, 4> tint_unpack_vec3_in_composite_4(tint_array<Outer_tint_packed_vec3, 4> in) {
- tint_array<Outer, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_3(in[i]);
- }
+ tint_array<Outer, 4> result = tint_array<Outer, 4>{tint_unpack_vec3_in_composite_3(in[0]), tint_unpack_vec3_in_composite_3(in[1]), tint_unpack_vec3_in_composite_3(in[2]), tint_unpack_vec3_in_composite_3(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_builtin.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_builtin.wgsl.expected.msl
index 7223575..6f4c01e 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_builtin.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_builtin.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.msl
index 8da0a09..9ed325b 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
@@ -52,11 +48,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.msl
index 17a7d1a..cd2cfc8 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.msl
@@ -39,11 +39,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
@@ -56,11 +52,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.msl
index 4f9187a..d59b971 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.msl
@@ -29,11 +29,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
@@ -52,11 +48,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.msl
index d719c22..60449fe 100644
--- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.msl
@@ -39,11 +39,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
@@ -56,11 +52,7 @@
}
tint_array<S, 4> tint_unpack_vec3_in_composite_2(tint_array<S_tint_packed_vec3, 4> in) {
- tint_array<S, 4> result = {};
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = tint_unpack_vec3_in_composite_1(in[i]);
- }
+ tint_array<S, 4> result = tint_array<S, 4>{tint_unpack_vec3_in_composite_1(in[0]), tint_unpack_vec3_in_composite_1(in[1]), tint_unpack_vec3_in_composite_1(in[2]), tint_unpack_vec3_in_composite_1(in[3])};
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
index 66b9eae..614fb69 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/static_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/static_index_via_ptr.wgsl.expected.msl
index 351639f..b0504e1 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/static_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/static_index_via_ptr.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_builtin.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_builtin.wgsl.expected.msl
index 6e97983..c3cc7d6 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_builtin.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_builtin.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_fn.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_fn.wgsl.expected.msl
index 4eeec0f..af5616e 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_fn.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_fn.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_private.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_private.wgsl.expected.msl
index fcce5d9..9d9263e 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_private.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_private.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_storage.wgsl.expected.msl
index ffce46c..aa190ac 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_storage.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_workgroup.wgsl.expected.msl
index a1204b8..3896f5c 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_workgroup.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
index 9dd941f..c8fc6a9 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/static_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/static_index_via_ptr.wgsl.expected.msl
index 209a0d9..e1035fc 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/static_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/static_index_via_ptr.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_builtin.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_builtin.wgsl.expected.msl
index b5246cb..91890fa 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_builtin.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_builtin.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_fn.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_fn.wgsl.expected.msl
index 4fa9980..2934433 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_fn.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_fn.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_private.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_private.wgsl.expected.msl
index 9a67d9e..8b46ffe 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_private.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_private.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_storage.wgsl.expected.msl
index d1733cd..0e4b6d6 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_storage.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_workgroup.wgsl.expected.msl
index 5504f34..4c5fb8a 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_workgroup.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
index 818c5ed..c6a61a1 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/static_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/static_index_via_ptr.wgsl.expected.msl
index 36cfd6c..6749f5b 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/static_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/static_index_via_ptr.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_builtin.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_builtin.wgsl.expected.msl
index 284120d..df5baaf 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_builtin.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_builtin.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_fn.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_fn.wgsl.expected.msl
index 5183cdf..bc9cd0c 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_fn.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_fn.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_private.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_private.wgsl.expected.msl
index df4f251..28eef79 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_private.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_private.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_storage.wgsl.expected.msl
index c79089d..6e5f5c5 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_storage.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_workgroup.wgsl.expected.msl
index 41a611d..ffb2433 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_workgroup.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
index 0d94d71..7f0fce8 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/static_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/static_index_via_ptr.wgsl.expected.msl
index 50dc2cf..f255b6a 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/static_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/static_index_via_ptr.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_builtin.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_builtin.wgsl.expected.msl
index 6879754..6620e4b 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_builtin.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_builtin.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_fn.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_fn.wgsl.expected.msl
index 7200e84..acf2443 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_fn.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_fn.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_private.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_private.wgsl.expected.msl
index 2fb02e7..e9b358b 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_private.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_private.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_storage.wgsl.expected.msl
index 65a9461..82de96a 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_storage.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_workgroup.wgsl.expected.msl
index a84c6f9..bacf221 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_workgroup.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
index 2c20f74..aac94fc 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/static_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/static_index_via_ptr.wgsl.expected.msl
index bc5f7d7..a7889e1 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/static_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/static_index_via_ptr.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_builtin.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_builtin.wgsl.expected.msl
index 1661c25..7bf47d6 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_builtin.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_builtin.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_fn.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_fn.wgsl.expected.msl
index d3588d7..08c5c98 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_fn.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_fn.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_private.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_private.wgsl.expected.msl
index c3a8656..5505009 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_private.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_private.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_storage.wgsl.expected.msl
index 5b76f29..f3c53e1 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_storage.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_workgroup.wgsl.expected.msl
index 45134fd..beafa48 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_workgroup.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
index 26cdbea..5a4be96 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/static_index_via_ptr.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/static_index_via_ptr.wgsl.expected.msl
index 016dc82..d68a63a 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/static_index_via_ptr.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/static_index_via_ptr.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_builtin.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_builtin.wgsl.expected.msl
index e42d9f8..02f8479 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_builtin.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_builtin.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_fn.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_fn.wgsl.expected.msl
index f9fd46e..fa8c280 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_fn.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_fn.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_private.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_private.wgsl.expected.msl
index f0cf1ae..2ce70e6 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_private.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_private.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_storage.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_storage.wgsl.expected.msl
index 39e493a..5cc90fc 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_storage.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_storage.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_workgroup.wgsl.expected.msl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_workgroup.wgsl.expected.msl
index ebc4026..52f0aa4 100644
--- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_workgroup.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_workgroup.wgsl.expected.msl
@@ -24,11 +24,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/types/mat2x3_f16.wgsl.expected.msl b/test/tint/buffer/uniform/types/mat2x3_f16.wgsl.expected.msl
index 66ab882..8a2aa3e 100644
--- a/test/tint/buffer/uniform/types/mat2x3_f16.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/types/mat2x3_f16.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
half2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 2> in) {
- half2x3 result = half2x3(0.0h);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half2x3 result = half2x3(half3(in[0].elements), half3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/types/mat2x3_f32.wgsl.expected.msl b/test/tint/buffer/uniform/types/mat2x3_f32.wgsl.expected.msl
index fcb9344..8d21773 100644
--- a/test/tint/buffer/uniform/types/mat2x3_f32.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/types/mat2x3_f32.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float2x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 2> in) {
- float2x3 result = float2x3(0.0f);
- for(uint i = 0u; (i < 2u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float2x3 result = float2x3(float3(in[0].elements), float3(in[1].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/types/mat3x3_f16.wgsl.expected.msl b/test/tint/buffer/uniform/types/mat3x3_f16.wgsl.expected.msl
index 93b4fe7..5bc55cf 100644
--- a/test/tint/buffer/uniform/types/mat3x3_f16.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/types/mat3x3_f16.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/types/mat3x3_f32.wgsl.expected.msl b/test/tint/buffer/uniform/types/mat3x3_f32.wgsl.expected.msl
index cf4c6b4..eb90208 100644
--- a/test/tint/buffer/uniform/types/mat3x3_f32.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/types/mat3x3_f32.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/types/mat4x3_f16.wgsl.expected.msl b/test/tint/buffer/uniform/types/mat4x3_f16.wgsl.expected.msl
index 7dbe667..365a5f5 100644
--- a/test/tint/buffer/uniform/types/mat4x3_f16.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/types/mat4x3_f16.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
diff --git a/test/tint/buffer/uniform/types/mat4x3_f32.wgsl.expected.msl b/test/tint/buffer/uniform/types/mat4x3_f32.wgsl.expected.msl
index 57bc4c6..1e684c8 100644
--- a/test/tint/buffer/uniform/types/mat4x3_f32.wgsl.expected.msl
+++ b/test/tint/buffer/uniform/types/mat4x3_f32.wgsl.expected.msl
@@ -20,11 +20,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}
diff --git a/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.msl b/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.msl
index 817bc40..cccb53c 100644
--- a/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.msl
+++ b/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.msl
@@ -33,11 +33,7 @@
};
tint_array<float3, 8> tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 8> in) {
- tint_array<float3, 8> result = {};
- for(uint i = 0u; (i < 8u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ tint_array<float3, 8> result = tint_array<float3, 8>{float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements), float3(in[4].elements), float3(in[5].elements), float3(in[6].elements), float3(in[7].elements)};
return result;
}
diff --git a/test/tint/bug/tint/1739.wgsl.expected.msl b/test/tint/bug/tint/1739.wgsl.expected.msl
index f034375..1686ea6 100644
--- a/test/tint/bug/tint/1739.wgsl.expected.msl
+++ b/test/tint/bug/tint/1739.wgsl.expected.msl
@@ -43,11 +43,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.msl
index 7f0579a..ab5d050 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.msl
@@ -43,11 +43,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.msl
index 16deb0c..d04ab9a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.msl
@@ -43,11 +43,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
index e7f661f..a8de650 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
@@ -43,11 +43,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.msl
index 1682906..fb92208 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.msl
@@ -43,11 +43,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.msl
index 5652b46..9db3f37 100644
--- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.msl
@@ -43,11 +43,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
index 6700304..4d8cc8c 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
@@ -43,11 +43,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.msl b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.msl
index 2f324bc..f9a790b 100644
--- a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.msl
+++ b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.msl
@@ -43,11 +43,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/expressions/binary/mul/mat3x3-vec3/f16.wgsl.expected.msl b/test/tint/expressions/binary/mul/mat3x3-vec3/f16.wgsl.expected.msl
index 36c59c8..4fd29e3 100644
--- a/test/tint/expressions/binary/mul/mat3x3-vec3/f16.wgsl.expected.msl
+++ b/test/tint/expressions/binary/mul/mat3x3-vec3/f16.wgsl.expected.msl
@@ -26,11 +26,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
diff --git a/test/tint/expressions/binary/mul/mat3x3-vec3/f32.wgsl.expected.msl b/test/tint/expressions/binary/mul/mat3x3-vec3/f32.wgsl.expected.msl
index 0afb867..eb4efd6 100644
--- a/test/tint/expressions/binary/mul/mat3x3-vec3/f32.wgsl.expected.msl
+++ b/test/tint/expressions/binary/mul/mat3x3-vec3/f32.wgsl.expected.msl
@@ -26,11 +26,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/expressions/binary/mul/vec3-mat3x3/f16.wgsl.expected.msl b/test/tint/expressions/binary/mul/vec3-mat3x3/f16.wgsl.expected.msl
index 013c086..52833e2 100644
--- a/test/tint/expressions/binary/mul/vec3-mat3x3/f16.wgsl.expected.msl
+++ b/test/tint/expressions/binary/mul/vec3-mat3x3/f16.wgsl.expected.msl
@@ -26,11 +26,7 @@
};
half3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 3> in) {
- half3x3 result = half3x3(0.0h);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half3x3 result = half3x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements));
return result;
}
diff --git a/test/tint/expressions/binary/mul/vec3-mat3x3/f32.wgsl.expected.msl b/test/tint/expressions/binary/mul/vec3-mat3x3/f32.wgsl.expected.msl
index 91e5eee..8b5df7c 100644
--- a/test/tint/expressions/binary/mul/vec3-mat3x3/f32.wgsl.expected.msl
+++ b/test/tint/expressions/binary/mul/vec3-mat3x3/f32.wgsl.expected.msl
@@ -26,11 +26,7 @@
};
float3x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 3> in) {
- float3x3 result = float3x3(0.0f);
- for(uint i = 0u; (i < 3u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float3x3 result = float3x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements));
return result;
}
diff --git a/test/tint/expressions/binary/mul/vec3-mat4x3/f16.wgsl.expected.msl b/test/tint/expressions/binary/mul/vec3-mat4x3/f16.wgsl.expected.msl
index 5e12349..555d31a 100644
--- a/test/tint/expressions/binary/mul/vec3-mat4x3/f16.wgsl.expected.msl
+++ b/test/tint/expressions/binary/mul/vec3-mat4x3/f16.wgsl.expected.msl
@@ -26,11 +26,7 @@
};
half4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f16_array_element, 4> in) {
- half4x3 result = half4x3(0.0h);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = half3(in[i].elements);
- }
+ half4x3 result = half4x3(half3(in[0].elements), half3(in[1].elements), half3(in[2].elements), half3(in[3].elements));
return result;
}
diff --git a/test/tint/expressions/binary/mul/vec3-mat4x3/f32.wgsl.expected.msl b/test/tint/expressions/binary/mul/vec3-mat4x3/f32.wgsl.expected.msl
index e3ed262..6ed3fd2 100644
--- a/test/tint/expressions/binary/mul/vec3-mat4x3/f32.wgsl.expected.msl
+++ b/test/tint/expressions/binary/mul/vec3-mat4x3/f32.wgsl.expected.msl
@@ -26,11 +26,7 @@
};
float4x3 tint_unpack_vec3_in_composite(tint_array<tint_packed_vec3_f32_array_element, 4> in) {
- float4x3 result = float4x3(0.0f);
- for(uint i = 0u; (i < 4u); i = (i + 1u)) {
- __asm__("");
- result[i] = float3(in[i].elements);
- }
+ float4x3 result = float4x3(float3(in[0].elements), float3(in[1].elements), float3(in[2].elements), float3(in[3].elements));
return result;
}