From b4ff8c859a26e8ac060062198cfaf35d6b8c4520 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Fri, 24 Jun 2022 23:30:59 +0000 Subject: [PATCH] tint/resolver: Simplify array size evaluation Use the constant evaluated value instead of manually traversing variables to find the literal value. This is a small step towards supporting 'const' values for array sizes. Also make our OOB-byte related error diagnostics consistent. Bug: tint:1580 Change-Id: Idf9eb22cdbf69d750218c554e9f826c30458c6b9 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94600 Reviewed-by: David Neto Commit-Queue: Ben Clayton Kokoro: Kokoro --- src/tint/resolver/resolver.cc | 70 +++++++--------- .../type_constructor_validation_test.cc | 3 +- src/tint/resolver/type_validation_test.cc | 83 +++++++++---------- .../explicit/identity/f32.wgsl.expected.glsl | 2 +- .../explicit/identity/f32.wgsl.expected.hlsl | 2 +- .../explicit/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- .../inferred/identity/f32.wgsl.expected.glsl | 2 +- .../inferred/identity/f32.wgsl.expected.hlsl | 2 +- .../inferred/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- .../explicit/identity/f32.wgsl.expected.glsl | 2 +- .../explicit/identity/f32.wgsl.expected.hlsl | 2 +- .../explicit/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- .../inferred/identity/f32.wgsl.expected.glsl | 2 +- .../inferred/identity/f32.wgsl.expected.hlsl | 2 +- .../inferred/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- .../explicit/identity/f32.wgsl.expected.glsl | 2 +- .../explicit/identity/f32.wgsl.expected.hlsl | 2 +- .../explicit/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- .../inferred/identity/f32.wgsl.expected.glsl | 2 +- .../inferred/identity/f32.wgsl.expected.hlsl | 2 +- .../inferred/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- .../explicit/identity/f32.wgsl.expected.glsl | 2 +- .../explicit/identity/f32.wgsl.expected.hlsl | 2 +- .../explicit/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- .../inferred/identity/f32.wgsl.expected.glsl | 2 +- .../inferred/identity/f32.wgsl.expected.hlsl | 2 +- .../inferred/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- .../explicit/identity/f32.wgsl.expected.glsl | 2 +- .../explicit/identity/f32.wgsl.expected.hlsl | 2 +- .../explicit/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- .../inferred/identity/f32.wgsl.expected.glsl | 2 +- .../inferred/identity/f32.wgsl.expected.hlsl | 2 +- .../inferred/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- .../explicit/identity/f32.wgsl.expected.glsl | 2 +- .../explicit/identity/f32.wgsl.expected.hlsl | 2 +- .../explicit/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- .../inferred/identity/f32.wgsl.expected.glsl | 2 +- .../inferred/identity/f32.wgsl.expected.hlsl | 2 +- .../inferred/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- .../explicit/identity/f32.wgsl.expected.glsl | 2 +- .../explicit/identity/f32.wgsl.expected.hlsl | 2 +- .../explicit/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- .../inferred/identity/f32.wgsl.expected.glsl | 2 +- .../inferred/identity/f32.wgsl.expected.hlsl | 2 +- .../inferred/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- .../explicit/identity/f32.wgsl.expected.glsl | 2 +- .../explicit/identity/f32.wgsl.expected.hlsl | 2 +- .../explicit/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- .../inferred/identity/f32.wgsl.expected.glsl | 2 +- .../inferred/identity/f32.wgsl.expected.hlsl | 2 +- .../inferred/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- .../explicit/identity/f32.wgsl.expected.glsl | 2 +- .../explicit/identity/f32.wgsl.expected.hlsl | 2 +- .../explicit/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- .../inferred/identity/f32.wgsl.expected.glsl | 2 +- .../inferred/identity/f32.wgsl.expected.hlsl | 2 +- .../inferred/identity/f32.wgsl.expected.msl | 2 +- .../identity/f32.wgsl.expected.spvasm | 4 +- 75 files changed, 159 insertions(+), 177 deletions(-) diff --git a/src/tint/resolver/resolver.cc b/src/tint/resolver/resolver.cc index e0dc19227e..fc78fb2338 100644 --- a/src/tint/resolver/resolver.cc +++ b/src/tint/resolver/resolver.cc @@ -2148,69 +2148,58 @@ sem::Array* Resolver::Array(const ast::Array* arr) { uint64_t stride = explicit_stride ? explicit_stride : implicit_stride; + int64_t count = 0; // sem::Array uses a size of 0 for a runtime-sized array. + // Evaluate the constant array size expression. - // sem::Array uses a size of 0 for a runtime-sized array. - uint32_t count = 0; if (auto* count_expr = arr->count) { const auto* count_sem = Materialize(Expression(count_expr)); if (!count_sem) { return nullptr; } - auto size_source = count_expr->source; - - auto* ty = count_sem->Type()->UnwrapRef(); - if (!ty->is_integer_scalar()) { - AddError("array size must be integer scalar", size_source); - return nullptr; - } - - constexpr const char* kErrInvalidExpr = - "array size identifier must be a literal or a module-scope 'let'"; - - if (auto* ident = count_expr->As()) { - // Make sure the identifier is a non-overridable module-scope 'let'. - auto* global = sem_.ResolvedSymbol(ident); - if (!global || !global->Declaration()->Is()) { - AddError(kErrInvalidExpr, size_source); - return nullptr; - } - count_expr = global->Declaration()->constructor; - } else if (!count_expr->Is()) { - AddError(kErrInvalidExpr, size_source); + // TODO(crbug.com/tint/1580): Temporary seatbelt to used to ensure that a function-scope + // `let` cannot be used to propagate a constant expression to an array size. Once we + // implement `const`, this can be removed. + if (auto* user = count_sem->UnwrapMaterialize()->As(); + user && user->Variable()->Is() && + user->Variable()->Declaration()->Is()) { + AddError("array size must evaluate to a constant integer expression", + count_expr->source); return nullptr; } auto count_val = count_sem->ConstantValue(); if (!count_val) { - TINT_ICE(Resolver, diagnostics_) << "could not resolve array size expression"; + AddError("array size must evaluate to a constant integer expression", + count_expr->source); return nullptr; } - if (count_val.Element(0).value < 1) { - AddError("array size must be at least 1", size_source); + if (auto* ty = count_val.Type(); !ty->is_integer_scalar()) { + AddError("array size must evaluate to a constant integer expression, but is type '" + + builder_->FriendlyName(ty) + "'", + count_expr->source); return nullptr; } - count = count_val.Element(0); + count = count_val.Element(0).value; + if (count < 1) { + AddError("array size (" + std::to_string(count) + ") must be greater than 0", + count_expr->source); + return nullptr; + } } - auto size = std::max(count, 1) * stride; + auto size = std::max(count, 1u) * stride; if (size > std::numeric_limits::max()) { std::stringstream msg; - msg << "array size in bytes must not exceed 0x" << std::hex - << std::numeric_limits::max() << ", but is 0x" << std::hex << size; + msg << "array size (0x" << std::hex << size << ") must not exceed 0xffffffff bytes"; AddError(msg.str(), arr->source); return nullptr; } - if (stride > std::numeric_limits::max() || - implicit_stride > std::numeric_limits::max()) { - TINT_ICE(Resolver, diagnostics_) << "calculated array stride exceeds uint32"; - return nullptr; - } auto* out = builder_->create( - elem_type, count, el_align, static_cast(size), static_cast(stride), - static_cast(implicit_stride)); + elem_type, static_cast(count), el_align, static_cast(size), + static_cast(stride), static_cast(implicit_stride)); if (!validator_.Array(out, source)) { return nullptr; @@ -2338,8 +2327,8 @@ sem::Struct* Resolver::Structure(const ast::Struct* str) { offset = utils::RoundUp(align, offset); if (offset > std::numeric_limits::max()) { std::stringstream msg; - msg << "struct member has byte offset 0x" << std::hex << offset - << ", but must not exceed 0x" << std::hex << std::numeric_limits::max(); + msg << "struct member offset (0x" << std::hex << offset << ") must not exceed 0x" + << std::hex << std::numeric_limits::max() << " bytes"; AddError(msg.str(), member->source); return nullptr; } @@ -2360,8 +2349,7 @@ sem::Struct* Resolver::Structure(const ast::Struct* str) { if (struct_size > std::numeric_limits::max()) { std::stringstream msg; - msg << "struct size in bytes must not exceed 0x" << std::hex - << std::numeric_limits::max() << ", but is 0x" << std::hex << struct_size; + msg << "struct size (0x" << std::hex << struct_size << ") must not exceed 0xffffffff bytes"; AddError(msg.str(), str->source); return nullptr; } diff --git a/src/tint/resolver/type_constructor_validation_test.cc b/src/tint/resolver/type_constructor_validation_test.cc index 3277ee854d..5d891fce95 100644 --- a/src/tint/resolver/type_constructor_validation_test.cc +++ b/src/tint/resolver/type_constructor_validation_test.cc @@ -581,8 +581,7 @@ TEST_F(ResolverTypeConstructorValidationTest, Expr_Constructor_Array_TooFewEleme EXPECT_FALSE(r()->Resolve()); EXPECT_EQ(r()->error(), - "12:34 error: array constructor has too few elements: expected 4, " - "found 3"); + "12:34 error: array constructor has too few elements: expected 4, found 3"); } TEST_F(ResolverTypeConstructorValidationTest, Expr_Constructor_Array_TooManyElements) { diff --git a/src/tint/resolver/type_validation_test.cc b/src/tint/resolver/type_validation_test.cc index e79026eed1..9f03e05aea 100644 --- a/src/tint/resolver/type_validation_test.cc +++ b/src/tint/resolver/type_validation_test.cc @@ -216,28 +216,28 @@ TEST_F(ResolverTypeValidationTest, ArraySize_AIntLiteral_Zero) { // var a : array; Global("a", ty.array(ty.f32(), Expr(Source{{12, 34}}, 0_a)), ast::StorageClass::kPrivate); EXPECT_FALSE(r()->Resolve()); - EXPECT_EQ(r()->error(), "12:34 error: array size must be at least 1"); + EXPECT_EQ(r()->error(), "12:34 error: array size (0) must be greater than 0"); } TEST_F(ResolverTypeValidationTest, ArraySize_UnsignedLiteral_Zero) { // var a : array; Global("a", ty.array(ty.f32(), Expr(Source{{12, 34}}, 0_u)), ast::StorageClass::kPrivate); EXPECT_FALSE(r()->Resolve()); - EXPECT_EQ(r()->error(), "12:34 error: array size must be at least 1"); + EXPECT_EQ(r()->error(), "12:34 error: array size (0) must be greater than 0"); } TEST_F(ResolverTypeValidationTest, ArraySize_SignedLiteral_Zero) { // var a : array; Global("a", ty.array(ty.f32(), Expr(Source{{12, 34}}, 0_i)), ast::StorageClass::kPrivate); EXPECT_FALSE(r()->Resolve()); - EXPECT_EQ(r()->error(), "12:34 error: array size must be at least 1"); + EXPECT_EQ(r()->error(), "12:34 error: array size (0) must be greater than 0"); } TEST_F(ResolverTypeValidationTest, ArraySize_SignedLiteral_Negative) { // var a : array; Global("a", ty.array(ty.f32(), Expr(Source{{12, 34}}, -10_i)), ast::StorageClass::kPrivate); EXPECT_FALSE(r()->Resolve()); - EXPECT_EQ(r()->error(), "12:34 error: array size must be at least 1"); + EXPECT_EQ(r()->error(), "12:34 error: array size (-10) must be greater than 0"); } TEST_F(ResolverTypeValidationTest, ArraySize_UnsignedLet_Zero) { @@ -246,7 +246,7 @@ TEST_F(ResolverTypeValidationTest, ArraySize_UnsignedLet_Zero) { GlobalConst("size", nullptr, Expr(0_u)); Global("a", ty.array(ty.f32(), Expr(Source{{12, 34}}, "size")), ast::StorageClass::kPrivate); EXPECT_FALSE(r()->Resolve()); - EXPECT_EQ(r()->error(), "12:34 error: array size must be at least 1"); + EXPECT_EQ(r()->error(), "12:34 error: array size (0) must be greater than 0"); } TEST_F(ResolverTypeValidationTest, ArraySize_SignedLet_Zero) { @@ -255,7 +255,7 @@ TEST_F(ResolverTypeValidationTest, ArraySize_SignedLet_Zero) { GlobalConst("size", nullptr, Expr(0_i)); Global("a", ty.array(ty.f32(), Expr(Source{{12, 34}}, "size")), ast::StorageClass::kPrivate); EXPECT_FALSE(r()->Resolve()); - EXPECT_EQ(r()->error(), "12:34 error: array size must be at least 1"); + EXPECT_EQ(r()->error(), "12:34 error: array size (0) must be greater than 0"); } TEST_F(ResolverTypeValidationTest, ArraySize_SignedLet_Negative) { @@ -264,14 +264,16 @@ TEST_F(ResolverTypeValidationTest, ArraySize_SignedLet_Negative) { GlobalConst("size", nullptr, Expr(-10_i)); Global("a", ty.array(ty.f32(), Expr(Source{{12, 34}}, "size")), ast::StorageClass::kPrivate); EXPECT_FALSE(r()->Resolve()); - EXPECT_EQ(r()->error(), "12:34 error: array size must be at least 1"); + EXPECT_EQ(r()->error(), "12:34 error: array size (-10) must be greater than 0"); } TEST_F(ResolverTypeValidationTest, ArraySize_FloatLiteral) { // var a : array; Global("a", ty.array(ty.f32(), Expr(Source{{12, 34}}, 10_f)), ast::StorageClass::kPrivate); EXPECT_FALSE(r()->Resolve()); - EXPECT_EQ(r()->error(), "12:34 error: array size must be integer scalar"); + EXPECT_EQ(r()->error(), + "12:34 error: array size must evaluate to a constant integer expression, but is type " + "'f32'"); } TEST_F(ResolverTypeValidationTest, ArraySize_IVecLiteral) { @@ -279,7 +281,9 @@ TEST_F(ResolverTypeValidationTest, ArraySize_IVecLiteral) { Global("a", ty.array(ty.f32(), Construct(Source{{12, 34}}, ty.vec2(), 10_i, 10_i)), ast::StorageClass::kPrivate); EXPECT_FALSE(r()->Resolve()); - EXPECT_EQ(r()->error(), "12:34 error: array size must be integer scalar"); + EXPECT_EQ(r()->error(), + "12:34 error: array size must evaluate to a constant integer expression, but is type " + "'vec2'"); } TEST_F(ResolverTypeValidationTest, ArraySize_FloatLet) { @@ -288,7 +292,9 @@ TEST_F(ResolverTypeValidationTest, ArraySize_FloatLet) { GlobalConst("size", nullptr, Expr(10_f)); Global("a", ty.array(ty.f32(), Expr(Source{{12, 34}}, "size")), ast::StorageClass::kPrivate); EXPECT_FALSE(r()->Resolve()); - EXPECT_EQ(r()->error(), "12:34 error: array size must be integer scalar"); + EXPECT_EQ(r()->error(), + "12:34 error: array size must evaluate to a constant integer expression, but is type " + "'f32'"); } TEST_F(ResolverTypeValidationTest, ArraySize_IVecLet) { @@ -297,7 +303,9 @@ TEST_F(ResolverTypeValidationTest, ArraySize_IVecLet) { GlobalConst("size", nullptr, Construct(ty.vec2(), 100_i, 100_i)); Global("a", ty.array(ty.f32(), Expr(Source{{12, 34}}, "size")), ast::StorageClass::kPrivate); EXPECT_FALSE(r()->Resolve()); - EXPECT_EQ(r()->error(), "12:34 error: array size must be integer scalar"); + EXPECT_EQ(r()->error(), + "12:34 error: array size must evaluate to a constant integer expression, but is type " + "'vec2'"); } TEST_F(ResolverTypeValidationTest, ArraySize_TooBig_ImplicitStride) { @@ -305,8 +313,7 @@ TEST_F(ResolverTypeValidationTest, ArraySize_TooBig_ImplicitStride) { Global("a", ty.array(Source{{12, 34}}, ty.f32(), 0x40000000_u), ast::StorageClass::kPrivate); EXPECT_FALSE(r()->Resolve()); EXPECT_EQ(r()->error(), - "12:34 error: array size in bytes must not exceed 0xffffffff, but " - "is 0x100000000"); + "12:34 error: array size (0x100000000) must not exceed 0xffffffff bytes"); } TEST_F(ResolverTypeValidationTest, ArraySize_TooBig_ExplicitStride) { @@ -314,8 +321,7 @@ TEST_F(ResolverTypeValidationTest, ArraySize_TooBig_ExplicitStride) { Global("a", ty.array(Source{{12, 34}}, ty.f32(), 0x20000000_u, 8), ast::StorageClass::kPrivate); EXPECT_FALSE(r()->Resolve()); EXPECT_EQ(r()->error(), - "12:34 error: array size in bytes must not exceed 0xffffffff, but " - "is 0x100000000"); + "12:34 error: array size (0x100000000) must not exceed 0xffffffff bytes"); } TEST_F(ResolverTypeValidationTest, ArraySize_Overridable) { @@ -325,7 +331,7 @@ TEST_F(ResolverTypeValidationTest, ArraySize_Overridable) { Global("a", ty.array(ty.f32(), Expr(Source{{12, 34}}, "size")), ast::StorageClass::kPrivate); EXPECT_FALSE(r()->Resolve()); EXPECT_EQ(r()->error(), - "12:34 error: array size identifier must be a literal or a module-scope 'let'"); + "12:34 error: array size must evaluate to a constant integer expression"); } TEST_F(ResolverTypeValidationTest, ArraySize_ModuleVar) { @@ -335,7 +341,7 @@ TEST_F(ResolverTypeValidationTest, ArraySize_ModuleVar) { Global("a", ty.array(ty.f32(), Expr(Source{{12, 34}}, "size")), ast::StorageClass::kPrivate); EXPECT_FALSE(r()->Resolve()); EXPECT_EQ(r()->error(), - "12:34 error: array size identifier must be a literal or a module-scope 'let'"); + "12:34 error: array size must evaluate to a constant integer expression"); } TEST_F(ResolverTypeValidationTest, ArraySize_FunctionLet) { @@ -345,19 +351,17 @@ TEST_F(ResolverTypeValidationTest, ArraySize_FunctionLet) { // } auto* size = Let("size", nullptr, Expr(10_i)); auto* a = Var("a", ty.array(ty.f32(), Expr(Source{{12, 34}}, "size"))); - WrapInFunction(Block(Decl(size), Decl(a))); + WrapInFunction(size, a); EXPECT_FALSE(r()->Resolve()); EXPECT_EQ(r()->error(), - "12:34 error: array size identifier must be a literal or a module-scope 'let'"); + "12:34 error: array size must evaluate to a constant integer expression"); } -TEST_F(ResolverTypeValidationTest, ArraySize_InvalidExpr) { +TEST_F(ResolverTypeValidationTest, ArraySize_ComplexExpr) { // var a : array; auto* a = Var("a", ty.array(ty.f32(), Construct(Source{{12, 34}}, ty.i32(), 4_i))); - WrapInFunction(Block(Decl(a))); - EXPECT_FALSE(r()->Resolve()); - EXPECT_EQ(r()->error(), - "12:34 error: array size identifier must be a literal or a module-scope 'let'"); + WrapInFunction(a); + EXPECT_TRUE(r()->Resolve()); } TEST_F(ResolverTypeValidationTest, RuntimeArrayInFunction_Fail) { @@ -417,8 +421,7 @@ TEST_F(ResolverTypeValidationTest, Struct_TooBig) { EXPECT_FALSE(r()->Resolve()); EXPECT_EQ(r()->error(), - "12:34 error: struct size in bytes must not exceed 0xffffffff, but " - "is 0x100000000"); + "12:34 error: struct size (0x100000000) must not exceed 0xffffffff bytes"); } TEST_F(ResolverTypeValidationTest, Struct_MemberOffset_TooBig) { @@ -438,8 +441,7 @@ TEST_F(ResolverTypeValidationTest, Struct_MemberOffset_TooBig) { EXPECT_FALSE(r()->Resolve()); EXPECT_EQ(r()->error(), - "12:34 error: struct member has byte offset 0x100000000, but must " - "not exceed 0xffffffff"); + "12:34 error: struct member offset (0x100000000) must not exceed 0xffffffff bytes"); } TEST_F(ResolverTypeValidationTest, RuntimeArrayIsLast_Pass) { @@ -467,8 +469,7 @@ TEST_F(ResolverTypeValidationTest, RuntimeArrayInArray) { EXPECT_FALSE(r()->Resolve()) << r()->error(); EXPECT_EQ(r()->error(), - "12:34 error: an array element type cannot contain a runtime-sized " - "array"); + "12:34 error: an array element type cannot contain a runtime-sized array"); } TEST_F(ResolverTypeValidationTest, RuntimeArrayInStructInArray) { @@ -482,8 +483,7 @@ TEST_F(ResolverTypeValidationTest, RuntimeArrayInStructInArray) { EXPECT_FALSE(r()->Resolve()) << r()->error(); EXPECT_EQ(r()->error(), - "12:34 error: an array element type cannot contain a runtime-sized " - "array"); + "12:34 error: an array element type cannot contain a runtime-sized array"); } TEST_F(ResolverTypeValidationTest, RuntimeArrayInStructInStruct) { @@ -499,8 +499,8 @@ TEST_F(ResolverTypeValidationTest, RuntimeArrayInStructInStruct) { EXPECT_FALSE(r()->Resolve()) << r()->error(); EXPECT_EQ(r()->error(), - "12:34 error: a struct that contains a runtime array cannot be " - "nested inside another struct"); + "12:34 error: a struct that contains a runtime array cannot be nested inside another " + "struct"); } TEST_F(ResolverTypeValidationTest, RuntimeArrayIsNotLast_Fail) { @@ -601,8 +601,7 @@ TEST_F(ResolverTypeValidationTest, AliasRuntimeArrayIsNotLast_Fail) { EXPECT_FALSE(r()->Resolve()) << r()->error(); EXPECT_EQ(r()->error(), - "12:34 error: runtime arrays may only appear as the last member of " - "a struct"); + "12:34 error: runtime arrays may only appear as the last member of a struct"); } TEST_F(ResolverTypeValidationTest, AliasRuntimeArrayIsLast_Pass) { @@ -629,8 +628,7 @@ TEST_F(ResolverTypeValidationTest, ArrayOfNonStorableType) { EXPECT_FALSE(r()->Resolve()); EXPECT_EQ(r()->error(), - "12:34 error: texture_2d cannot be used as an element type of " - "an array"); + "12:34 error: texture_2d cannot be used as an element type of an array"); } TEST_F(ResolverTypeValidationTest, VariableAsType) { @@ -980,8 +978,7 @@ TEST_F(StorageTextureAccessTest, RWAccess_Fail) { EXPECT_FALSE(r()->Resolve()); EXPECT_EQ(r()->error(), - "12:34 error: storage textures currently only support 'write' " - "access control"); + "12:34 error: storage textures currently only support 'write' access control"); } TEST_F(StorageTextureAccessTest, ReadOnlyAccess_Fail) { @@ -995,8 +992,7 @@ TEST_F(StorageTextureAccessTest, ReadOnlyAccess_Fail) { EXPECT_FALSE(r()->Resolve()); EXPECT_EQ(r()->error(), - "12:34 error: storage textures currently only support 'write' " - "access control"); + "12:34 error: storage textures currently only support 'write' access control"); } TEST_F(StorageTextureAccessTest, WriteOnlyAccess_Pass) { @@ -1116,8 +1112,7 @@ TEST_P(InvalidVectorElementTypes, InvalidElementType) { ast::StorageClass::kPrivate); EXPECT_FALSE(r()->Resolve()); EXPECT_EQ(r()->error(), - "12:34 error: vector element type must be 'bool', 'f32', 'i32' " - "or 'u32'"); + "12:34 error: vector element type must be 'bool', 'f32', 'i32' or 'u32'"); } INSTANTIATE_TEST_SUITE_P(ResolverTypeValidationTest, InvalidVectorElementTypes, diff --git a/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.glsl index 98b5a53a6b..9f372602c4 100644 --- a/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat2 m = mat2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f)); mat2 f() { mat2 m_1 = mat2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f)); - return mat2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.hlsl index 884de044ba..4e8ff0b1ec 100644 --- a/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float2x2 m = float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f)); float2x2 f() { const float2x2 m_1 = float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f)); - return float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.msl index 2397b00eed..c464132ffa 100644 --- a/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float2x2 m = float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f)); float2x2 f() { float2x2 const m_1 = float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f)); - return float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.spvasm index 8b08148ddb..b2cc1c486c 100644 --- a/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat2x2/explicit/identity/f32.wgsl.expected.spvasm @@ -13,9 +13,9 @@ %float = OpTypeFloat 32 %v2float = OpTypeVector %float 2 %mat2v2float = OpTypeMatrix %v2float 2 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 - %6 = OpConstantComposite %v2float %float_0 %float_1 + %6 = OpConstantComposite %v2float %4 %float_1 %float_2 = OpConstant %float 2 %float_3 = OpConstant %float 3 %9 = OpConstantComposite %v2float %float_2 %float_3 diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.glsl index 98b5a53a6b..9f372602c4 100644 --- a/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat2 m = mat2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f)); mat2 f() { mat2 m_1 = mat2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f)); - return mat2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.hlsl index 884de044ba..4e8ff0b1ec 100644 --- a/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float2x2 m = float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f)); float2x2 f() { const float2x2 m_1 = float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f)); - return float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.msl index 2397b00eed..c464132ffa 100644 --- a/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float2x2 m = float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f)); float2x2 f() { float2x2 const m_1 = float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f)); - return float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.spvasm index 8b08148ddb..b2cc1c486c 100644 --- a/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/identity/f32.wgsl.expected.spvasm @@ -13,9 +13,9 @@ %float = OpTypeFloat 32 %v2float = OpTypeVector %float 2 %mat2v2float = OpTypeMatrix %v2float 2 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 - %6 = OpConstantComposite %v2float %float_0 %float_1 + %6 = OpConstantComposite %v2float %4 %float_1 %float_2 = OpConstant %float 2 %float_3 = OpConstant %float 3 %9 = OpConstantComposite %v2float %float_2 %float_3 diff --git a/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.glsl index b191a03315..8b1bb8deba 100644 --- a/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat2x3 m = mat2x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f)); mat2x3 f() { mat2x3 m_1 = mat2x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f)); - return mat2x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.hlsl index 4a428a221d..96f34728cb 100644 --- a/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float2x3 m = float2x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, float2x3 f() { const float2x3 m_1 = float2x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f)); - return float2x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.msl index 6e9320e969..e0619e16e0 100644 --- a/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float2x3 m = float2x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f float2x3 f() { float2x3 const m_1 = float2x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f)); - return float2x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.spvasm index 0cecb54a48..075746aee7 100644 --- a/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat2x3/explicit/identity/f32.wgsl.expected.spvasm @@ -13,10 +13,10 @@ %float = OpTypeFloat 32 %v3float = OpTypeVector %float 3 %mat2v3float = OpTypeMatrix %v3float 2 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 %float_2 = OpConstant %float 2 - %7 = OpConstantComposite %v3float %float_0 %float_1 %float_2 + %7 = OpConstantComposite %v3float %4 %float_1 %float_2 %float_3 = OpConstant %float 3 %float_4 = OpConstant %float 4 %float_5 = OpConstant %float 5 diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.glsl index b191a03315..8b1bb8deba 100644 --- a/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat2x3 m = mat2x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f)); mat2x3 f() { mat2x3 m_1 = mat2x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f)); - return mat2x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.hlsl index 4a428a221d..96f34728cb 100644 --- a/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float2x3 m = float2x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, float2x3 f() { const float2x3 m_1 = float2x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f)); - return float2x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.msl index 6e9320e969..e0619e16e0 100644 --- a/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float2x3 m = float2x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f float2x3 f() { float2x3 const m_1 = float2x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f)); - return float2x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.spvasm index 0cecb54a48..075746aee7 100644 --- a/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/identity/f32.wgsl.expected.spvasm @@ -13,10 +13,10 @@ %float = OpTypeFloat 32 %v3float = OpTypeVector %float 3 %mat2v3float = OpTypeMatrix %v3float 2 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 %float_2 = OpConstant %float 2 - %7 = OpConstantComposite %v3float %float_0 %float_1 %float_2 + %7 = OpConstantComposite %v3float %4 %float_1 %float_2 %float_3 = OpConstant %float 3 %float_4 = OpConstant %float 4 %float_5 = OpConstant %float 5 diff --git a/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.glsl index 41253c4844..4f30e2f696 100644 --- a/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat2x4 m = mat2x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f)); mat2x4 f() { mat2x4 m_1 = mat2x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f)); - return mat2x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.hlsl index 32b40f8c6d..96e6b19a29 100644 --- a/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float2x4 m = float2x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, float2x4 f() { const float2x4 m_1 = float2x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f)); - return float2x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.msl index d4bd7dfe00..d3c4da980a 100644 --- a/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float2x4 m = float2x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f float2x4 f() { float2x4 const m_1 = float2x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f)); - return float2x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.spvasm index 6766c86270..7cab4d6208 100644 --- a/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat2x4/explicit/identity/f32.wgsl.expected.spvasm @@ -13,11 +13,11 @@ %float = OpTypeFloat 32 %v4float = OpTypeVector %float 4 %mat2v4float = OpTypeMatrix %v4float 2 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 %float_2 = OpConstant %float 2 %float_3 = OpConstant %float 3 - %8 = OpConstantComposite %v4float %float_0 %float_1 %float_2 %float_3 + %8 = OpConstantComposite %v4float %4 %float_1 %float_2 %float_3 %float_4 = OpConstant %float 4 %float_5 = OpConstant %float 5 %float_6 = OpConstant %float 6 diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.glsl index 41253c4844..4f30e2f696 100644 --- a/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat2x4 m = mat2x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f)); mat2x4 f() { mat2x4 m_1 = mat2x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f)); - return mat2x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.hlsl index 32b40f8c6d..96e6b19a29 100644 --- a/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float2x4 m = float2x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, float2x4 f() { const float2x4 m_1 = float2x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f)); - return float2x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.msl index d4bd7dfe00..d3c4da980a 100644 --- a/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float2x4 m = float2x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f float2x4 f() { float2x4 const m_1 = float2x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f)); - return float2x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.spvasm index 6766c86270..7cab4d6208 100644 --- a/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/identity/f32.wgsl.expected.spvasm @@ -13,11 +13,11 @@ %float = OpTypeFloat 32 %v4float = OpTypeVector %float 4 %mat2v4float = OpTypeMatrix %v4float 2 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 %float_2 = OpConstant %float 2 %float_3 = OpConstant %float 3 - %8 = OpConstantComposite %v4float %float_0 %float_1 %float_2 %float_3 + %8 = OpConstantComposite %v4float %4 %float_1 %float_2 %float_3 %float_4 = OpConstant %float 4 %float_5 = OpConstant %float 5 %float_6 = OpConstant %float 6 diff --git a/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.glsl index 49056fe85a..e06777447d 100644 --- a/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat3x2 m = mat3x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f)); mat3x2 f() { mat3x2 m_1 = mat3x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f)); - return mat3x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.hlsl index 049a998392..5897ac6818 100644 --- a/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float3x2 m = float3x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float float3x2 f() { const float3x2 m_1 = float3x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f)); - return float3x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.msl index 9e216c8e36..43ec39631b 100644 --- a/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float3x2 m = float3x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4. float3x2 f() { float3x2 const m_1 = float3x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f)); - return float3x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.spvasm index 6679e29f42..95ffb2b982 100644 --- a/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat3x2/explicit/identity/f32.wgsl.expected.spvasm @@ -13,9 +13,9 @@ %float = OpTypeFloat 32 %v2float = OpTypeVector %float 2 %mat3v2float = OpTypeMatrix %v2float 3 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 - %6 = OpConstantComposite %v2float %float_0 %float_1 + %6 = OpConstantComposite %v2float %4 %float_1 %float_2 = OpConstant %float 2 %float_3 = OpConstant %float 3 %9 = OpConstantComposite %v2float %float_2 %float_3 diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.glsl index 49056fe85a..e06777447d 100644 --- a/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat3x2 m = mat3x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f)); mat3x2 f() { mat3x2 m_1 = mat3x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f)); - return mat3x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.hlsl index 049a998392..5897ac6818 100644 --- a/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float3x2 m = float3x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float float3x2 f() { const float3x2 m_1 = float3x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f)); - return float3x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.msl index 9e216c8e36..43ec39631b 100644 --- a/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float3x2 m = float3x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4. float3x2 f() { float3x2 const m_1 = float3x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f)); - return float3x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.spvasm index 6679e29f42..95ffb2b982 100644 --- a/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/identity/f32.wgsl.expected.spvasm @@ -13,9 +13,9 @@ %float = OpTypeFloat 32 %v2float = OpTypeVector %float 2 %mat3v2float = OpTypeMatrix %v2float 3 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 - %6 = OpConstantComposite %v2float %float_0 %float_1 + %6 = OpConstantComposite %v2float %4 %float_1 %float_2 = OpConstant %float 2 %float_3 = OpConstant %float 3 %9 = OpConstantComposite %v2float %float_2 %float_3 diff --git a/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.glsl index e99ac3cdd7..e3e750e283 100644 --- a/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat3 m = mat3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f)); mat3 f() { mat3 m_1 = mat3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f)); - return mat3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.hlsl index 63eef11bb6..1795dfb44d 100644 --- a/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float3x3 m = float3x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, float3x3 f() { const float3x3 m_1 = float3x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f)); - return float3x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.msl index d2eac15db8..f6a7b59bc1 100644 --- a/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float3x3 m = float3x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f float3x3 f() { float3x3 const m_1 = float3x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f)); - return float3x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.spvasm index 0386f4e3af..d213c9996f 100644 --- a/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat3x3/explicit/identity/f32.wgsl.expected.spvasm @@ -13,10 +13,10 @@ %float = OpTypeFloat 32 %v3float = OpTypeVector %float 3 %mat3v3float = OpTypeMatrix %v3float 3 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 %float_2 = OpConstant %float 2 - %7 = OpConstantComposite %v3float %float_0 %float_1 %float_2 + %7 = OpConstantComposite %v3float %4 %float_1 %float_2 %float_3 = OpConstant %float 3 %float_4 = OpConstant %float 4 %float_5 = OpConstant %float 5 diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.glsl index e99ac3cdd7..e3e750e283 100644 --- a/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat3 m = mat3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f)); mat3 f() { mat3 m_1 = mat3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f)); - return mat3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.hlsl index 63eef11bb6..1795dfb44d 100644 --- a/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float3x3 m = float3x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, float3x3 f() { const float3x3 m_1 = float3x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f)); - return float3x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.msl index d2eac15db8..f6a7b59bc1 100644 --- a/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float3x3 m = float3x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f float3x3 f() { float3x3 const m_1 = float3x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f)); - return float3x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.spvasm index 0386f4e3af..d213c9996f 100644 --- a/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/identity/f32.wgsl.expected.spvasm @@ -13,10 +13,10 @@ %float = OpTypeFloat 32 %v3float = OpTypeVector %float 3 %mat3v3float = OpTypeMatrix %v3float 3 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 %float_2 = OpConstant %float 2 - %7 = OpConstantComposite %v3float %float_0 %float_1 %float_2 + %7 = OpConstantComposite %v3float %4 %float_1 %float_2 %float_3 = OpConstant %float 3 %float_4 = OpConstant %float 4 %float_5 = OpConstant %float 5 diff --git a/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.glsl index 075d29b209..6c64f684a7 100644 --- a/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat3x4 m = mat3x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f), vec4(8.0f, 9.0f, 10.0f, 11.0f)); mat3x4 f() { mat3x4 m_1 = mat3x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f), vec4(8.0f, 9.0f, 10.0f, 11.0f)); - return mat3x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f), vec4(8.0f, 9.0f, 10.0f, 11.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.hlsl index de62d39bf1..77ea8aff25 100644 --- a/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float3x4 m = float3x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, float3x4 f() { const float3x4 m_1 = float3x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f), float4(8.0f, 9.0f, 10.0f, 11.0f)); - return float3x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f), float4(8.0f, 9.0f, 10.0f, 11.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.msl index 86e4c2eb18..4ee3d7b89d 100644 --- a/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float3x4 m = float3x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f float3x4 f() { float3x4 const m_1 = float3x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f), float4(8.0f, 9.0f, 10.0f, 11.0f)); - return float3x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f), float4(8.0f, 9.0f, 10.0f, 11.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.spvasm index 8770c7b37e..8019731814 100644 --- a/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat3x4/explicit/identity/f32.wgsl.expected.spvasm @@ -13,11 +13,11 @@ %float = OpTypeFloat 32 %v4float = OpTypeVector %float 4 %mat3v4float = OpTypeMatrix %v4float 3 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 %float_2 = OpConstant %float 2 %float_3 = OpConstant %float 3 - %8 = OpConstantComposite %v4float %float_0 %float_1 %float_2 %float_3 + %8 = OpConstantComposite %v4float %4 %float_1 %float_2 %float_3 %float_4 = OpConstant %float 4 %float_5 = OpConstant %float 5 %float_6 = OpConstant %float 6 diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.glsl index 075d29b209..6c64f684a7 100644 --- a/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat3x4 m = mat3x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f), vec4(8.0f, 9.0f, 10.0f, 11.0f)); mat3x4 f() { mat3x4 m_1 = mat3x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f), vec4(8.0f, 9.0f, 10.0f, 11.0f)); - return mat3x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f), vec4(8.0f, 9.0f, 10.0f, 11.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.hlsl index de62d39bf1..77ea8aff25 100644 --- a/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float3x4 m = float3x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, float3x4 f() { const float3x4 m_1 = float3x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f), float4(8.0f, 9.0f, 10.0f, 11.0f)); - return float3x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f), float4(8.0f, 9.0f, 10.0f, 11.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.msl index 86e4c2eb18..4ee3d7b89d 100644 --- a/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float3x4 m = float3x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f float3x4 f() { float3x4 const m_1 = float3x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f), float4(8.0f, 9.0f, 10.0f, 11.0f)); - return float3x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f), float4(8.0f, 9.0f, 10.0f, 11.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.spvasm index 8770c7b37e..8019731814 100644 --- a/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/identity/f32.wgsl.expected.spvasm @@ -13,11 +13,11 @@ %float = OpTypeFloat 32 %v4float = OpTypeVector %float 4 %mat3v4float = OpTypeMatrix %v4float 3 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 %float_2 = OpConstant %float 2 %float_3 = OpConstant %float 3 - %8 = OpConstantComposite %v4float %float_0 %float_1 %float_2 %float_3 + %8 = OpConstantComposite %v4float %4 %float_1 %float_2 %float_3 %float_4 = OpConstant %float 4 %float_5 = OpConstant %float 5 %float_6 = OpConstant %float 6 diff --git a/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.glsl index 899a25f3ca..1adb3c88c3 100644 --- a/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat4x2 m = mat4x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f), vec2(6.0f, 7.0f)); mat4x2 f() { mat4x2 m_1 = mat4x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f), vec2(6.0f, 7.0f)); - return mat4x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f), vec2(6.0f, 7.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.hlsl index de0cb92669..a8a20db5c1 100644 --- a/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float4x2 m = float4x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float float4x2 f() { const float4x2 m_1 = float4x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f), float2(6.0f, 7.0f)); - return float4x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f), float2(6.0f, 7.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.msl index 19ae09922d..dcef3ec151 100644 --- a/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float4x2 m = float4x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4. float4x2 f() { float4x2 const m_1 = float4x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f), float2(6.0f, 7.0f)); - return float4x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f), float2(6.0f, 7.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.spvasm index 045b57caab..54757df210 100644 --- a/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat4x2/explicit/identity/f32.wgsl.expected.spvasm @@ -13,9 +13,9 @@ %float = OpTypeFloat 32 %v2float = OpTypeVector %float 2 %mat4v2float = OpTypeMatrix %v2float 4 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 - %6 = OpConstantComposite %v2float %float_0 %float_1 + %6 = OpConstantComposite %v2float %4 %float_1 %float_2 = OpConstant %float 2 %float_3 = OpConstant %float 3 %9 = OpConstantComposite %v2float %float_2 %float_3 diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.glsl index 899a25f3ca..1adb3c88c3 100644 --- a/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat4x2 m = mat4x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f), vec2(6.0f, 7.0f)); mat4x2 f() { mat4x2 m_1 = mat4x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f), vec2(6.0f, 7.0f)); - return mat4x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f), vec2(6.0f, 7.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.hlsl index de0cb92669..a8a20db5c1 100644 --- a/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float4x2 m = float4x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float float4x2 f() { const float4x2 m_1 = float4x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f), float2(6.0f, 7.0f)); - return float4x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f), float2(6.0f, 7.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.msl index 19ae09922d..dcef3ec151 100644 --- a/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float4x2 m = float4x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4. float4x2 f() { float4x2 const m_1 = float4x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f), float2(6.0f, 7.0f)); - return float4x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f), float2(6.0f, 7.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.spvasm index 045b57caab..54757df210 100644 --- a/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/identity/f32.wgsl.expected.spvasm @@ -13,9 +13,9 @@ %float = OpTypeFloat 32 %v2float = OpTypeVector %float 2 %mat4v2float = OpTypeMatrix %v2float 4 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 - %6 = OpConstantComposite %v2float %float_0 %float_1 + %6 = OpConstantComposite %v2float %4 %float_1 %float_2 = OpConstant %float 2 %float_3 = OpConstant %float 3 %9 = OpConstantComposite %v2float %float_2 %float_3 diff --git a/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.glsl index 87a80c9936..f50674701d 100644 --- a/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat4x3 m = mat4x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f), vec3(9.0f, 10.0f, 11.0f)); mat4x3 f() { mat4x3 m_1 = mat4x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f), vec3(9.0f, 10.0f, 11.0f)); - return mat4x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f), vec3(9.0f, 10.0f, 11.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.hlsl index 30ebfbf728..8adbbb39d6 100644 --- a/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float4x3 m = float4x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, float4x3 f() { const float4x3 m_1 = float4x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f), float3(9.0f, 10.0f, 11.0f)); - return float4x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f), float3(9.0f, 10.0f, 11.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.msl index d7238cda45..b4c5eab896 100644 --- a/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float4x3 m = float4x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f float4x3 f() { float4x3 const m_1 = float4x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f), float3(9.0f, 10.0f, 11.0f)); - return float4x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f), float3(9.0f, 10.0f, 11.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.spvasm index 16d9efb2da..be135b05ec 100644 --- a/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat4x3/explicit/identity/f32.wgsl.expected.spvasm @@ -13,10 +13,10 @@ %float = OpTypeFloat 32 %v3float = OpTypeVector %float 3 %mat4v3float = OpTypeMatrix %v3float 4 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 %float_2 = OpConstant %float 2 - %7 = OpConstantComposite %v3float %float_0 %float_1 %float_2 + %7 = OpConstantComposite %v3float %4 %float_1 %float_2 %float_3 = OpConstant %float 3 %float_4 = OpConstant %float 4 %float_5 = OpConstant %float 5 diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.glsl index 87a80c9936..f50674701d 100644 --- a/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat4x3 m = mat4x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f), vec3(9.0f, 10.0f, 11.0f)); mat4x3 f() { mat4x3 m_1 = mat4x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f), vec3(9.0f, 10.0f, 11.0f)); - return mat4x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f), vec3(9.0f, 10.0f, 11.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.hlsl index 30ebfbf728..8adbbb39d6 100644 --- a/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float4x3 m = float4x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, float4x3 f() { const float4x3 m_1 = float4x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f), float3(9.0f, 10.0f, 11.0f)); - return float4x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f), float3(9.0f, 10.0f, 11.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.msl index d7238cda45..b4c5eab896 100644 --- a/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float4x3 m = float4x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f float4x3 f() { float4x3 const m_1 = float4x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f), float3(9.0f, 10.0f, 11.0f)); - return float4x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f), float3(9.0f, 10.0f, 11.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.spvasm index 16d9efb2da..be135b05ec 100644 --- a/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/identity/f32.wgsl.expected.spvasm @@ -13,10 +13,10 @@ %float = OpTypeFloat 32 %v3float = OpTypeVector %float 3 %mat4v3float = OpTypeMatrix %v3float 4 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 %float_2 = OpConstant %float 2 - %7 = OpConstantComposite %v3float %float_0 %float_1 %float_2 + %7 = OpConstantComposite %v3float %4 %float_1 %float_2 %float_3 = OpConstant %float 3 %float_4 = OpConstant %float 4 %float_5 = OpConstant %float 5 diff --git a/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.glsl index 3c5cf246e0..737abbe027 100644 --- a/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat4 m = mat4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f), vec4(8.0f, 9.0f, 10.0f, 11.0f), vec4(12.0f, 13.0f, 14.0f, 15.0f)); mat4 f() { mat4 m_1 = mat4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f), vec4(8.0f, 9.0f, 10.0f, 11.0f), vec4(12.0f, 13.0f, 14.0f, 15.0f)); - return mat4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f), vec4(8.0f, 9.0f, 10.0f, 11.0f), vec4(12.0f, 13.0f, 14.0f, 15.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.hlsl index 1f3e190c7f..cdde3bc260 100644 --- a/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float4x4 m = float4x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, float4x4 f() { const float4x4 m_1 = float4x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f), float4(8.0f, 9.0f, 10.0f, 11.0f), float4(12.0f, 13.0f, 14.0f, 15.0f)); - return float4x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f), float4(8.0f, 9.0f, 10.0f, 11.0f), float4(12.0f, 13.0f, 14.0f, 15.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.msl index ffac88eeba..54f69fa1e9 100644 --- a/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float4x4 m = float4x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f float4x4 f() { float4x4 const m_1 = float4x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f), float4(8.0f, 9.0f, 10.0f, 11.0f), float4(12.0f, 13.0f, 14.0f, 15.0f)); - return float4x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f), float4(8.0f, 9.0f, 10.0f, 11.0f), float4(12.0f, 13.0f, 14.0f, 15.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.spvasm index a4fc3676c1..43fad62d50 100644 --- a/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat4x4/explicit/identity/f32.wgsl.expected.spvasm @@ -13,11 +13,11 @@ %float = OpTypeFloat 32 %v4float = OpTypeVector %float 4 %mat4v4float = OpTypeMatrix %v4float 4 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 %float_2 = OpConstant %float 2 %float_3 = OpConstant %float 3 - %8 = OpConstantComposite %v4float %float_0 %float_1 %float_2 %float_3 + %8 = OpConstantComposite %v4float %4 %float_1 %float_2 %float_3 %float_4 = OpConstant %float 4 %float_5 = OpConstant %float 5 %float_6 = OpConstant %float 6 diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.glsl index 3c5cf246e0..737abbe027 100644 --- a/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.glsl +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.glsl @@ -7,6 +7,6 @@ void unused_entry_point() { const mat4 m = mat4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f), vec4(8.0f, 9.0f, 10.0f, 11.0f), vec4(12.0f, 13.0f, 14.0f, 15.0f)); mat4 f() { mat4 m_1 = mat4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f), vec4(8.0f, 9.0f, 10.0f, 11.0f), vec4(12.0f, 13.0f, 14.0f, 15.0f)); - return mat4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f), vec4(8.0f, 9.0f, 10.0f, 11.0f), vec4(12.0f, 13.0f, 14.0f, 15.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.hlsl index 1f3e190c7f..cdde3bc260 100644 --- a/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.hlsl +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.hlsl @@ -7,5 +7,5 @@ static const float4x4 m = float4x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, float4x4 f() { const float4x4 m_1 = float4x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f), float4(8.0f, 9.0f, 10.0f, 11.0f), float4(12.0f, 13.0f, 14.0f, 15.0f)); - return float4x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f), float4(8.0f, 9.0f, 10.0f, 11.0f), float4(12.0f, 13.0f, 14.0f, 15.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.msl index ffac88eeba..54f69fa1e9 100644 --- a/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.msl +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.msl @@ -5,6 +5,6 @@ constant float4x4 m = float4x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f float4x4 f() { float4x4 const m_1 = float4x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f), float4(8.0f, 9.0f, 10.0f, 11.0f), float4(12.0f, 13.0f, 14.0f, 15.0f)); - return float4x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f), float4(8.0f, 9.0f, 10.0f, 11.0f), float4(12.0f, 13.0f, 14.0f, 15.0f)); + return m_1; } diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.spvasm index a4fc3676c1..43fad62d50 100644 --- a/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.spvasm +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/identity/f32.wgsl.expected.spvasm @@ -13,11 +13,11 @@ %float = OpTypeFloat 32 %v4float = OpTypeVector %float 4 %mat4v4float = OpTypeMatrix %v4float 4 - %float_0 = OpConstant %float 0 + %4 = OpConstantNull %float %float_1 = OpConstant %float 1 %float_2 = OpConstant %float 2 %float_3 = OpConstant %float 3 - %8 = OpConstantComposite %v4float %float_0 %float_1 %float_2 %float_3 + %8 = OpConstantComposite %v4float %4 %float_1 %float_2 %float_3 %float_4 = OpConstant %float 4 %float_5 = OpConstant %float 5 %float_6 = OpConstant %float 6