diff --git a/src/tint/ast/float_literal_expression.cc b/src/tint/ast/float_literal_expression.cc index ab2d6cf3c6..36cb42a609 100644 --- a/src/tint/ast/float_literal_expression.cc +++ b/src/tint/ast/float_literal_expression.cc @@ -36,4 +36,15 @@ const FloatLiteralExpression* FloatLiteralExpression::Clone(CloneContext* ctx) c return ctx->dst->create(src, value, suffix); } +std::ostream& operator<<(std::ostream& out, FloatLiteralExpression::Suffix suffix) { + switch (suffix) { + default: + return out; + case FloatLiteralExpression::Suffix::kF: + return out << "f"; + case FloatLiteralExpression::Suffix::kH: + return out << "h"; + } +} + } // namespace tint::ast diff --git a/src/tint/ast/float_literal_expression.h b/src/tint/ast/float_literal_expression.h index 72a395f8d4..7f03caf692 100644 --- a/src/tint/ast/float_literal_expression.h +++ b/src/tint/ast/float_literal_expression.h @@ -55,6 +55,12 @@ class FloatLiteralExpression final : public Castablesuffix, FloatLiteralExpression::Suffix::kF); } +TEST_F(FloatLiteralExpressionTest, SuffixH) { + auto* i = create(42.0, FloatLiteralExpression::Suffix::kH); + ASSERT_TRUE(i->Is()); + EXPECT_EQ(i->value, 42); + EXPECT_EQ(i->suffix, FloatLiteralExpression::Suffix::kH); +} + +TEST_F(FloatLiteralExpressionTest, SuffixStringStream) { + auto to_str = [](FloatLiteralExpression::Suffix suffix) { + std::stringstream ss; + ss << suffix; + return ss.str(); + }; + + EXPECT_EQ("", to_str(FloatLiteralExpression::Suffix::kNone)); + EXPECT_EQ("f", to_str(FloatLiteralExpression::Suffix::kF)); + EXPECT_EQ("h", to_str(FloatLiteralExpression::Suffix::kH)); +} + } // namespace } // namespace tint::ast diff --git a/src/tint/ast/int_literal_expression_test.cc b/src/tint/ast/int_literal_expression_test.cc index 8bc3d2ff6e..969e1b94ea 100644 --- a/src/tint/ast/int_literal_expression_test.cc +++ b/src/tint/ast/int_literal_expression_test.cc @@ -40,5 +40,17 @@ TEST_F(IntLiteralExpressionTest, SuffixU) { EXPECT_EQ(i->suffix, IntLiteralExpression::Suffix::kU); } +TEST_F(IntLiteralExpressionTest, SuffixStringStream) { + auto to_str = [](IntLiteralExpression::Suffix suffix) { + std::stringstream ss; + ss << suffix; + return ss.str(); + }; + + EXPECT_EQ("", to_str(IntLiteralExpression::Suffix::kNone)); + EXPECT_EQ("i", to_str(IntLiteralExpression::Suffix::kI)); + EXPECT_EQ("u", to_str(IntLiteralExpression::Suffix::kU)); +} + } // namespace } // namespace tint::ast diff --git a/src/tint/reader/spirv/function_arithmetic_test.cc b/src/tint/reader/spirv/function_arithmetic_test.cc index 9db49d9ced..059791677f 100644 --- a/src/tint/reader/spirv/function_arithmetic_test.cc +++ b/src/tint/reader/spirv/function_arithmetic_test.cc @@ -93,10 +93,10 @@ std::string AstFor(std::string assembly) { return "bitcast>(vec2(40i, 30i))"; } if (assembly == "v2float_50_60") { - return "vec2(50.0, 60.0)"; + return "vec2(50.0f, 60.0f)"; } if (assembly == "v2float_60_50") { - return "vec2(60.0, 50.0)"; + return "vec2(60.0f, 50.0f)"; } return "bad case"; } @@ -253,7 +253,7 @@ TEST_F(SpvUnaryArithTest, FNegate_Scalar) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : f32 = -(50.0);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : f32 = -(50.0f);")); } TEST_F(SpvUnaryArithTest, FNegate_Vector) { @@ -270,7 +270,7 @@ TEST_F(SpvUnaryArithTest, FNegate_Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2 = -(vec2(50.0, 60.0));")); + HasSubstr("let x_1 : vec2 = -(vec2(50.0f, 60.0f));")); } struct BinaryData { @@ -394,8 +394,8 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FAdd, SpvBinaryArithTest, ::testing::Values( // Scalar float - BinaryData{"float", "float_50", "OpFAdd", "float_60", "f32", "50.0", - "+", "60.0"}, // Vector float + BinaryData{"float", "float_50", "OpFAdd", "float_60", "f32", "50.0f", + "+", "60.0f"}, // Vector float BinaryData{"v2float", "v2float_50_60", "OpFAdd", "v2float_60_50", "vec2", AstFor("v2float_50_60"), "+", AstFor("v2float_60_50")})); @@ -441,8 +441,8 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FSub, SpvBinaryArithTest, ::testing::Values( // Scalar float - BinaryData{"float", "float_50", "OpFSub", "float_60", "f32", "50.0", - "-", "60.0"}, // Vector float + BinaryData{"float", "float_50", "OpFSub", "float_60", "f32", "50.0f", + "-", "60.0f"}, // Vector float BinaryData{"v2float", "v2float_50_60", "OpFSub", "v2float_60_50", "vec2", AstFor("v2float_50_60"), "-", AstFor("v2float_60_50")})); @@ -488,8 +488,8 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FMul, SpvBinaryArithTest, ::testing::Values( // Scalar float - BinaryData{"float", "float_50", "OpFMul", "float_60", "f32", "50.0", - "*", "60.0"}, // Vector float + BinaryData{"float", "float_50", "OpFMul", "float_60", "f32", "50.0f", + "*", "60.0f"}, // Vector float BinaryData{"v2float", "v2float_50_60", "OpFMul", "v2float_60_50", "vec2", AstFor("v2float_50_60"), "*", AstFor("v2float_60_50")})); @@ -576,8 +576,8 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FDiv, SpvBinaryArithTest, ::testing::Values( // Scalar float - BinaryData{"float", "float_50", "OpFDiv", "float_60", "f32", "50.0", - "/", "60.0"}, // Vector float + BinaryData{"float", "float_50", "OpFDiv", "float_60", "f32", "50.0f", + "/", "60.0f"}, // Vector float BinaryData{"v2float", "v2float_50_60", "OpFDiv", "v2float_60_50", "vec2", AstFor("v2float_50_60"), "/", AstFor("v2float_60_50")})); @@ -667,8 +667,8 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FRem, SpvBinaryArithTest, ::testing::Values( // Scalar float - BinaryData{"float", "float_50", "OpFRem", "float_60", "f32", "50.0", - "%", "60.0"}, // Vector float + BinaryData{"float", "float_50", "OpFRem", "float_60", "f32", "50.0f", + "%", "60.0f"}, // Vector float BinaryData{"v2float", "v2float_50_60", "OpFRem", "v2float_60_50", "vec2", AstFor("v2float_50_60"), "%", AstFor("v2float_60_50")})); @@ -687,7 +687,7 @@ TEST_F(SpvBinaryArithTestBasic, FMod_Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : f32 = (50.0 - (60.0 * floor((50.0 / 60.0))));")); + HasSubstr("let x_1 : f32 = (50.0f - (60.0f * floor((50.0f / 60.0f))));")); } TEST_F(SpvBinaryArithTestBasic, FMod_Vector) { @@ -706,7 +706,7 @@ TEST_F(SpvBinaryArithTestBasic, FMod_Vector) { EXPECT_THAT( test::ToString(p->program(), ast_body), HasSubstr( - R"(let x_1 : vec2 = (vec2(50.0, 60.0) - (vec2(60.0, 50.0) * floor((vec2(50.0, 60.0) / vec2(60.0, 50.0)))));)")); + R"(let x_1 : vec2 = (vec2(50.0f, 60.0f) - (vec2(60.0f, 50.0f) * floor((vec2(50.0f, 60.0f) / vec2(60.0f, 50.0f)))));)")); } TEST_F(SpvBinaryArithTestBasic, VectorTimesScalar) { diff --git a/src/tint/reader/spirv/function_composite_test.cc b/src/tint/reader/spirv/function_composite_test.cc index 2e15743246..2b26d146fe 100644 --- a/src/tint/reader/spirv/function_composite_test.cc +++ b/src/tint/reader/spirv/function_composite_test.cc @@ -98,7 +98,7 @@ TEST_F(SpvParserTest_Composite_Construct, Vector) { EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_1 : vec2 = vec2(10u, 20u); let x_2 : vec2 = vec2(30i, 40i); -let x_3 : vec2 = vec2(50.0, 60.0); +let x_3 : vec2 = vec2(50.0f, 60.0f); )")); } @@ -117,9 +117,9 @@ TEST_F(SpvParserTest_Composite_Construct, Matrix) { auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : mat3x2 = mat3x2(" - "vec2(50.0, 60.0), " - "vec2(60.0, 50.0), " - "vec2(70.0, 70.0));")); + "vec2(50.0f, 60.0f), " + "vec2(60.0f, 50.0f), " + "vec2(70.0f, 70.0f));")); } TEST_F(SpvParserTest_Composite_Construct, Array) { @@ -153,7 +153,7 @@ TEST_F(SpvParserTest_Composite_Construct, Struct) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : S = S(vec2(50.0, 60.0), 5u, 30i);")); + HasSubstr("let x_1 : S = S(vec2(50.0f, 60.0f), 5u, 30i);")); } TEST_F(SpvParserTest_Composite_Construct, ConstantComposite_Struct_NoDeduplication) { @@ -201,7 +201,7 @@ TEST_F(SpvParserTest_CompositeExtract, Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : f32 = vec2(50.0, 60.0).y;")); + HasSubstr("let x_1 : f32 = vec2(50.0f, 60.0f).y;")); } TEST_F(SpvParserTest_CompositeExtract, Vector_IndexTooBigError) { @@ -448,8 +448,8 @@ TEST_F(SpvParserTest_CompositeInsert, Vector) { auto ast_body = fe.ast_body(); auto got = test::ToString(p->program(), ast_body); const auto* expected = - R"(var x_1_1 : vec2 = vec2(50.0, 60.0); -x_1_1.y = 70.0; + R"(var x_1_1 : vec2 = vec2(50.0f, 60.0f); +x_1_1.y = 70.0f; let x_1 : vec2 = x_1_1; return; )"; @@ -492,7 +492,7 @@ TEST_F(SpvParserTest_CompositeInsert, Matrix) { auto ast_body = fe.ast_body(); auto body_str = test::ToString(p->program(), ast_body); EXPECT_THAT(body_str, HasSubstr(R"(var x_2_1 : mat3x2 = x_1; -x_2_1[2u] = vec2(50.0, 60.0); +x_2_1[2u] = vec2(50.0f, 60.0f); let x_2 : mat3x2 = x_2_1; )")) << body_str; } @@ -537,7 +537,7 @@ TEST_F(SpvParserTest_CompositeInsert, Matrix_Vector) { auto ast_body = fe.ast_body(); auto body_str = test::ToString(p->program(), ast_body); EXPECT_THAT(body_str, HasSubstr(R"(var x_2_1 : mat3x2 = x_1; -x_2_1[2u] = vec2(50.0, 60.0); +x_2_1[2u] = vec2(50.0f, 60.0f); let x_2 : mat3x2 = x_2_1; return; )")) << body_str; @@ -713,7 +713,7 @@ TEST_F(SpvParserTest_CompositeInsert, Struct_Array_Matrix_Vector) { EXPECT_THAT(body_str, HasSubstr(R"(var x_38 : S_1; let x_1 : S_1 = x_38; var x_2_1 : S_1 = x_1; -x_2_1.field1[2u][0u].y = 70.0; +x_2_1.field1[2u][0u].y = 70.0f; let x_2 : S_1 = x_2_1; )")) << body_str; } diff --git a/src/tint/reader/spirv/function_conversion_test.cc b/src/tint/reader/spirv/function_conversion_test.cc index e2f10b22e1..eab003129c 100644 --- a/src/tint/reader/spirv/function_conversion_test.cc +++ b/src/tint/reader/spirv/function_conversion_test.cc @@ -83,7 +83,7 @@ TEST_F(SpvUnaryConversionTest, Bitcast_Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : u32 = bitcast(50.0);")); + HasSubstr("let x_1 : u32 = bitcast(50.0f);")); } TEST_F(SpvUnaryConversionTest, Bitcast_Vector) { diff --git a/src/tint/reader/spirv/function_decl_test.cc b/src/tint/reader/spirv/function_decl_test.cc index bced9358cd..8af9da2172 100644 --- a/src/tint/reader/spirv/function_decl_test.cc +++ b/src/tint/reader/spirv/function_decl_test.cc @@ -93,7 +93,7 @@ TEST_F(SpvParserTest, Emit_NonVoidResultType) { auto got = test::ToString(p->program()); std::string expect = R"(fn x_200() -> f32 { - return 0.0; + return 0.0f; } )"; EXPECT_THAT(got, HasSubstr(expect)); diff --git a/src/tint/reader/spirv/function_glsl_std_450_test.cc b/src/tint/reader/spirv/function_glsl_std_450_test.cc index 319332a7ff..4836a6851c 100644 --- a/src/tint/reader/spirv/function_glsl_std_450_test.cc +++ b/src/tint/reader/spirv/function_glsl_std_450_test.cc @@ -673,7 +673,7 @@ TEST_F(SpvParserTest, Normalize_Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); - EXPECT_THAT(body, HasSubstr("let x_1 : f32 = 1.0;")) << body; + EXPECT_THAT(body, HasSubstr("let x_1 : f32 = 1.0f;")) << body; } TEST_F(SpvParserTest, Normalize_Vector2) { @@ -981,7 +981,7 @@ TEST_F(SpvParserTest, GlslStd450_Refract_Scalar) { auto ast_body = fe.ast_body(); const auto body = test::ToString(p->program(), ast_body); const auto* expected = - R"(let x_1 : f32 = refract(vec2(f1, 0.0), vec2(f2, 0.0), f3).x;)"; + R"(let x_1 : f32 = refract(vec2(f1, 0.0f), vec2(f2, 0.0f), f3).x;)"; EXPECT_THAT(body, HasSubstr(expected)) << body; } @@ -1019,7 +1019,7 @@ TEST_F(SpvParserTest, GlslStd450_FaceForward_Scalar) { // The %99 sum only has one use. Ensure it is evaluated only once by // making a let-declaration for it, since it is the normal operand to // the builtin function, and code generation uses it twice. - const auto* expected = R"(let x_1 : f32 = select(-(x_99), x_99, ((f2 * f3) < 0.0));)"; + const auto* expected = R"(let x_1 : f32 = select(-(x_99), x_99, ((f2 * f3) < 0.0f));)"; EXPECT_THAT(body, HasSubstr(expected)) << body; } @@ -1059,7 +1059,7 @@ TEST_F(SpvParserTest, GlslStd450_Reflect_Scalar) { // The %99 sum only has one use. Ensure it is evaluated only once by // making a let-declaration for it, since it is the normal operand to // the builtin function, and code generation uses it twice. - const auto* expected = R"(let x_1 : f32 = (x_98 - (2.0 * (x_99 * (x_99 * x_98))));)"; + const auto* expected = R"(let x_1 : f32 = (x_98 - (2.0f * (x_99 * (x_99 * x_98))));)"; EXPECT_THAT(body, HasSubstr(expected)) << body; } diff --git a/src/tint/reader/spirv/function_logical_test.cc b/src/tint/reader/spirv/function_logical_test.cc index ba73d5d10e..474af2e443 100644 --- a/src/tint/reader/spirv/function_logical_test.cc +++ b/src/tint/reader/spirv/function_logical_test.cc @@ -112,10 +112,10 @@ std::string AstFor(std::string assembly) { return "bitcast>(vec2(40i, 30i))"; } if (assembly == "v2float_50_60") { - return "vec2(50.0, 60.0)"; + return "vec2(50.0f, 60.0f)"; } if (assembly == "v2float_60_50") { - return "vec2(60.0, 50.0)"; + return "vec2(60.0f, 50.0f)"; } return "bad case"; } @@ -219,7 +219,7 @@ INSTANTIATE_TEST_SUITE_P( INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdEqual, SpvBinaryLogicalTest, ::testing::Values(BinaryData{"bool", "float_50", "OpFOrdEqual", "float_60", - "bool", "50.0", "==", "60.0"}, + "bool", "50.0f", "==", "60.0f"}, BinaryData{"v2bool", "v2float_50_60", "OpFOrdEqual", "v2float_60_50", "vec2", AstFor("v2float_50_60"), @@ -249,7 +249,7 @@ INSTANTIATE_TEST_SUITE_P( INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdNotEqual, SpvBinaryLogicalTest, ::testing::Values(BinaryData{"bool", "float_50", "OpFOrdNotEqual", - "float_60", "bool", "50.0", "!=", "60.0"}, + "float_60", "bool", "50.0f", "!=", "60.0f"}, BinaryData{"v2bool", "v2float_50_60", "OpFOrdNotEqual", "v2float_60_50", "vec2", AstFor("v2float_50_60"), @@ -258,7 +258,7 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdNotEqual, INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdLessThan, SpvBinaryLogicalTest, ::testing::Values(BinaryData{"bool", "float_50", "OpFOrdLessThan", - "float_60", "bool", "50.0", "<", "60.0"}, + "float_60", "bool", "50.0f", "<", "60.0f"}, BinaryData{"v2bool", "v2float_50_60", "OpFOrdLessThan", "v2float_60_50", "vec2", AstFor("v2float_50_60"), "<", @@ -267,7 +267,7 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdLessThan, INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdLessThanEqual, SpvBinaryLogicalTest, ::testing::Values(BinaryData{"bool", "float_50", "OpFOrdLessThanEqual", - "float_60", "bool", "50.0", "<=", "60.0"}, + "float_60", "bool", "50.0f", "<=", "60.0f"}, BinaryData{"v2bool", "v2float_50_60", "OpFOrdLessThanEqual", "v2float_60_50", "vec2", AstFor("v2float_50_60"), @@ -276,7 +276,7 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdLessThanEqual, INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdGreaterThan, SpvBinaryLogicalTest, ::testing::Values(BinaryData{"bool", "float_50", "OpFOrdGreaterThan", - "float_60", "bool", "50.0", ">", "60.0"}, + "float_60", "bool", "50.0f", ">", "60.0f"}, BinaryData{"v2bool", "v2float_50_60", "OpFOrdGreaterThan", "v2float_60_50", "vec2", AstFor("v2float_50_60"), ">", @@ -285,7 +285,7 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdGreaterThan, INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdGreaterThanEqual, SpvBinaryLogicalTest, ::testing::Values(BinaryData{"bool", "float_50", "OpFOrdGreaterThanEqual", - "float_60", "bool", "50.0", ">=", "60.0"}, + "float_60", "bool", "50.0f", ">=", "60.0f"}, BinaryData{"v2bool", "v2float_50_60", "OpFOrdGreaterThanEqual", "v2float_60_50", "vec2", AstFor("v2float_50_60"), @@ -515,7 +515,7 @@ TEST_F(SpvFUnordTest, FUnordEqual_Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : bool = !((50.0 != 60.0));")); + HasSubstr("let x_1 : bool = !((50.0f != 60.0f));")); } TEST_F(SpvFUnordTest, FUnordEqual_Vector) { @@ -533,7 +533,7 @@ TEST_F(SpvFUnordTest, FUnordEqual_Vector) { auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : vec2 = " - "!((vec2(50.0, 60.0) != vec2(60.0, 50.0)));")); + "!((vec2(50.0f, 60.0f) != vec2(60.0f, 50.0f)));")); } TEST_F(SpvFUnordTest, FUnordNotEqual_Scalar) { @@ -550,7 +550,7 @@ TEST_F(SpvFUnordTest, FUnordNotEqual_Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : bool = !((50.0 == 60.0));")); + HasSubstr("let x_1 : bool = !((50.0f == 60.0f));")); } TEST_F(SpvFUnordTest, FUnordNotEqual_Vector) { @@ -568,7 +568,7 @@ TEST_F(SpvFUnordTest, FUnordNotEqual_Vector) { auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : vec2 = " - "!((vec2(50.0, 60.0) == vec2(60.0, 50.0)));")); + "!((vec2(50.0f, 60.0f) == vec2(60.0f, 50.0f)));")); } TEST_F(SpvFUnordTest, FUnordLessThan_Scalar) { @@ -585,7 +585,7 @@ TEST_F(SpvFUnordTest, FUnordLessThan_Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : bool = !((50.0 >= 60.0));")); + HasSubstr("let x_1 : bool = !((50.0f >= 60.0f));")); } TEST_F(SpvFUnordTest, FUnordLessThan_Vector) { @@ -603,7 +603,7 @@ TEST_F(SpvFUnordTest, FUnordLessThan_Vector) { auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : vec2 = " - "!((vec2(50.0, 60.0) >= vec2(60.0, 50.0)));")); + "!((vec2(50.0f, 60.0f) >= vec2(60.0f, 50.0f)));")); } TEST_F(SpvFUnordTest, FUnordLessThanEqual_Scalar) { @@ -620,7 +620,7 @@ TEST_F(SpvFUnordTest, FUnordLessThanEqual_Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : bool = !((50.0 > 60.0));")); + HasSubstr("let x_1 : bool = !((50.0f > 60.0f));")); } TEST_F(SpvFUnordTest, FUnordLessThanEqual_Vector) { @@ -638,7 +638,7 @@ TEST_F(SpvFUnordTest, FUnordLessThanEqual_Vector) { auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : vec2 = " - "!((vec2(50.0, 60.0) > vec2(60.0, 50.0)));")); + "!((vec2(50.0f, 60.0f) > vec2(60.0f, 50.0f)));")); } TEST_F(SpvFUnordTest, FUnordGreaterThan_Scalar) { @@ -655,7 +655,7 @@ TEST_F(SpvFUnordTest, FUnordGreaterThan_Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : bool = !((50.0 <= 60.0));")); + HasSubstr("let x_1 : bool = !((50.0f <= 60.0f));")); } TEST_F(SpvFUnordTest, FUnordGreaterThan_Vector) { @@ -673,7 +673,7 @@ TEST_F(SpvFUnordTest, FUnordGreaterThan_Vector) { auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : vec2 = " - "!((vec2(50.0, 60.0) <= vec2(60.0, 50.0)));")); + "!((vec2(50.0f, 60.0f) <= vec2(60.0f, 50.0f)));")); } TEST_F(SpvFUnordTest, FUnordGreaterThanEqual_Scalar) { @@ -690,7 +690,7 @@ TEST_F(SpvFUnordTest, FUnordGreaterThanEqual_Scalar) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : bool = !((50.0 < 60.0));")); + HasSubstr("let x_1 : bool = !((50.0f < 60.0f));")); } TEST_F(SpvFUnordTest, FUnordGreaterThanEqual_Vector) { @@ -708,7 +708,7 @@ TEST_F(SpvFUnordTest, FUnordGreaterThanEqual_Vector) { auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : vec2 = !((" - "vec2(50.0, 60.0) < vec2(60.0, 50.0)" + "vec2(50.0f, 60.0f) < vec2(60.0f, 50.0f)" "));")); } @@ -762,7 +762,7 @@ TEST_F(SpvLogicalTest, Select_BoolCond_FloatScalarParams) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : f32 = select(60.0, 50.0, true);")); + HasSubstr("let x_1 : f32 = select(60.0f, 50.0f, true);")); } TEST_F(SpvLogicalTest, Select_BoolCond_VectorParams) { @@ -859,7 +859,8 @@ TEST_F(SpvLogicalTest, IsNan_Scalar) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : bool = isNan(50.0);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), + HasSubstr("let x_1 : bool = isNan(50.0f);")); } TEST_F(SpvLogicalTest, IsNan_Vector) { @@ -876,7 +877,7 @@ TEST_F(SpvLogicalTest, IsNan_Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2 = isNan(vec2(50.0, 60.0));")); + HasSubstr("let x_1 : vec2 = isNan(vec2(50.0f, 60.0f));")); } TEST_F(SpvLogicalTest, IsInf_Scalar) { @@ -892,7 +893,8 @@ TEST_F(SpvLogicalTest, IsInf_Scalar) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("let x_1 : bool = isInf(50.0);")); + EXPECT_THAT(test::ToString(p->program(), ast_body), + HasSubstr("let x_1 : bool = isInf(50.0f);")); } TEST_F(SpvLogicalTest, IsInf_Vector) { @@ -909,7 +911,7 @@ TEST_F(SpvLogicalTest, IsInf_Vector) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_1 : vec2 = isInf(vec2(50.0, 60.0));")); + HasSubstr("let x_1 : vec2 = isInf(vec2(50.0f, 60.0f));")); } // TODO(dneto): Kernel-guarded instructions. diff --git a/src/tint/reader/spirv/function_memory_test.cc b/src/tint/reader/spirv/function_memory_test.cc index 58ccedaa12..ed39e2121b 100644 --- a/src/tint/reader/spirv/function_memory_test.cc +++ b/src/tint/reader/spirv/function_memory_test.cc @@ -133,8 +133,9 @@ TEST_F(SpvParserMemoryTest, EmitStatement_StoreFloatConst) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(x_1 = 42.0; -x_1 = 0.0; + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(x_1 = 42.0f; +x_1 = 0.0f; +return; )")); } @@ -497,7 +498,7 @@ TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Matrix) { EXPECT_TRUE(fe.EmitBody()); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("myvar[2u] = vec4(42.0, 42.0, 42.0, 42.0);")); + HasSubstr("myvar[2u] = vec4(42.0f, 42.0f, 42.0f, 42.0f);")); } TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Array) { @@ -529,7 +530,7 @@ TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Array) { EXPECT_TRUE(fe.EmitBody()); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("myvar[2u] = vec4(42.0, 42.0, 42.0, 42.0);")); + HasSubstr("myvar[2u] = vec4(42.0f, 42.0f, 42.0f, 42.0f);")); } TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Struct) { @@ -559,7 +560,7 @@ TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Struct) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("myvar.age = 42.0;")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("myvar.age = 42.0f;")); } TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Struct_DifferOnlyMemberName) { @@ -601,8 +602,9 @@ TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Struct_DifferOnlyMemberNam auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(myvar.age = 42.0; -myvar2.ancientness = 420.0; + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(myvar.age = 42.0f; +myvar2.ancientness = 420.0f; +return; )")); } @@ -706,7 +708,7 @@ TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Struct_RuntimeArray) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("myvar.age[2u] = 42.0;")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("myvar.age[2u] = 42.0f;")); } TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Compound_Matrix_Vector) { @@ -737,7 +739,7 @@ TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Compound_Matrix_Vector) { auto fe = p->function_emitter(100); EXPECT_TRUE(fe.EmitBody()); auto ast_body = fe.ast_body(); - EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("myvar[2u].w = 42.0;")); + EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("myvar[2u].w = 42.0f;")); } TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_InvalidPointeeType) { diff --git a/src/tint/reader/spirv/function_misc_test.cc b/src/tint/reader/spirv/function_misc_test.cc index 9d40ffc3a5..3f9c3985c6 100644 --- a/src/tint/reader/spirv/function_misc_test.cc +++ b/src/tint/reader/spirv/function_misc_test.cc @@ -75,7 +75,8 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_BeforeFunction_Scalar) { EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_11 : bool = false; let x_12 : u32 = 0u; let x_13 : i32 = 0i; -let x_14 : f32 = 0.0; +let x_14 : f32 = 0.0f; +return; )")); } @@ -133,7 +134,8 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Scalar) { EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_11 : bool = false; let x_12 : u32 = 0u; let x_13 : i32 = 0i; -let x_14 : f32 = 0.0; +let x_14 : f32 = 0.0f; +return; )")); } @@ -224,7 +226,7 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Struct) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("let x_11 : S = S(false, 0u, 0i, 0.0);")); + HasSubstr("let x_11 : S = S(false, 0u, 0i, 0.0f);")); } TEST_F(SpvParserTestMiscInstruction, OpNop) { @@ -330,7 +332,7 @@ TEST_F(SpvParserTest, ValueFromBlockNotInBlockOrder) { EXPECT_TRUE(fe.EmitBody()) << p->error(); auto ast_body = fe.ast_body(); const auto got = test::ToString(p->program(), ast_body); - EXPECT_THAT(got, HasSubstr("let x_81 : f32 = (0.0 * 42.0);")); + EXPECT_THAT(got, HasSubstr("let x_81 : f32 = (0.0f * 42.0f);")); } // TODO(dneto): OpSizeof : requires Kernel (OpenCL) diff --git a/src/tint/reader/spirv/function_var_test.cc b/src/tint/reader/spirv/function_var_test.cc index c986af8571..6371234588 100644 --- a/src/tint/reader/spirv/function_var_test.cc +++ b/src/tint/reader/spirv/function_var_test.cc @@ -184,7 +184,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ScalarInitializers) { var b : bool = false; var c : i32 = -1i; var d : u32 = 1u; -var e : f32 = 1.5; +var e : f32 = 1.5f; )")); } @@ -212,7 +212,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ScalarNullInitializers) { EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(var a : bool = false; var b : i32 = 0i; var c : u32 = 0u; -var d : f32 = 0.0; +var d : f32 = 0.0f; )")); } @@ -234,7 +234,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_VectorInitializer) { auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("var x_200 : vec2 = vec2(1.5, 2.0);")); + HasSubstr("var x_200 : vec2 = vec2(1.5f, 2.0f);")); } TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_MatrixInitializer) { @@ -261,9 +261,9 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_MatrixInitializer) { auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr("var x_200 : mat3x2 = mat3x2(" - "vec2(1.5, 2.0), " - "vec2(2.0, 3.0), " - "vec2(3.0, 4.0));")); + "vec2(1.5f, 2.0f), " + "vec2(2.0f, 3.0f), " + "vec2(3.0f, 4.0f));")); } TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ArrayInitializer) { @@ -382,7 +382,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_StructInitializer) { auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("var x_200 : S = S(1u, 1.5, array(1u, 2u));")); + HasSubstr("var x_200 : S = S(1u, 1.5f, array(1u, 2u));")); } TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_StructInitializer_Null) { @@ -404,7 +404,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_StructInitializer_Null) { auto ast_body = fe.ast_body(); EXPECT_THAT(test::ToString(p->program(), ast_body), - HasSubstr("var x_200 : S = S(0u, 0.0, array());")); + HasSubstr("var x_200 : S = S(0u, 0.0f, array());")); } TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_Decorate_RelaxedPrecision) { diff --git a/src/tint/reader/spirv/parser_impl_function_decl_test.cc b/src/tint/reader/spirv/parser_impl_function_decl_test.cc index c821c8595e..fe6b1e0fe2 100644 --- a/src/tint/reader/spirv/parser_impl_function_decl_test.cc +++ b/src/tint/reader/spirv/parser_impl_function_decl_test.cc @@ -402,7 +402,16 @@ TEST_F(SpvParserTest, EmitFunctions_NonVoidResultType) { Program program = p->program(); const auto program_ast = test::ToString(program); EXPECT_THAT(program_ast, HasSubstr(R"(fn ret_float() -> f32 { - return 0.0; + return 0.0f; +} + +fn x_100_1() { + return; +} + +@stage(fragment) +fn x_100() { + x_100_1(); } )")) << program_ast; } diff --git a/src/tint/reader/spirv/parser_impl_handle_test.cc b/src/tint/reader/spirv/parser_impl_handle_test.cc index 0af3cc518a..84f3dcb3ef 100644 --- a/src/tint/reader/spirv/parser_impl_handle_test.cc +++ b/src/tint/reader/spirv/parser_impl_handle_test.cc @@ -1648,7 +1648,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler_comparison; @group(2) @binding(1) var x_20 : texture_depth_2d;)", - "textureGatherCompare(x_20, x_10, coords12, 0.200000003)"}, + "textureGatherCompare(x_20, x_10, coords12, 0.200000003f)"}, // OpImageDrefGather 2DDepth ConstOffset signed ImageAccessCase{"%float 2D 1 0 0 1 Unknown", "%result = OpImageDrefGather " @@ -1656,7 +1656,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler_comparison; @group(2) @binding(1) var x_20 : texture_depth_2d;)", - "textureGatherCompare(x_20, x_10, coords12, 0.200000003, " + "textureGatherCompare(x_20, x_10, coords12, 0.200000003f, " "vec2(3i, 4i))"}, // OpImageDrefGather 2DDepth ConstOffset unsigned ImageAccessCase{"%float 2D 1 0 0 1 Unknown", @@ -1666,7 +1666,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler_comparison; @group(2) @binding(1) var x_20 : texture_depth_2d;)", - "textureGatherCompare(x_20, x_10, coords12, 0.200000003, " + "textureGatherCompare(x_20, x_10, coords12, 0.200000003f, " "vec2(vec2(3u, 4u)))"}, // OpImageDrefGather 2DDepth Array ImageAccessCase{"%float 2D 1 1 0 1 Unknown", @@ -1676,7 +1676,7 @@ INSTANTIATE_TEST_SUITE_P( @group(2) @binding(1) var x_20 : texture_depth_2d_array;)", "textureGatherCompare(x_20, x_10, coords123.xy, " - "i32(round(coords123.z)), 0.200000003)"}, + "i32(round(coords123.z)), 0.200000003f)"}, // OpImageDrefGather 2DDepth Array ConstOffset signed ImageAccessCase{"%float 2D 1 1 0 1 Unknown", "%result = OpImageDrefGather " @@ -1685,7 +1685,7 @@ INSTANTIATE_TEST_SUITE_P( @group(2) @binding(1) var x_20 : texture_depth_2d_array;)", "textureGatherCompare(x_20, x_10, coords123.xy, " - "i32(round(coords123.z)), 0.200000003, vec2(3i, 4i))"}, + "i32(round(coords123.z)), 0.200000003f, vec2(3i, 4i))"}, // OpImageDrefGather 2DDepth Array ConstOffset unsigned ImageAccessCase{"%float 2D 1 1 0 1 Unknown", "%result = OpImageDrefGather " @@ -1695,7 +1695,7 @@ INSTANTIATE_TEST_SUITE_P( @group(2) @binding(1) var x_20 : texture_depth_2d_array;)", "textureGatherCompare(x_20, x_10, coords123.xy, " - "i32(round(coords123.z)), 0.200000003, " + "i32(round(coords123.z)), 0.200000003f, " "vec2(vec2(3u, 4u)))"}, // OpImageDrefGather DepthCube ImageAccessCase{"%float Cube 1 0 0 1 Unknown", @@ -1704,7 +1704,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler_comparison; @group(2) @binding(1) var x_20 : texture_depth_cube;)", - "textureGatherCompare(x_20, x_10, coords123, 0.200000003)"}, + "textureGatherCompare(x_20, x_10, coords123, 0.200000003f)"}, // OpImageDrefGather DepthCube Array ImageAccessCase{"%float Cube 1 1 0 1 Unknown", "%result = OpImageDrefGather " @@ -1713,7 +1713,7 @@ INSTANTIATE_TEST_SUITE_P( @group(2) @binding(1) var x_20 : texture_depth_cube_array;)", "textureGatherCompare(x_20, x_10, coords1234.xyz, " - "i32(round(coords1234.w)), 0.200000003)"}})); + "i32(round(coords1234.w)), 0.200000003f)"}})); INSTANTIATE_TEST_SUITE_P( ImageSampleImplicitLod, @@ -1764,7 +1764,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler; @group(2) @binding(1) var x_20 : texture_2d;)", - "textureSampleBias(x_20, x_10, coords12, 7.0)"}, + "textureSampleBias(x_20, x_10, coords12, 7.0f)"}, // OpImageSampleImplicitLod arrayed with Bias ImageAccessCase{ @@ -1774,7 +1774,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler; @group(2) @binding(1) var x_20 : texture_2d_array;)", - R"(textureSampleBias(x_20, x_10, coords123.xy, i32(round(coords123.z)), 7.0))"}, + R"(textureSampleBias(x_20, x_10, coords123.xy, i32(round(coords123.z)), 7.0f))"}, // OpImageSampleImplicitLod with Bias and signed ConstOffset ImageAccessCase{"%float 2D 0 0 0 1 Unknown", @@ -1784,7 +1784,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler; @group(2) @binding(1) var x_20 : texture_2d;)", - R"(textureSampleBias(x_20, x_10, coords12, 7.0, vec2(3i, 4i))"}, + R"(textureSampleBias(x_20, x_10, coords12, 7.0f, vec2(3i, 4i))"}, // OpImageSampleImplicitLod with Bias and unsigned ConstOffset // Convert ConstOffset to signed @@ -1796,7 +1796,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler; @group(2) @binding(1) var x_20 : texture_2d;)", - R"(textureSampleBias(x_20, x_10, coords12, 7.0, vec2(vec2(3u, 4u)))"}, + R"(textureSampleBias(x_20, x_10, coords12, 7.0f, vec2(vec2(3u, 4u)))"}, // OpImageSampleImplicitLod arrayed with Bias ImageAccessCase{ "%float 2D 0 1 0 1 Unknown", @@ -1806,7 +1806,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler; @group(2) @binding(1) var x_20 : texture_2d_array;)", - R"(textureSampleBias(x_20, x_10, coords123.xy, i32(round(coords123.z)), 7.0, vec2(3i, 4i))"})); + R"(textureSampleBias(x_20, x_10, coords123.xy, i32(round(coords123.z)), 7.0f, vec2(3i, 4i))"})); INSTANTIATE_TEST_SUITE_P( // This test shows the use of a sampled image used with both regular @@ -1831,8 +1831,8 @@ INSTANTIATE_TEST_SUITE_P( @group(0) @binding(1) var x_30 : sampler_comparison; )", R"( - let x_200 : vec4 = vec4(textureSample(x_20, x_10, coords12), 0.0, 0.0, 0.0); - let x_210 : f32 = textureSampleCompare(x_20, x_30, coords12, 0.200000003); + let x_200 : vec4 = vec4(textureSample(x_20, x_10, coords12), 0.0f, 0.0f, 0.0f); + let x_210 : f32 = textureSampleCompare(x_20, x_30, coords12, 0.200000003f); )"})); INSTANTIATE_TEST_SUITE_P( @@ -1847,7 +1847,7 @@ INSTANTIATE_TEST_SUITE_P( @group(2) @binding(1) var x_20 : texture_depth_2d; )", - R"(textureSampleCompare(x_20, x_10, coords12, 0.200000003))"}, + R"(textureSampleCompare(x_20, x_10, coords12, 0.200000003f))"}, // ImageSampleDrefImplicitLod - arrayed ImageAccessCase{ "%float 2D 0 1 0 1 Unknown", @@ -1856,7 +1856,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler_comparison; @group(2) @binding(1) var x_20 : texture_depth_2d_array;)", - R"(textureSampleCompare(x_20, x_10, coords123.xy, i32(round(coords123.z)), 0.200000003))"}, + R"(textureSampleCompare(x_20, x_10, coords123.xy, i32(round(coords123.z)), 0.200000003f))"}, // ImageSampleDrefImplicitLod with ConstOffset ImageAccessCase{ "%float 2D 0 0 0 1 Unknown", @@ -1866,7 +1866,7 @@ INSTANTIATE_TEST_SUITE_P( @group(2) @binding(1) var x_20 : texture_depth_2d; )", - R"(textureSampleCompare(x_20, x_10, coords12, 0.200000003, vec2(3i, 4i)))"}, + R"(textureSampleCompare(x_20, x_10, coords12, 0.200000003f, vec2(3i, 4i)))"}, // ImageSampleDrefImplicitLod arrayed with ConstOffset ImageAccessCase{ "%float 2D 0 1 0 1 Unknown", @@ -1875,7 +1875,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler_comparison; @group(2) @binding(1) var x_20 : texture_depth_2d_array;)", - R"(textureSampleCompare(x_20, x_10, coords123.xy, i32(round(coords123.z)), 0.200000003, vec2(3i, 4i)))"})); + R"(textureSampleCompare(x_20, x_10, coords123.xy, i32(round(coords123.z)), 0.200000003f, vec2(3i, 4i)))"})); INSTANTIATE_TEST_SUITE_P( ImageSampleDrefExplicitLod, @@ -1891,7 +1891,7 @@ INSTANTIATE_TEST_SUITE_P( @group(2) @binding(1) var x_20 : texture_depth_2d; )", - R"(textureSampleCompareLevel(x_20, x_10, coords12, 0.200000003))"}, + R"(textureSampleCompareLevel(x_20, x_10, coords12, 0.200000003f))"}, // 2D array ImageAccessCase{ "%float 2D 1 1 0 1 Unknown", @@ -1900,7 +1900,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler_comparison; @group(2) @binding(1) var x_20 : texture_depth_2d_array;)", - R"(textureSampleCompareLevel(x_20, x_10, coords123.xy, i32(round(coords123.z)), 0.200000003))"}, + R"(textureSampleCompareLevel(x_20, x_10, coords123.xy, i32(round(coords123.z)), 0.200000003f))"}, // 2D, ConstOffset ImageAccessCase{ "%float 2D 1 0 0 1 Unknown", @@ -1911,7 +1911,7 @@ INSTANTIATE_TEST_SUITE_P( @group(2) @binding(1) var x_20 : texture_depth_2d; )", - R"(textureSampleCompareLevel(x_20, x_10, coords12, 0.200000003, vec2(3i, 4i)))"}, + R"(textureSampleCompareLevel(x_20, x_10, coords12, 0.200000003f, vec2(3i, 4i)))"}, // 2D array, ConstOffset ImageAccessCase{ "%float 2D 1 1 0 1 Unknown", @@ -1921,7 +1921,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler_comparison; @group(2) @binding(1) var x_20 : texture_depth_2d_array;)", - R"(textureSampleCompareLevel(x_20, x_10, coords123.xy, i32(round(coords123.z)), 0.200000003, vec2(3i, 4i)))"}, + R"(textureSampleCompareLevel(x_20, x_10, coords123.xy, i32(round(coords123.z)), 0.200000003f, vec2(3i, 4i)))"}, // Cube ImageAccessCase{"%float Cube 1 0 0 1 Unknown", "%result = OpImageSampleDrefExplicitLod " @@ -1929,7 +1929,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler_comparison; @group(2) @binding(1) var x_20 : texture_depth_cube;)", - R"(textureSampleCompareLevel(x_20, x_10, coords123, 0.200000003))"}, + R"(textureSampleCompareLevel(x_20, x_10, coords123, 0.200000003f))"}, // Cube array ImageAccessCase{ "%float Cube 1 1 0 1 Unknown", @@ -1938,7 +1938,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler_comparison; @group(2) @binding(1) var x_20 : texture_depth_cube_array;)", - R"(textureSampleCompareLevel(x_20, x_10, coords1234.xyz, i32(round(coords1234.w)), 0.200000003))"})); + R"(textureSampleCompareLevel(x_20, x_10, coords1234.xyz, i32(round(coords1234.w)), 0.200000003f))"})); INSTANTIATE_TEST_SUITE_P( ImageSampleExplicitLod_UsingLod, @@ -1952,7 +1952,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler; @group(2) @binding(1) var x_20 : texture_2d;)", - R"(textureSampleLevel(x_20, x_10, coords12, 0.0))"}, + R"(textureSampleLevel(x_20, x_10, coords12, 0.0f))"}, // OpImageSampleExplicitLod arrayed - using Lod ImageAccessCase{ @@ -1962,7 +1962,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler; @group(2) @binding(1) var x_20 : texture_2d_array;)", - R"(textureSampleLevel(x_20, x_10, coords123.xy, i32(round(coords123.z)), 0.0))"}, + R"(textureSampleLevel(x_20, x_10, coords123.xy, i32(round(coords123.z)), 0.0f))"}, // OpImageSampleExplicitLod - using Lod and ConstOffset ImageAccessCase{"%float 2D 0 0 0 1 Unknown", @@ -1972,7 +1972,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler; @group(2) @binding(1) var x_20 : texture_2d;)", - R"(textureSampleLevel(x_20, x_10, coords12, 0.0, vec2(3i, 4i)))"}, + R"(textureSampleLevel(x_20, x_10, coords12, 0.0f, vec2(3i, 4i)))"}, // OpImageSampleExplicitLod - using Lod and unsigned ConstOffset // Convert the ConstOffset operand to signed @@ -1984,7 +1984,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler; @group(2) @binding(1) var x_20 : texture_2d;)", - R"(textureSampleLevel(x_20, x_10, coords12, 0.0, vec2(vec2(3u, 4u)))"}, + R"(textureSampleLevel(x_20, x_10, coords12, 0.0f, vec2(vec2(3u, 4u)))"}, // OpImageSampleExplicitLod arrayed - using Lod and ConstOffset ImageAccessCase{ @@ -1995,7 +1995,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler; @group(2) @binding(1) var x_20 : texture_2d_array;)", - R"(textureSampleLevel(x_20, x_10, coords123.xy, i32(round(coords123.z)), 0.0, vec2(3i, 4i)))"})); + R"(textureSampleLevel(x_20, x_10, coords123.xy, i32(round(coords123.z)), 0.0f, vec2(3i, 4i)))"})); INSTANTIATE_TEST_SUITE_P( ImageSampleExplicitLod_UsingGrad, @@ -2092,7 +2092,7 @@ INSTANTIATE_TEST_SUITE_P( @group(2) @binding(1) var x_20 : texture_depth_2d; )", - R"(vec4(textureSampleLevel(x_20, x_10, vf12, i32(f1)), 0.0, 0.0, 0.0))"}})); + R"(vec4(textureSampleLevel(x_20, x_10, vf12, i32(f1)), 0.0f, 0.0f, 0.0f))"}})); ///// // Projection sampling @@ -2176,7 +2176,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler; @group(2) @binding(1) var x_20 : texture_2d;)", - R"(textureSampleBias(x_20, x_10, (coords123.xy / coords123.z), 7.0))"}, + R"(textureSampleBias(x_20, x_10, (coords123.xy / coords123.z), 7.0f))"}, // OpImageSampleProjImplicitLod with Bias and signed ConstOffset ImageAccessCase{ @@ -2187,7 +2187,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler; @group(2) @binding(1) var x_20 : texture_2d;)", - R"(textureSampleBias(x_20, x_10, (coords123.xy / coords123.z), 7.0, vec2(3i, 4i)))"}, + R"(textureSampleBias(x_20, x_10, (coords123.xy / coords123.z), 7.0f, vec2(3i, 4i)))"}, // OpImageSampleProjImplicitLod with Bias and unsigned ConstOffset // Convert ConstOffset to signed @@ -2199,7 +2199,7 @@ INSTANTIATE_TEST_SUITE_P( R"(@group(0) @binding(0) var x_10 : sampler; @group(2) @binding(1) var x_20 : texture_2d;)", - R"(textureSampleBias(x_20, x_10, (coords123.xy / coords123.z), 7.0, vec2(vec2(3u, 4u))))"})); + R"(textureSampleBias(x_20, x_10, (coords123.xy / coords123.z), 7.0f, vec2(vec2(3u, 4u))))"})); INSTANTIATE_TEST_SUITE_P( ImageSampleProjExplicitLod_Lod, @@ -2266,7 +2266,7 @@ INSTANTIATE_TEST_SUITE_P( // Sampling the depth texture yields an f32, but the // SPIR-V operation yiedls vec4, so fill out the // remaining components with 0. - R"(vec4(textureSample(x_20, x_10, (coords123.xy / coords123.z)), 0.0, 0.0, 0.0))"})); + R"(vec4(textureSample(x_20, x_10, (coords123.xy / coords123.z)), 0.0f, 0.0f, 0.0f))"})); INSTANTIATE_TEST_SUITE_P( ImageSampleProjDrefImplicitLod, @@ -2311,7 +2311,7 @@ INSTANTIATE_TEST_SUITE_P( @group(2) @binding(1) var x_20 : texture_depth_2d; )", - R"(textureSampleCompare(x_20, x_10, (coords123.xy / coords123.z), 0.200000003, 0.0))"}, + R"(textureSampleCompare(x_20, x_10, (coords123.xy / coords123.z), 0.200000003f, 0.0f))"}, // OpImageSampleProjDrefImplicitLod 2D depth-texture, Lod ConstOffset ImageAccessCase{ @@ -2323,7 +2323,7 @@ INSTANTIATE_TEST_SUITE_P( @group(2) @binding(1) var x_20 : texture_depth_2d; )", - R"(textureSampleCompareLevel(x_20, x_10, (coords123.xy / coords123.z), 0.200000003, 0.0, vec2(3i, 4i)))"})); + R"(textureSampleCompareLevel(x_20, x_10, (coords123.xy / coords123.z), 0.200000003f, 0.0f, vec2(3i, 4i)))"})); ///// // End projection sampling @@ -2416,15 +2416,15 @@ INSTANTIATE_TEST_SUITE_P( // Source 1 component {"%float 2D 0 0 0 2 R32f", "OpImageWrite %im %vi12 %f1", R"(@group(2) @binding(1) var x_20 : texture_storage_2d;)", - "textureStore(x_20, vi12, vec4(f1, 0.0, 0.0, 0.0));"}, + "textureStore(x_20, vi12, vec4(f1, 0.0f, 0.0f, 0.0f));"}, // Source 2 component, dest 1 component {"%float 2D 0 0 0 2 R32f", "OpImageWrite %im %vi12 %vf12", R"(@group(2) @binding(1) var x_20 : texture_storage_2d;)", - "textureStore(x_20, vi12, vec4(vf12, 0.0, 0.0));"}, + "textureStore(x_20, vi12, vec4(vf12, 0.0f, 0.0f));"}, // Source 3 component, dest 1 component {"%float 2D 0 0 0 2 R32f", "OpImageWrite %im %vi12 %vf123", R"(@group(2) @binding(1) var x_20 : texture_storage_2d;)", - "textureStore(x_20, vi12, vec4(vf123, 0.0));"}, + "textureStore(x_20, vi12, vec4(vf123, 0.0f));"}, // Source 4 component, dest 1 component {"%float 2D 0 0 0 2 R32f", "OpImageWrite %im %vi12 %vf1234", R"(@group(2) @binding(1) var x_20 : texture_storage_2d;)", @@ -2432,11 +2432,11 @@ INSTANTIATE_TEST_SUITE_P( // Source 2 component, dest 2 component {"%float 2D 0 0 0 2 Rg32f", "OpImageWrite %im %vi12 %vf12", R"(@group(2) @binding(1) var x_20 : texture_storage_2d;)", - "textureStore(x_20, vi12, vec4(vf12, 0.0, 0.0));"}, + "textureStore(x_20, vi12, vec4(vf12, 0.0f, 0.0f));"}, // Source 3 component, dest 2 component {"%float 2D 0 0 0 2 Rg32f", "OpImageWrite %im %vi12 %vf123", R"(@group(2) @binding(1) var x_20 : texture_storage_2d;)", - "textureStore(x_20, vi12, vec4(vf123, 0.0));"}, + "textureStore(x_20, vi12, vec4(vf123, 0.0f));"}, // Source 4 component, dest 2 component {"%float 2D 0 0 0 2 Rg32f", "OpImageWrite %im %vi12 %vf1234", R"(@group(2) @binding(1) var x_20 : texture_storage_2d;)", @@ -2583,11 +2583,11 @@ INSTANTIATE_TEST_SUITE_P( // Level of detail is injected for depth texture {"%float 2D 1 0 0 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12", R"(@group(2) @binding(1) var x_20 : texture_depth_2d;)", - R"(let x_99 : vec4 = vec4(textureLoad(x_20, vi12, 0i), 0.0, 0.0, 0.0);)"}, + R"(let x_99 : vec4 = vec4(textureLoad(x_20, vi12, 0i), 0.0f, 0.0f, 0.0f);)"}, // OpImageFetch with extra params, on depth texture {"%float 2D 1 0 0 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12 Lod %int_3", R"(@group(2) @binding(1) var x_20 : texture_depth_2d;)", - R"(let x_99 : vec4 = vec4(textureLoad(x_20, vi12, 3i), 0.0, 0.0, 0.0);)"}})); + R"(let x_99 : vec4 = vec4(textureLoad(x_20, vi12, 3i), 0.0f, 0.0f, 0.0f);)"}})); INSTANTIATE_TEST_SUITE_P( ImageFetch_Depth, @@ -2600,7 +2600,7 @@ INSTANTIATE_TEST_SUITE_P( // ImageFetch on depth image. {"%float 2D 1 0 0 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12 ", R"(@group(2) @binding(1) var x_20 : texture_depth_2d;)", - R"(let x_99 : vec4 = vec4(textureLoad(x_20, vi12, 0i), 0.0, 0.0, 0.0);)"}})); + R"(let x_99 : vec4 = vec4(textureLoad(x_20, vi12, 0i), 0.0f, 0.0f, 0.0f);)"}})); INSTANTIATE_TEST_SUITE_P( ImageFetch_DepthMultisampled, @@ -2613,7 +2613,7 @@ INSTANTIATE_TEST_SUITE_P( // ImageFetch on multisampled depth image. {"%float 2D 1 0 1 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12 Sample %i1", R"(@group(2) @binding(1) var x_20 : texture_depth_multisampled_2d;)", - R"(let x_99 : vec4 = vec4(textureLoad(x_20, vi12, i1), 0.0, 0.0, 0.0);)"}})); + R"(let x_99 : vec4 = vec4(textureLoad(x_20, vi12, i1), 0.0f, 0.0f, 0.0f);)"}})); INSTANTIATE_TEST_SUITE_P(ImageFetch_Multisampled, SpvParserHandleTest_ImageAccessTest, diff --git a/src/tint/reader/spirv/parser_impl_module_var_test.cc b/src/tint/reader/spirv/parser_impl_module_var_test.cc index 8ef704e4d7..622d383a44 100644 --- a/src/tint/reader/spirv/parser_impl_module_var_test.cc +++ b/src/tint/reader/spirv/parser_impl_module_var_test.cc @@ -408,7 +408,7 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPosition_StorePositionMember_OneAcces EXPECT_TRUE(p->BuildAndParseInternalModule()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("gl_Position.y = 0.0;")) << module_str; + EXPECT_THAT(module_str, HasSubstr("gl_Position.y = 0.0f;")) << module_str; } TEST_F(SpvModuleScopeVarParserTest, BuiltinPosition_StorePositionMember_TwoAccessChain) { @@ -430,7 +430,7 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPosition_StorePositionMember_TwoAcces EXPECT_TRUE(p->BuildAndParseInternalModule()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("gl_Position.y = 0.0;")) << module_str; + EXPECT_THAT(module_str, HasSubstr("gl_Position.y = 0.0f;")) << module_str; } TEST_F(SpvModuleScopeVarParserTest, BuiltinPointSize_Write1_IsErased) { @@ -510,7 +510,7 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPointSize_ReadReplaced) { var gl_Position : vec4; fn main_1() { - x_900 = 1.0; + x_900 = 1.0f; return; } @@ -681,7 +681,7 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPointSize_Loose_ReadReplaced_Vertex) var x_900 : f32; fn main_1() { - x_900 = 1.0; + x_900 = 1.0f; return; } @@ -889,7 +889,7 @@ var x_3 : i32 = -1i; var x_4 : u32 = 1u; -var x_5 : f32 = 1.5; +var x_5 : f32 = 1.5f; )")); } @@ -914,7 +914,7 @@ var x_2 : i32 = 0i; var x_3 : u32 = 0u; -var x_4 : f32 = 0.0; +var x_4 : f32 = 0.0f; )")); } @@ -939,7 +939,7 @@ var x_2 : i32 = 0i; var x_3 : u32 = 0u; -var x_4 : f32 = 0.0; +var x_4 : f32 = 0.0f; )")); // This example module emits ok, but is not valid SPIR-V in the first place. @@ -956,7 +956,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : vec2 = vec2(1.5, 2.0);")); + EXPECT_THAT(module_str, HasSubstr("var x_200 : vec2 = vec2(1.5f, 2.0f);")); } TEST_F(SpvModuleScopeVarParserTest, VectorBoolNullInitializer) { @@ -1083,9 +1083,9 @@ TEST_F(SpvModuleScopeVarParserTest, MatrixInitializer) { EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); EXPECT_THAT(module_str, HasSubstr("var x_200 : mat3x2 = mat3x2(" - "vec2(1.5, 2.0), " - "vec2(2.0, 3.0), " - "vec2(3.0, 4.0));")); + "vec2(1.5f, 2.0f), " + "vec2(2.0f, 3.0f), " + "vec2(3.0f, 4.0f));")); } TEST_F(SpvModuleScopeVarParserTest, MatrixNullInitializer) { @@ -1168,7 +1168,7 @@ TEST_F(SpvModuleScopeVarParserTest, StructInitializer) { EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); EXPECT_THAT(module_str, - HasSubstr("var x_200 : S = S(1u, 1.5, array(1u, 2u));")) + HasSubstr("var x_200 : S = S(1u, 1.5f, array(1u, 2u));")) << module_str; } @@ -1181,7 +1181,7 @@ TEST_F(SpvModuleScopeVarParserTest, StructNullInitializer) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << p->error(); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : S = S(0u, 0.0, array());")) + EXPECT_THAT(module_str, HasSubstr("var x_200 : S = S(0u, 0.0f, array());")) << module_str; } @@ -1195,7 +1195,7 @@ TEST_F(SpvModuleScopeVarParserTest, StructUndefInitializer) { EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("var x_200 : S = S(0u, 0.0, array());")) + EXPECT_THAT(module_str, HasSubstr("var x_200 : S = S(0u, 0.0f, array());")) << module_str; // This example module emits ok, but is not valid SPIR-V in the first place. @@ -1565,7 +1565,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarSpecConstant_DeclareConst_F32) { ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << p->error(); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("@id(12) override myconst : f32 = 2.5;")) << module_str; + EXPECT_THAT(module_str, HasSubstr("@id(12) override myconst : f32 = 2.5f;")) << module_str; } TEST_F(SpvModuleScopeVarParserTest, ScalarSpecConstant_DeclareConst_F32_WithoutSpecId) { @@ -1580,7 +1580,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarSpecConstant_DeclareConst_F32_WithoutS ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << p->error(); EXPECT_TRUE(p->error().empty()); const auto module_str = test::ToString(p->program()); - EXPECT_THAT(module_str, HasSubstr("override myconst : f32 = 2.5;")) << module_str; + EXPECT_THAT(module_str, HasSubstr("override myconst : f32 = 2.5f;")) << module_str; } TEST_F(SpvModuleScopeVarParserTest, ScalarSpecConstant_UsedInFunction) { @@ -3854,7 +3854,7 @@ TEST_F(SpvModuleScopeVarParserTest, EntryPointWrapping_BuiltinVar_FragDepth_Out_ ASSERT_TRUE(p->Parse()) << p->error() << assembly; EXPECT_TRUE(p->error().empty()); const auto got = test::ToString(p->program()); - const std::string expected = R"(var x_1 : f32 = 0.0; + const std::string expected = R"(var x_1 : f32 = 0.0f; fn main_1() { return; @@ -3957,7 +3957,7 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPosition_BuiltIn_Position_Initializer const auto got = test::ToString(p->program()); const std::string expected = - R"(var gl_Position : vec4 = vec4(1.0, 2.0, 3.0, 4.0); + R"(var gl_Position : vec4 = vec4(1.0f, 2.0f, 3.0f, 4.0f); fn main_1() { return; diff --git a/src/tint/transform/canonicalize_entry_point_io_test.cc b/src/tint/transform/canonicalize_entry_point_io_test.cc index d3fe95af2d..68ccb8b7d5 100644 --- a/src/tint/transform/canonicalize_entry_point_io_test.cc +++ b/src/tint/transform/canonicalize_entry_point_io_test.cc @@ -3173,7 +3173,7 @@ fn vert_main_inner() -> vec4 { fn vert_main() { let inner_result = vert_main_inner(); value = inner_result; - vertex_point_size = 1.0; + vertex_point_size = 1.0f; } )"; @@ -3210,7 +3210,7 @@ fn vert_main() -> tint_symbol { let inner_result = vert_main_inner(); var wrapper_result : tint_symbol; wrapper_result.value = inner_result; - wrapper_result.vertex_point_size = 1.0; + wrapper_result.vertex_point_size = 1.0f; return wrapper_result; } )"; @@ -3252,7 +3252,7 @@ fn vert_main_inner() -> VertOut { fn vert_main() { let inner_result = vert_main_inner(); pos_1 = inner_result.pos; - vertex_point_size = 1.0; + vertex_point_size = 1.0f; } )"; @@ -3289,7 +3289,7 @@ fn vert_main_inner() -> VertOut { fn vert_main() { let inner_result = vert_main_inner(); pos_1 = inner_result.pos; - vertex_point_size = 1.0; + vertex_point_size = 1.0f; } struct VertOut { @@ -3338,7 +3338,7 @@ fn vert_main() -> tint_symbol { let inner_result = vert_main_inner(); var wrapper_result : tint_symbol; wrapper_result.pos = inner_result.pos; - wrapper_result.vertex_point_size = 1.0; + wrapper_result.vertex_point_size = 1.0f; return wrapper_result; } )"; @@ -3380,7 +3380,7 @@ fn vert_main() -> tint_symbol { let inner_result = vert_main_inner(); var wrapper_result : tint_symbol; wrapper_result.pos = inner_result.pos; - wrapper_result.vertex_point_size = 1.0; + wrapper_result.vertex_point_size = 1.0f; return wrapper_result; } @@ -3463,7 +3463,7 @@ fn vert_main() { let inner_result = vert_main_inner(VertIn1(collide_2), VertIn2(collide_3)); vertex_point_size_3 = inner_result.vertex_point_size; vertex_point_size_1_1 = inner_result.vertex_point_size_1; - vertex_point_size_4 = 1.0; + vertex_point_size_4 = 1.0f; } )"; @@ -3522,7 +3522,7 @@ fn vert_main() { let inner_result = vert_main_inner(VertIn1(collide_2), VertIn2(collide_3)); vertex_point_size_3 = inner_result.vertex_point_size; vertex_point_size_1_1 = inner_result.vertex_point_size_1; - vertex_point_size_4 = 1.0; + vertex_point_size_4 = 1.0f; } struct VertIn1 { @@ -3616,7 +3616,7 @@ fn vert_main(tint_symbol : tint_symbol_1) -> tint_symbol_2 { var wrapper_result : tint_symbol_2; wrapper_result.vertex_point_size = inner_result.vertex_point_size; wrapper_result.vertex_point_size_1 = inner_result.vertex_point_size_1; - wrapper_result.vertex_point_size_2 = 1.0; + wrapper_result.vertex_point_size_2 = 1.0f; return wrapper_result; } )"; @@ -3679,7 +3679,7 @@ fn vert_main(tint_symbol : tint_symbol_1) -> tint_symbol_2 { var wrapper_result : tint_symbol_2; wrapper_result.vertex_point_size = inner_result.vertex_point_size; wrapper_result.vertex_point_size_1 = inner_result.vertex_point_size_1; - wrapper_result.vertex_point_size_2 = 1.0; + wrapper_result.vertex_point_size_2 = 1.0f; return wrapper_result; } @@ -3768,7 +3768,7 @@ fn vert_main(tint_symbol : tint_symbol_1) -> tint_symbol_2 { var wrapper_result : tint_symbol_2; wrapper_result.vertex_point_size = inner_result.vertex_point_size; wrapper_result.vertex_point_size_1 = inner_result.vertex_point_size_1; - wrapper_result.vertex_point_size_2 = 1.0; + wrapper_result.vertex_point_size_2 = 1.0f; return wrapper_result; } )"; @@ -3831,7 +3831,7 @@ fn vert_main(tint_symbol : tint_symbol_1) -> tint_symbol_2 { var wrapper_result : tint_symbol_2; wrapper_result.vertex_point_size = inner_result.vertex_point_size; wrapper_result.vertex_point_size_1 = inner_result.vertex_point_size_1; - wrapper_result.vertex_point_size_2 = 1.0; + wrapper_result.vertex_point_size_2 = 1.0f; return wrapper_result; } @@ -3953,7 +3953,7 @@ fn main() { let inner_result = vertex_main(bitcast(gl_VertexID), bitcast(gl_InstanceID)); gl_Position = inner_result; gl_Position.y = -(gl_Position.y); - gl_Position.z = ((2.0 * gl_Position.z) - gl_Position.w); + gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w); } )"; diff --git a/src/tint/transform/combine_samplers_test.cc b/src/tint/transform/combine_samplers_test.cc index 1d84859faa..cad310959e 100644 --- a/src/tint/transform/combine_samplers_test.cc +++ b/src/tint/transform/combine_samplers_test.cc @@ -872,7 +872,7 @@ fn main() -> vec4 { @group(0) @binding(0) @internal(disable_validation__binding_point_collision) var placeholder_comparison_sampler : sampler_comparison; fn f(t_s : texture_depth_2d, coords : vec2) -> f32 { - return textureSampleCompare(t_s, placeholder_comparison_sampler, coords, 5.0); + return textureSampleCompare(t_s, placeholder_comparison_sampler, coords, 5.0f); } @group(0) @binding(0) @internal(disable_validation__binding_point_collision) var tex_samp : texture_depth_2d; @@ -912,7 +912,7 @@ fn main() -> vec4 { @group(0) @binding(0) @internal(disable_validation__binding_point_collision) var placeholder_comparison_sampler : sampler_comparison; fn f(t_s : texture_depth_2d, coords : vec2) -> f32 { - return textureSampleCompare(t_s, placeholder_comparison_sampler, coords, 5.0); + return textureSampleCompare(t_s, placeholder_comparison_sampler, coords, 5.0f); } )"; diff --git a/src/tint/transform/decompose_strided_array_test.cc b/src/tint/transform/decompose_strided_array_test.cc index 53b335e118..e911df34f8 100644 --- a/src/tint/transform/decompose_strided_array_test.cc +++ b/src/tint/transform/decompose_strided_array_test.cc @@ -374,8 +374,8 @@ struct S { @stage(compute) @workgroup_size(1i) fn f() { s.a = array(); - s.a = array(strided_arr(1.0), strided_arr(2.0), strided_arr(3.0), strided_arr(4.0)); - s.a[1i].el = 5.0; + s.a = array(strided_arr(1.0f), strided_arr(2.0f), strided_arr(3.0f), strided_arr(4.0f)); + s.a[1i].el = 5.0f; } )"; @@ -423,8 +423,8 @@ struct S { @stage(compute) @workgroup_size(1i) fn f() { s.a = array(); - s.a = array(1.0, 2.0, 3.0, 4.0); - s.a[1i] = 5.0; + s.a = array(1.0f, 2.0f, 3.0f, 4.0f); + s.a[1i] = 5.0f; } )"; @@ -483,8 +483,8 @@ struct S { fn f() { let c = s.a; let d = s.a[1i].el; - s.a = array(strided_arr(1.0), strided_arr(2.0), strided_arr(3.0), strided_arr(4.0)); - s.a[1i].el = 5.0; + s.a = array(strided_arr(1.0f), strided_arr(2.0f), strided_arr(3.0f), strided_arr(4.0f)); + s.a[1i].el = 5.0f; } )"; @@ -546,8 +546,8 @@ fn f() { let a : ARR = s.a; let b : f32 = s.a[1i].el; s.a = ARR(); - s.a = ARR(strided_arr(1.0), strided_arr(2.0), strided_arr(3.0), strided_arr(4.0)); - s.a[1i].el = 5.0; + s.a = ARR(strided_arr(1.0f), strided_arr(2.0f), strided_arr(3.0f), strided_arr(4.0f)); + s.a[1i].el = 5.0f; } )"; @@ -648,7 +648,7 @@ fn f() { let c : ARR_A = s.a[3i].el[2i]; let d : f32 = s.a[3i].el[2i][1i].el; s.a = ARR_B(); - s.a[3i].el[2i][1i].el = 5.0; + s.a[3i].el[2i][1i].el = 5.0f; } )"; diff --git a/src/tint/transform/decompose_strided_matrix_test.cc b/src/tint/transform/decompose_strided_matrix_test.cc index 803ae73aae..2367cf1873 100644 --- a/src/tint/transform/decompose_strided_matrix_test.cc +++ b/src/tint/transform/decompose_strided_matrix_test.cc @@ -376,7 +376,7 @@ fn mat2x2_stride_32_to_arr(m : mat2x2) -> @stride(32) array, 2u> @stage(compute) @workgroup_size(1i) fn f() { - s.m = mat2x2_stride_32_to_arr(mat2x2(vec2(1.0, 2.0), vec2(3.0, 4.0))); + s.m = mat2x2_stride_32_to_arr(mat2x2(vec2(1.0f, 2.0f), vec2(3.0f, 4.0f))); } )"; @@ -429,7 +429,7 @@ struct S { @stage(compute) @workgroup_size(1i) fn f() { - s.m[1i] = vec2(1.0, 2.0); + s.m[1i] = vec2(1.0f, 2.0f); } )"; @@ -505,8 +505,8 @@ fn f() { let x = arr_to_mat2x2_stride_32(s.m); let y = s.m[1i]; let z = x[1i]; - s.m = mat2x2_stride_32_to_arr(mat2x2(vec2(1.0, 2.0), vec2(3.0, 4.0))); - s.m[1i] = vec2(5.0, 6.0); + s.m = mat2x2_stride_32_to_arr(mat2x2(vec2(1.0f, 2.0f), vec2(3.0f, 4.0f))); + s.m[1i] = vec2(5.0f, 6.0f); } )"; @@ -613,7 +613,7 @@ var s : S; @stage(compute) @workgroup_size(1i) fn f() { - s.m = mat2x2(vec2(1.0, 2.0), vec2(3.0, 4.0)); + s.m = mat2x2(vec2(1.0f, 2.0f), vec2(3.0f, 4.0f)); } )"; diff --git a/src/tint/transform/fold_constants_test.cc b/src/tint/transform/fold_constants_test.cc index f27ede61f8..54bb2e38a3 100644 --- a/src/tint/transform/fold_constants_test.cc +++ b/src/tint/transform/fold_constants_test.cc @@ -41,7 +41,7 @@ var a : i32 = 123i; var b : u32 = 123u; -var c : f32 = 123.0; +var c : f32 = 123.0f; var d : bool = true; @@ -70,7 +70,7 @@ var a : i32 = 123i; var b : u32 = 123u; -var c : f32 = 123.0; +var c : f32 = 123.0f; var d : bool = true; @@ -99,7 +99,7 @@ var a : i32 = 123i; var b : u32 = 123u; -var c : f32 = 123.0; +var c : f32 = 123.0f; var d : bool = true; @@ -128,7 +128,7 @@ var a : vec3 = vec3(123i); var b : vec3 = vec3(123u); -var c : vec3 = vec3(123.0); +var c : vec3 = vec3(123.0f); var d : vec3 = vec3(true); @@ -157,7 +157,7 @@ var a : vec3 = vec3(123i); var b : vec3 = vec3(123u); -var c : vec3 = vec3(123.0); +var c : vec3 = vec3(123.0f); var d : vec3 = vec3(true); @@ -186,7 +186,7 @@ var a : vec3 = vec3(123i); var b : vec3 = vec3(123u); -var c : vec3 = vec3(123.0); +var c : vec3 = vec3(123.0f); var d : vec3 = vec3(true); @@ -245,7 +245,7 @@ fn f() { fn f() { var a : i32 = 123i; var b : u32 = 123u; - var c : f32 = 123.0; + var c : f32 = 123.0f; var d : bool = true; } )"; @@ -269,7 +269,7 @@ fn f() { fn f() { var a : i32 = 123i; var b : u32 = 123u; - var c : f32 = 123.0; + var c : f32 = 123.0f; var d : bool = true; } )"; @@ -293,7 +293,7 @@ fn f() { fn f() { var a : i32 = 123i; var b : u32 = 123u; - var c : f32 = 123.0; + var c : f32 = 123.0f; var d : bool = true; } )"; @@ -308,7 +308,7 @@ TEST_F(FoldConstantsTest, Function_Vector_NoConversion) { fn f() { var a : vec3 = vec3(123i); var b : vec3 = vec3(123u); - var c : vec3 = vec3(123.0); + var c : vec3 = vec3(123.0f); var d : vec3 = vec3(true); } )"; @@ -317,7 +317,7 @@ fn f() { fn f() { var a : vec3 = vec3(123i); var b : vec3 = vec3(123u); - var c : vec3 = vec3(123.0); + var c : vec3 = vec3(123.0f); var d : vec3 = vec3(true); } )"; @@ -341,7 +341,7 @@ fn f() { fn f() { var a : vec3 = vec3(123i); var b : vec3 = vec3(123u); - var c : vec3 = vec3(123.0); + var c : vec3 = vec3(123.0f); var d : vec3 = vec3(true); } )"; @@ -365,7 +365,7 @@ fn f() { fn f() { var a : vec3 = vec3(123i); var b : vec3 = vec3(123u); - var c : vec3 = vec3(123.0); + var c : vec3 = vec3(123.0f); var d : vec3 = vec3(true); } )"; @@ -412,7 +412,7 @@ fn f() { auto* expect = R"( fn f() { var a : f32 = f32(); - var b : vec2 = vec2(1.0, a); + var b : vec2 = vec2(1.0f, a); } )"; diff --git a/src/tint/transform/multiplanar_external_texture_test.cc b/src/tint/transform/multiplanar_external_texture_test.cc index 171df8dac9..39c4602259 100644 --- a/src/tint/transform/multiplanar_external_texture_test.cc +++ b/src/tint/transform/multiplanar_external_texture_test.cc @@ -249,14 +249,14 @@ fn gammaCorrection(v : vec3, params : GammaTransferParams) -> vec3 { fn textureSampleExternal(plane0 : texture_2d, plane1 : texture_2d, smp : sampler, coord : vec2, params : ExternalTextureParams) -> vec4 { var color : vec3; if ((params.numPlanes == 1u)) { - color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; + color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb; } else { - color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0f).r, textureSampleLevel(plane1, smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } @stage(fragment) @@ -318,14 +318,14 @@ fn gammaCorrection(v : vec3, params : GammaTransferParams) -> vec3 { fn textureSampleExternal(plane0 : texture_2d, plane1 : texture_2d, smp : sampler, coord : vec2, params : ExternalTextureParams) -> vec4 { var color : vec3; if ((params.numPlanes == 1u)) { - color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; + color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb; } else { - color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0f).r, textureSampleLevel(plane1, smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } @stage(fragment) @@ -394,12 +394,12 @@ fn textureLoadExternal(plane0 : texture_2d, plane1 : texture_2d, coord if ((params.numPlanes == 1u)) { color = textureLoad(plane0, coord, 0i).rgb; } else { - color = (vec4(textureLoad(plane0, coord, 0i).r, textureLoad(plane1, coord, 0i).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureLoad(plane0, coord, 0i).r, textureLoad(plane1, coord, 0i).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } @stage(fragment) @@ -462,12 +462,12 @@ fn textureLoadExternal(plane0 : texture_2d, plane1 : texture_2d, coord if ((params.numPlanes == 1u)) { color = textureLoad(plane0, coord, 0i).rgb; } else { - color = (vec4(textureLoad(plane0, coord, 0i).r, textureLoad(plane1, coord, 0i).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureLoad(plane0, coord, 0i).r, textureLoad(plane1, coord, 0i).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } @stage(fragment) @@ -536,14 +536,14 @@ fn gammaCorrection(v : vec3, params : GammaTransferParams) -> vec3 { fn textureSampleExternal(plane0 : texture_2d, plane1 : texture_2d, smp : sampler, coord : vec2, params : ExternalTextureParams) -> vec4 { var color : vec3; if ((params.numPlanes == 1u)) { - color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; + color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb; } else { - color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0f).r, textureSampleLevel(plane1, smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } fn textureLoadExternal(plane0 : texture_2d, plane1 : texture_2d, coord : vec2, params : ExternalTextureParams) -> vec4 { @@ -551,12 +551,12 @@ fn textureLoadExternal(plane0 : texture_2d, plane1 : texture_2d, coord if ((params.numPlanes == 1u)) { color = textureLoad(plane0, coord, 0i).rgb; } else { - color = (vec4(textureLoad(plane0, coord, 0i).r, textureLoad(plane1, coord, 0i).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureLoad(plane0, coord, 0i).r, textureLoad(plane1, coord, 0i).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } @stage(fragment) @@ -619,14 +619,14 @@ fn gammaCorrection(v : vec3, params : GammaTransferParams) -> vec3 { fn textureSampleExternal(plane0 : texture_2d, plane1 : texture_2d, smp : sampler, coord : vec2, params : ExternalTextureParams) -> vec4 { var color : vec3; if ((params.numPlanes == 1u)) { - color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; + color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb; } else { - color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0f).r, textureSampleLevel(plane1, smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } fn textureLoadExternal(plane0 : texture_2d, plane1 : texture_2d, coord : vec2, params : ExternalTextureParams) -> vec4 { @@ -634,12 +634,12 @@ fn textureLoadExternal(plane0 : texture_2d, plane1 : texture_2d, coord if ((params.numPlanes == 1u)) { color = textureLoad(plane0, coord, 0i).rgb; } else { - color = (vec4(textureLoad(plane0, coord, 0i).r, textureLoad(plane1, coord, 0i).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureLoad(plane0, coord, 0i).r, textureLoad(plane1, coord, 0i).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } @stage(fragment) @@ -730,14 +730,14 @@ fn gammaCorrection(v : vec3, params : GammaTransferParams) -> vec3 { fn textureSampleExternal(plane0 : texture_2d, plane1 : texture_2d, smp : sampler, coord : vec2, params : ExternalTextureParams) -> vec4 { var color : vec3; if ((params.numPlanes == 1u)) { - color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; + color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb; } else { - color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0f).r, textureSampleLevel(plane1, smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } @stage(fragment) @@ -808,14 +808,14 @@ fn gammaCorrection(v : vec3, params : GammaTransferParams) -> vec3 { fn textureSampleExternal(plane0 : texture_2d, plane1 : texture_2d, smp : sampler, coord : vec2, params : ExternalTextureParams) -> vec4 { var color : vec3; if ((params.numPlanes == 1u)) { - color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; + color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb; } else { - color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0f).r, textureSampleLevel(plane1, smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } fn f(t : texture_2d, ext_tex_plane_1_1 : texture_2d, ext_tex_params_1 : ExternalTextureParams, s : sampler) { @@ -895,14 +895,14 @@ fn gammaCorrection(v : vec3, params : GammaTransferParams) -> vec3 { fn textureSampleExternal(plane0 : texture_2d, plane1 : texture_2d, smp : sampler, coord : vec2, params : ExternalTextureParams) -> vec4 { var color : vec3; if ((params.numPlanes == 1u)) { - color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; + color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb; } else { - color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0f).r, textureSampleLevel(plane1, smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } fn f(t : texture_2d, ext_tex_plane_1_1 : texture_2d, ext_tex_params_1 : ExternalTextureParams, s : sampler) { @@ -972,14 +972,14 @@ fn gammaCorrection(v : vec3, params : GammaTransferParams) -> vec3 { fn textureSampleExternal(plane0 : texture_2d, plane1 : texture_2d, smp : sampler, coord : vec2, params : ExternalTextureParams) -> vec4 { var color : vec3; if ((params.numPlanes == 1u)) { - color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; + color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb; } else { - color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0f).r, textureSampleLevel(plane1, smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } fn f(s : sampler, t : texture_2d, ext_tex_plane_1_1 : texture_2d, ext_tex_params_1 : ExternalTextureParams) { @@ -1060,14 +1060,14 @@ fn gammaCorrection(v : vec3, params : GammaTransferParams) -> vec3 { fn textureSampleExternal(plane0 : texture_2d, plane1 : texture_2d, smp : sampler, coord : vec2, params : ExternalTextureParams) -> vec4 { var color : vec3; if ((params.numPlanes == 1u)) { - color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; + color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb; } else { - color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0f).r, textureSampleLevel(plane1, smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } fn f(t : texture_2d, ext_tex_plane_1_2 : texture_2d, ext_tex_params_2 : ExternalTextureParams, s : sampler, t2 : texture_2d, ext_tex_plane_1_3 : texture_2d, ext_tex_params_3 : ExternalTextureParams) { @@ -1158,14 +1158,14 @@ fn gammaCorrection(v : vec3, params : GammaTransferParams) -> vec3 { fn textureSampleExternal(plane0 : texture_2d, plane1 : texture_2d, smp : sampler, coord : vec2, params : ExternalTextureParams) -> vec4 { var color : vec3; if ((params.numPlanes == 1u)) { - color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; + color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb; } else { - color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0f).r, textureSampleLevel(plane1, smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } fn f(t : texture_2d, ext_tex_plane_1_2 : texture_2d, ext_tex_params_2 : ExternalTextureParams, s : sampler, t2 : texture_2d, ext_tex_plane_1_3 : texture_2d, ext_tex_params_3 : ExternalTextureParams) { @@ -1243,14 +1243,14 @@ fn gammaCorrection(v : vec3, params : GammaTransferParams) -> vec3 { fn textureSampleExternal(plane0 : texture_2d, plane1 : texture_2d, smp : sampler, coord : vec2, params : ExternalTextureParams) -> vec4 { var color : vec3; if ((params.numPlanes == 1u)) { - color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; + color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb; } else { - color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0f).r, textureSampleLevel(plane1, smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } fn nested(t : texture_2d, ext_tex_plane_1_1 : texture_2d, ext_tex_params_1 : ExternalTextureParams, s : sampler) { @@ -1333,14 +1333,14 @@ fn gammaCorrection(v : vec3, params : GammaTransferParams) -> vec3 { fn textureSampleExternal(plane0 : texture_2d, plane1 : texture_2d, smp : sampler, coord : vec2, params : ExternalTextureParams) -> vec4 { var color : vec3; if ((params.numPlanes == 1u)) { - color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; + color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb; } else { - color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0f).r, textureSampleLevel(plane1, smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } fn nested(t : texture_2d, ext_tex_plane_1_1 : texture_2d, ext_tex_params_1 : ExternalTextureParams, s : sampler) { @@ -1463,14 +1463,14 @@ fn gammaCorrection(v : vec3, params : GammaTransferParams) -> vec3 { fn textureSampleExternal(plane0 : texture_2d, plane1 : texture_2d, smp : sampler, coord : vec2, params : ExternalTextureParams) -> vec4 { var color : vec3; if ((params.numPlanes == 1u)) { - color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; + color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb; } else { - color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0f).r, textureSampleLevel(plane1, smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } fn f(t : texture_2d, ext_tex_plane_1_1 : texture_2d, ext_tex_params_1 : ExternalTextureParams, s : sampler) { @@ -1551,14 +1551,14 @@ fn gammaCorrection(v : vec3, params : GammaTransferParams) -> vec3 { fn textureSampleExternal(plane0 : texture_2d, plane1 : texture_2d, smp : sampler, coord : vec2, params : ExternalTextureParams) -> vec4 { var color : vec3; if ((params.numPlanes == 1u)) { - color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; + color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb; } else { - color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix); + color = (vec4(textureSampleLevel(plane0, smp, coord, 0.0f).r, textureSampleLevel(plane1, smp, coord, 0.0f).rg, 1.0f) * params.yuvToRgbConversionMatrix); } color = gammaCorrection(color, params.gammaDecodeParams); color = (params.gamutConversionMatrix * color); color = gammaCorrection(color, params.gammaEncodeParams); - return vec4(color, 1.0); + return vec4(color, 1.0f); } fn f(t : texture_2d, ext_tex_plane_1_1 : texture_2d, ext_tex_params_1 : ExternalTextureParams, s : sampler) { diff --git a/src/tint/transform/vertex_pulling_test.cc b/src/tint/transform/vertex_pulling_test.cc index 80768a76a3..ef37631adc 100644 --- a/src/tint/transform/vertex_pulling_test.cc +++ b/src/tint/transform/vertex_pulling_test.cc @@ -1172,22 +1172,22 @@ fn main(@builtin(vertex_index) tint_pulling_vertex_index : u32) -> @builtin(posi uint8x4 = (((vec4(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]) << vec4(24u, 16u, 8u, 0u)) >> vec4(24u))).xy; sint8x2 = (((vec2(bitcast((tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)] << 16u))) << vec2(8u, 0u)) >> vec2(24u))).x; sint8x4 = (((vec4(bitcast(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)])) << vec4(24u, 16u, 8u, 0u)) >> vec4(24u))).xy; - unorm8x2 = vec4(unpack4x8unorm((tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)] & 65535u)).xy, 0.0, 1.0); + unorm8x2 = vec4(unpack4x8unorm((tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)] & 65535u)).xy, 0.0f, 1.0f); unorm8x4 = unpack4x8unorm(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]).x; - snorm8x2 = vec3(unpack4x8snorm((tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)] & 65535u)).xy, 0.0); + snorm8x2 = vec3(unpack4x8snorm((tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)] & 65535u)).xy, 0.0f); snorm8x4 = unpack4x8snorm(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]).x; uint16x2 = vec3(((vec2(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]) << vec2(16u, 0u)) >> vec2(16u)), 0u); uint16x4 = (((vec2(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)], tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 17u)]).xxyy << vec4(16u, 0u, 16u, 0u)) >> vec4(16u))).xy; sint16x2 = vec4(((vec2(bitcast(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)])) << vec2(16u, 0u)) >> vec2(16u)), 0i, 1i); sint16x4 = (((vec2(bitcast(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), bitcast(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 17u)])).xxyy << vec4(16u, 0u, 16u, 0u)) >> vec4(16u))).x; - unorm16x2 = vec3(unpack2x16unorm(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), 0.0); + unorm16x2 = vec3(unpack2x16unorm(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), 0.0f); unorm16x4 = vec4(unpack2x16unorm(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), unpack2x16unorm(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 17u)])).x; - snorm16x2 = vec4(unpack2x16snorm(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), 0.0, 1.0); + snorm16x2 = vec4(unpack2x16snorm(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), 0.0f, 1.0f); snorm16x4 = vec4(unpack2x16snorm(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), unpack2x16snorm(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 17u)])).xyz; - float16x2 = vec4(unpack2x16float(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), 0.0, 1.0); + float16x2 = vec4(unpack2x16float(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), 0.0f, 1.0f); float16x4 = vec4(unpack2x16float(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), unpack2x16float(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 17u)])).x; - float32 = vec4(bitcast(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), 0.0, 0.0, 1.0); - float32x2 = vec4(vec2(bitcast(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), bitcast(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 17u)])), 0.0, 1.0); + float32 = vec4(bitcast(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), 0.0f, 0.0f, 1.0f); + float32x2 = vec4(vec2(bitcast(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), bitcast(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 17u)])), 0.0f, 1.0f); float32x3 = vec3(bitcast(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), bitcast(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 17u)]), bitcast(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 18u)])).xy; float32x4 = vec4(bitcast(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), bitcast(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 17u)]), bitcast(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 18u)]), bitcast(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 19u)])).xyz; uint32 = vec3(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)], 0u, 0u); diff --git a/src/tint/writer/wgsl/generator_impl.cc b/src/tint/writer/wgsl/generator_impl.cc index 677421d070..c71cd4959c 100644 --- a/src/tint/writer/wgsl/generator_impl.cc +++ b/src/tint/writer/wgsl/generator_impl.cc @@ -258,7 +258,7 @@ bool GeneratorImpl::EmitLiteral(std::ostream& out, const ast::LiteralExpression* return true; }, [&](const ast::FloatLiteralExpression* l) { // - out << FloatToBitPreservingString(static_cast(l->value)); + out << FloatToBitPreservingString(static_cast(l->value)) << l->suffix; return true; }, [&](const ast::IntLiteralExpression* l) { // diff --git a/src/tint/writer/wgsl/generator_impl_constructor_test.cc b/src/tint/writer/wgsl/generator_impl_constructor_test.cc index 7a147c2365..ae9f2b74f6 100644 --- a/src/tint/writer/wgsl/generator_impl_constructor_test.cc +++ b/src/tint/writer/wgsl/generator_impl_constructor_test.cc @@ -58,7 +58,7 @@ TEST_F(WgslGeneratorImplTest, EmitConstructor_Float) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.Generate()) << gen.error(); - EXPECT_THAT(gen.result(), HasSubstr("1073741824.0")); + EXPECT_THAT(gen.result(), HasSubstr("1073741824.0f")); } TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Float) { @@ -67,7 +67,7 @@ TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Float) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.Generate()) << gen.error(); - EXPECT_THAT(gen.result(), HasSubstr("f32(-0.000012)")); + EXPECT_THAT(gen.result(), HasSubstr("f32(-0.000012f)")); } TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Bool) { @@ -103,7 +103,7 @@ TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Vec) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.Generate()) << gen.error(); - EXPECT_THAT(gen.result(), HasSubstr("vec3(1.0, 2.0, 3.0)")); + EXPECT_THAT(gen.result(), HasSubstr("vec3(1.0f, 2.0f, 3.0f)")); } TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Mat) { @@ -112,8 +112,8 @@ TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Mat) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.Generate()) << gen.error(); - EXPECT_THAT(gen.result(), HasSubstr("mat2x3(vec3(1.0, 2.0, 3.0), " - "vec3(3.0, 4.0, 5.0))")); + EXPECT_THAT(gen.result(), HasSubstr("mat2x3(vec3(1.0f, 2.0f, 3.0f), " + "vec3(3.0f, 4.0f, 5.0f))")); } TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Array) { @@ -123,8 +123,9 @@ TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Array) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.Generate()) << gen.error(); - EXPECT_THAT(gen.result(), HasSubstr("array, 3u>(vec3(1.0, 2.0, 3.0), " - "vec3(4.0, 5.0, 6.0), vec3(7.0, 8.0, 9.0))")); + EXPECT_THAT(gen.result(), + HasSubstr("array, 3u>(vec3(1.0f, 2.0f, 3.0f), " + "vec3(4.0f, 5.0f, 6.0f), vec3(7.0f, 8.0f, 9.0f))")); } } // namespace diff --git a/src/tint/writer/wgsl/generator_impl_function_test.cc b/src/tint/writer/wgsl/generator_impl_function_test.cc index da919486ac..4c43a592f1 100644 --- a/src/tint/writer/wgsl/generator_impl_function_test.cc +++ b/src/tint/writer/wgsl/generator_impl_function_test.cc @@ -139,7 +139,7 @@ TEST_F(WgslGeneratorImplTest, Emit_Function_EntryPoint_ReturnValue) { ASSERT_TRUE(gen.EmitFunction(func)); EXPECT_EQ(gen.result(), R"( @stage(fragment) fn frag_main() -> @location(1) f32 { - return 1.0; + return 1.0f; } )"); } diff --git a/src/tint/writer/wgsl/generator_impl_literal_test.cc b/src/tint/writer/wgsl/generator_impl_literal_test.cc index 353bd36252..dd715d4fbe 100644 --- a/src/tint/writer/wgsl/generator_impl_literal_test.cc +++ b/src/tint/writer/wgsl/generator_impl_literal_test.cc @@ -64,36 +64,37 @@ TEST_P(WgslGenerator_FloatLiteralTest, Emit) { INSTANTIATE_TEST_SUITE_P(Zero, WgslGenerator_FloatLiteralTest, - ::testing::ValuesIn(std::vector{{0_f, "0.0"}, - {MakeFloat(0, 0, 0), "0.0"}, - {MakeFloat(1, 0, 0), "-0.0"}})); + ::testing::ValuesIn(std::vector{ + {0_f, "0.0f"}, + {MakeFloat(0, 0, 0), "0.0f"}, + {MakeFloat(1, 0, 0), "-0.0f"}})); INSTANTIATE_TEST_SUITE_P(Normal, WgslGenerator_FloatLiteralTest, - ::testing::ValuesIn(std::vector{{1_f, "1.0"}, - {-1_f, "-1.0"}, - {101.375_f, "101.375"}})); + ::testing::ValuesIn(std::vector{{1_f, "1.0f"}, + {-1_f, "-1.0f"}, + {101.375_f, "101.375f"}})); INSTANTIATE_TEST_SUITE_P(Subnormal, WgslGenerator_FloatLiteralTest, ::testing::ValuesIn(std::vector{ - {MakeFloat(0, 0, 1), "0x1p-149"}, // Smallest - {MakeFloat(1, 0, 1), "-0x1p-149"}, - {MakeFloat(0, 0, 2), "0x1p-148"}, - {MakeFloat(1, 0, 2), "-0x1p-148"}, - {MakeFloat(0, 0, 0x7fffff), "0x1.fffffcp-127"}, // Largest - {MakeFloat(1, 0, 0x7fffff), "-0x1.fffffcp-127"}, // Largest - {MakeFloat(0, 0, 0xcafebe), "0x1.2bfaf8p-127"}, // Scattered bits - {MakeFloat(1, 0, 0xcafebe), "-0x1.2bfaf8p-127"}, // Scattered bits - {MakeFloat(0, 0, 0xaaaaa), "0x1.55554p-130"}, // Scattered bits - {MakeFloat(1, 0, 0xaaaaa), "-0x1.55554p-130"}, // Scattered bits + {MakeFloat(0, 0, 1), "0x1p-149f"}, // Smallest + {MakeFloat(1, 0, 1), "-0x1p-149f"}, + {MakeFloat(0, 0, 2), "0x1p-148f"}, + {MakeFloat(1, 0, 2), "-0x1p-148f"}, + {MakeFloat(0, 0, 0x7fffff), "0x1.fffffcp-127f"}, // Largest + {MakeFloat(1, 0, 0x7fffff), "-0x1.fffffcp-127f"}, // Largest + {MakeFloat(0, 0, 0xcafebe), "0x1.2bfaf8p-127f"}, // Scattered bits + {MakeFloat(1, 0, 0xcafebe), "-0x1.2bfaf8p-127f"}, // Scattered bits + {MakeFloat(0, 0, 0xaaaaa), "0x1.55554p-130f"}, // Scattered bits + {MakeFloat(1, 0, 0xaaaaa), "-0x1.55554p-130f"}, // Scattered bits })); INSTANTIATE_TEST_SUITE_P(Infinity, WgslGenerator_FloatLiteralTest, ::testing::ValuesIn(std::vector{ - {MakeFloat(0, 255, 0), "0x1p+128"}, - {MakeFloat(1, 255, 0), "-0x1p+128"}})); + {MakeFloat(0, 255, 0), "0x1p+128f"}, + {MakeFloat(1, 255, 0), "-0x1p+128f"}})); INSTANTIATE_TEST_SUITE_P( // TODO(dneto): It's unclear how Infinity and NaN should be handled. @@ -108,20 +109,20 @@ INSTANTIATE_TEST_SUITE_P( WgslGenerator_FloatLiteralTest, ::testing::ValuesIn(std::vector{ // LSB only. Smallest mantissa. - {MakeFloat(0, 255, 1), "0x1.000002p+128"}, // Smallest mantissa - {MakeFloat(1, 255, 1), "-0x1.000002p+128"}, + {MakeFloat(0, 255, 1), "0x1.000002p+128f"}, // Smallest mantissa + {MakeFloat(1, 255, 1), "-0x1.000002p+128f"}, // MSB only. - {MakeFloat(0, 255, 0x400000), "0x1.8p+128"}, - {MakeFloat(1, 255, 0x400000), "-0x1.8p+128"}, + {MakeFloat(0, 255, 0x400000), "0x1.8p+128f"}, + {MakeFloat(1, 255, 0x400000), "-0x1.8p+128f"}, // All 1s in the mantissa. - {MakeFloat(0, 255, 0x7fffff), "0x1.fffffep+128"}, - {MakeFloat(1, 255, 0x7fffff), "-0x1.fffffep+128"}, + {MakeFloat(0, 255, 0x7fffff), "0x1.fffffep+128f"}, + {MakeFloat(1, 255, 0x7fffff), "-0x1.fffffep+128f"}, // Scattered bits, with 0 in top mantissa bit. - {MakeFloat(0, 255, 0x20101f), "0x1.40203ep+128"}, - {MakeFloat(1, 255, 0x20101f), "-0x1.40203ep+128"}, + {MakeFloat(0, 255, 0x20101f), "0x1.40203ep+128f"}, + {MakeFloat(1, 255, 0x20101f), "-0x1.40203ep+128f"}, // Scattered bits, with 1 in top mantissa bit. - {MakeFloat(0, 255, 0x40101f), "0x1.80203ep+128"}, - {MakeFloat(1, 255, 0x40101f), "-0x1.80203ep+128"}})); + {MakeFloat(0, 255, 0x40101f), "0x1.80203ep+128f"}, + {MakeFloat(1, 255, 0x40101f), "-0x1.80203ep+128f"}})); } // namespace } // namespace tint::writer::wgsl diff --git a/src/tint/writer/wgsl/generator_impl_variable_test.cc b/src/tint/writer/wgsl/generator_impl_variable_test.cc index 80f6259551..83af7c25ea 100644 --- a/src/tint/writer/wgsl/generator_impl_variable_test.cc +++ b/src/tint/writer/wgsl/generator_impl_variable_test.cc @@ -107,7 +107,7 @@ TEST_F(WgslGeneratorImplTest, EmitVariable_Constructor) { std::stringstream out; ASSERT_TRUE(gen.EmitVariable(out, v)) << gen.error(); - EXPECT_EQ(out.str(), R"(var a : f32 = 1.0;)"); + EXPECT_EQ(out.str(), R"(var a : f32 = 1.0f;)"); } TEST_F(WgslGeneratorImplTest, EmitVariable_Const) { @@ -118,7 +118,7 @@ TEST_F(WgslGeneratorImplTest, EmitVariable_Const) { std::stringstream out; ASSERT_TRUE(gen.EmitVariable(out, v)) << gen.error(); - EXPECT_EQ(out.str(), R"(let a : f32 = 1.0;)"); + EXPECT_EQ(out.str(), R"(let a : f32 = 1.0f;)"); } } // namespace diff --git a/test/tint/access/let/matrix.spvasm.expected.wgsl b/test/tint/access/let/matrix.spvasm.expected.wgsl index d2a2590d9c..9b26713f11 100644 --- a/test/tint/access/let/matrix.spvasm.expected.wgsl +++ b/test/tint/access/let/matrix.spvasm.expected.wgsl @@ -1,5 +1,5 @@ fn main_1() { - let x_24 : f32 = mat3x3(vec3(1.0, 2.0, 3.0), vec3(4.0, 5.0, 6.0), vec3(7.0, 8.0, 9.0))[1u].y; + let x_24 : f32 = mat3x3(vec3(1.0f, 2.0f, 3.0f), vec3(4.0f, 5.0f, 6.0f), vec3(7.0f, 8.0f, 9.0f))[1u].y; return; } diff --git a/test/tint/access/let/vector.spvasm.expected.wgsl b/test/tint/access/let/vector.spvasm.expected.wgsl index 2781fcc008..a5385e1b5b 100644 --- a/test/tint/access/let/vector.spvasm.expected.wgsl +++ b/test/tint/access/let/vector.spvasm.expected.wgsl @@ -1,7 +1,7 @@ fn main_1() { - let x_11 : f32 = vec3(1.0, 2.0, 3.0).y; - let x_13 : vec2 = vec2(vec3(1.0, 2.0, 3.0).x, vec3(1.0, 2.0, 3.0).z); - let x_14 : vec3 = vec3(vec3(1.0, 2.0, 3.0).x, vec3(1.0, 2.0, 3.0).z, vec3(1.0, 2.0, 3.0).y); + let x_11 : f32 = vec3(1.0f, 2.0f, 3.0f).y; + let x_13 : vec2 = vec2(vec3(1.0f, 2.0f, 3.0f).x, vec3(1.0f, 2.0f, 3.0f).z); + let x_14 : vec3 = vec3(vec3(1.0f, 2.0f, 3.0f).x, vec3(1.0f, 2.0f, 3.0f).z, vec3(1.0f, 2.0f, 3.0f).y); return; } diff --git a/test/tint/array/strides.spvasm.expected.wgsl b/test/tint/array/strides.spvasm.expected.wgsl index 6713a1669f..14e0a9e85a 100644 --- a/test/tint/array/strides.spvasm.expected.wgsl +++ b/test/tint/array/strides.spvasm.expected.wgsl @@ -26,7 +26,7 @@ fn f_1() { let x_28 : Arr = s.a[3i].el[2i]; let x_32 : f32 = s.a[3i].el[2i][1i].el; s.a = array(); - s.a[3i].el[2i][1i].el = 5.0; + s.a[3i].el[2i][1i].el = 5.0f; return; } diff --git a/test/tint/bug/tint/1088.spvasm.expected.wgsl b/test/tint/bug/tint/1088.spvasm.expected.wgsl index e8db8e1a8f..23899cccf5 100644 --- a/test/tint/bug/tint/1088.spvasm.expected.wgsl +++ b/test/tint/bug/tint/1088.spvasm.expected.wgsl @@ -32,7 +32,7 @@ fn main_1() { var q : vec4; var p : vec3; let x_13 : vec3 = position; - q = vec4(x_13.x, x_13.y, x_13.z, 1.0); + q = vec4(x_13.x, x_13.y, x_13.z, 1.0f); let x_21 : vec4 = q; p = vec3(x_21.x, x_21.y, x_21.z); let x_27 : f32 = p.x; @@ -42,14 +42,14 @@ fn main_1() { p.x = (x_27 + sin(((x_41 * x_45) + x_49))); let x_55 : f32 = p.y; let x_57 : f32 = x_14.time; - p.y = (x_55 + sin((x_57 + 4.0))); + p.y = (x_55 + sin((x_57 + 4.0f))); let x_69 : mat4x4 = x_14.worldViewProjection; let x_70 : vec3 = p; - gl_Position = (x_69 * vec4(x_70.x, x_70.y, x_70.z, 1.0)); + gl_Position = (x_69 * vec4(x_70.x, x_70.y, x_70.z, 1.0f)); let x_83 : vec2 = uv; vUV = x_83; let x_87 : f32 = gl_Position.y; - gl_Position.y = (x_87 * -1.0); + gl_Position.y = (x_87 * -1.0f); return; } diff --git a/test/tint/bug/tint/1520.spvasm.expected.wgsl b/test/tint/bug/tint/1520.spvasm.expected.wgsl index 108847dbf3..88c4ea4b9a 100644 --- a/test/tint/bug/tint/1520.spvasm.expected.wgsl +++ b/test/tint/bug/tint/1520.spvasm.expected.wgsl @@ -95,20 +95,20 @@ fn main_1() { x_9_ok = true; x_87_phi = false; if (true) { - x_86 = all(((vec4(0.0, 0.0, 0.0, 0.0) / vec4(x_77, x_77, x_77, x_77)) == vec4(0.0, 0.0, 0.0, 0.0))); + x_86 = all(((vec4(0.0f, 0.0f, 0.0f, 0.0f) / vec4(x_77, x_77, x_77, x_77)) == vec4(0.0f, 0.0f, 0.0f, 0.0f))); x_87_phi = x_86; } let x_87 : bool = x_87_phi; x_9_ok = x_87; let x_89 : vec4 = vec4(x_77, x_77, x_77, x_77); x_10_val = x_89; - let x_92 : vec4 = (x_89 + vec4(1.0, 1.0, 1.0, 1.0)); + let x_92 : vec4 = (x_89 + vec4(1.0f, 1.0f, 1.0f, 1.0f)); x_10_val = x_92; - let x_93 : vec4 = (x_92 - vec4(1.0, 1.0, 1.0, 1.0)); + let x_93 : vec4 = (x_92 - vec4(1.0f, 1.0f, 1.0f, 1.0f)); x_10_val = x_93; - let x_94 : vec4 = (x_93 + vec4(1.0, 1.0, 1.0, 1.0)); + let x_94 : vec4 = (x_93 + vec4(1.0f, 1.0f, 1.0f, 1.0f)); x_10_val = x_94; - let x_95 : vec4 = (x_94 - vec4(1.0, 1.0, 1.0, 1.0)); + let x_95 : vec4 = (x_94 - vec4(1.0f, 1.0f, 1.0f, 1.0f)); x_10_val = x_95; x_100_phi = false; if (x_87) { @@ -117,13 +117,13 @@ fn main_1() { } let x_100 : bool = x_100_phi; x_9_ok = x_100; - let x_103 : vec4 = (x_95 * vec4(2.0, 2.0, 2.0, 2.0)); + let x_103 : vec4 = (x_95 * vec4(2.0f, 2.0f, 2.0f, 2.0f)); x_10_val = x_103; - let x_104 : vec4 = (x_103 / vec4(2.0, 2.0, 2.0, 2.0)); + let x_104 : vec4 = (x_103 / vec4(2.0f, 2.0f, 2.0f, 2.0f)); x_10_val = x_104; - let x_105 : vec4 = (x_104 * vec4(2.0, 2.0, 2.0, 2.0)); + let x_105 : vec4 = (x_104 * vec4(2.0f, 2.0f, 2.0f, 2.0f)); x_10_val = x_105; - let x_106 : vec4 = (x_105 / vec4(2.0, 2.0, 2.0, 2.0)); + let x_106 : vec4 = (x_105 / vec4(2.0f, 2.0f, 2.0f, 2.0f)); x_10_val = x_106; x_111_phi = false; if (x_100) { diff --git a/test/tint/bug/tint/1564.wgsl.expected.wgsl b/test/tint/bug/tint/1564.wgsl.expected.wgsl index b8b5785382..851d66ac9b 100644 --- a/test/tint/bug/tint/1564.wgsl.expected.wgsl +++ b/test/tint/bug/tint/1564.wgsl.expected.wgsl @@ -1,3 +1,3 @@ fn foo() { - let b = 0x1.16c2p-133; + let b = 0x1.16c2p-133f; } diff --git a/test/tint/bug/tint/749.spvasm.expected.wgsl b/test/tint/bug/tint/749.spvasm.expected.wgsl index e48b877f56..577838b8c0 100644 --- a/test/tint/bug/tint/749.spvasm.expected.wgsl +++ b/test/tint/bug/tint/749.spvasm.expected.wgsl @@ -19,7 +19,7 @@ fn swap_i1_i1_(i : ptr, j : ptr) { let x_932 : i32 = temp; temp = 0i; temp = x_932; - let x_523 : vec3 = vec3(vec3(1.0, 2.0, 3.0).z, vec3(1.0, 2.0, 3.0).y, vec3(1.0, 2.0, 3.0).z); + let x_523 : vec3 = vec3(vec3(1.0f, 2.0f, 3.0f).z, vec3(1.0f, 2.0f, 3.0f).y, vec3(1.0f, 2.0f, 3.0f).z); let x_933 : i32 = *(i); *(i) = 0i; *(i) = x_933; @@ -43,7 +43,7 @@ fn swap_i1_i1_(i : ptr, j : ptr) { let x_938 : i32 = *(j); *(j) = 0i; *(j) = x_938; - let x_525 : vec3 = vec3(x_523.z, vec3(1.0, 2.0, 3.0).x, x_523.y); + let x_525 : vec3 = vec3(x_523.z, vec3(1.0f, 2.0f, 3.0f).x, x_523.y); let x_939 : i32 = *(i); *(i) = 0i; *(i) = x_939; @@ -127,7 +127,7 @@ fn performPartition_i1_i1_(l : ptr, h : ptr) -> i3 let x_955 : i32 = param_3; param_3 = 0i; param_3 = x_955; - let x_534 : vec3 = vec3(vec3(1.0, 2.0, 3.0).z, vec3(1.0, 2.0, 3.0).x, vec3(1.0, 2.0, 3.0).z); + let x_534 : vec3 = vec3(vec3(1.0f, 2.0f, 3.0f).z, vec3(1.0f, 2.0f, 3.0f).x, vec3(1.0f, 2.0f, 3.0f).z); let x_956 : i32 = param_1; param_1 = 0i; param_1 = x_956; @@ -161,7 +161,7 @@ fn performPartition_i1_i1_(l : ptr, h : ptr) -> i3 let x_963 : i32 = pivot; pivot = 0i; pivot = x_963; - x_537 = vec2(vec3(1.0, 2.0, 3.0).y, vec3(1.0, 2.0, 3.0).z); + x_537 = vec2(vec3(1.0f, 2.0f, 3.0f).y, vec3(1.0f, 2.0f, 3.0f).z); let x_964 : QuicksortObject = obj; obj = QuicksortObject(array(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = x_964; @@ -200,7 +200,7 @@ fn performPartition_i1_i1_(l : ptr, h : ptr) -> i3 obj = QuicksortObject(array(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = x_972; let x_63 : i32 = pivot; - let x_540 : vec2 = vec2(vec3(1.0, 2.0, 3.0).y, x_534.z); + let x_540 : vec2 = vec2(vec3(1.0f, 2.0f, 3.0f).y, x_534.z); let x_973 : i32 = i_1; i_1 = 0i; i_1 = x_973; @@ -231,7 +231,7 @@ fn performPartition_i1_i1_(l : ptr, h : ptr) -> i3 let x_980 : i32 = *(l); *(l) = 0i; *(l) = x_980; - let x_544 : vec3 = vec3(vec3(1.0, 2.0, 3.0).z, vec3(1.0, 2.0, 3.0).y, x_540.x); + let x_544 : vec3 = vec3(vec3(1.0f, 2.0f, 3.0f).z, vec3(1.0f, 2.0f, 3.0f).y, x_540.x); let x_70 : i32 = i_1; let x_545 : vec2 = vec2(x_537.y, x_538.x); let x_981 : i32 = param; @@ -329,7 +329,7 @@ fn performPartition_i1_i1_(l : ptr, h : ptr) -> i3 let x_1003 : i32 = *(l); *(l) = 0i; *(l) = x_1003; - let x_554 : vec2 = vec2(x_536.z, vec3(1.0, 2.0, 3.0).y); + let x_554 : vec2 = vec2(x_536.z, vec3(1.0f, 2.0f, 3.0f).y); let x_1004 : i32 = param_1; param_1 = 0i; param_1 = x_1004; @@ -360,7 +360,7 @@ fn quicksort_() { let x_1008 : array = stack; stack = array(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i); stack = x_1008; - let x_556 : vec2 = vec2(vec3(1.0, 2.0, 3.0).y, vec3(1.0, 2.0, 3.0).y); + let x_556 : vec2 = vec2(vec3(1.0f, 2.0f, 3.0f).y, vec3(1.0f, 2.0f, 3.0f).y); let x_1009 : i32 = param_5; param_5 = 0i; param_5 = x_1009; @@ -369,7 +369,7 @@ fn quicksort_() { p = 0i; p = x_1010; let x_93 : i32 = top; - let x_557 : vec2 = vec2(vec3(1.0, 2.0, 3.0).x, vec3(1.0, 2.0, 3.0).x); + let x_557 : vec2 = vec2(vec3(1.0f, 2.0f, 3.0f).x, vec3(1.0f, 2.0f, 3.0f).x); let x_1011 : i32 = p; p = 0i; p = x_1011; @@ -410,7 +410,7 @@ fn quicksort_() { let x_1020 : i32 = param_4; param_4 = 0i; param_4 = x_1020; - let x_562 : vec3 = vec3(vec3(1.0, 2.0, 3.0).z, x_558.y, vec3(1.0, 2.0, 3.0).y); + let x_562 : vec3 = vec3(vec3(1.0f, 2.0f, 3.0f).z, x_558.y, vec3(1.0f, 2.0f, 3.0f).y); let x_1021 : i32 = stack[x_96_save]; stack[x_96_save] = 0i; stack[x_96_save] = x_1021; @@ -507,7 +507,7 @@ fn quicksort_() { let x_1043 : i32 = stack[x_100_save]; stack[x_100_save] = 0i; stack[x_100_save] = x_1043; - let x_573 : vec2 = vec2(vec3(1.0, 2.0, 3.0).y, vec3(1.0, 2.0, 3.0).z); + let x_573 : vec2 = vec2(vec3(1.0f, 2.0f, 3.0f).y, vec3(1.0f, 2.0f, 3.0f).z); top = (x_112 - 1i); let x_1044 : i32 = param_5; param_5 = 0i; @@ -540,7 +540,7 @@ fn quicksort_() { stack[x_110_save] = x_1050; let x_577 : vec2 = vec2(x_569.y, x_569.z); let x_120 : i32 = h_1; - let x_578 : vec2 = vec2(x_558.x, vec3(1.0, 2.0, 3.0).y); + let x_578 : vec2 = vec2(x_558.x, vec3(1.0f, 2.0f, 3.0f).y); param_5 = x_120; let x_1051 : i32 = stack[x_100_save]; stack[x_100_save] = 0i; @@ -648,7 +648,7 @@ fn quicksort_() { let x_1076 : i32 = stack[x_96_save]; stack[x_96_save] = 0i; stack[x_96_save] = x_1076; - let x_592 : vec2 = vec2(vec3(1.0, 2.0, 3.0).x, vec3(1.0, 2.0, 3.0).y); + let x_592 : vec2 = vec2(vec3(1.0f, 2.0f, 3.0f).x, vec3(1.0f, 2.0f, 3.0f).y); let x_1077 : QuicksortObject = obj; obj = QuicksortObject(array(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = x_1077; @@ -774,7 +774,7 @@ fn main_1() { var i_2 : i32; var uv : vec2; let x_717 : vec2 = uv; - uv = vec2(0.0, 0.0); + uv = vec2(0.0f, 0.0f); uv = x_717; i_2 = 0i; let x_721 : QuicksortObject = obj; @@ -784,13 +784,13 @@ fn main_1() { let x_722 : QuicksortObject = obj; obj = QuicksortObject(array(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = x_722; - let x_431 : vec2 = vec2(vec3(1.0, 2.0, 3.0).x, vec3(1.0, 2.0, 3.0).x); + let x_431 : vec2 = vec2(vec3(1.0f, 2.0f, 3.0f).x, vec3(1.0f, 2.0f, 3.0f).x); let x_158 : i32 = i_2; let x_723 : vec2 = uv; - uv = vec2(0.0, 0.0); + uv = vec2(0.0f, 0.0f); uv = x_723; let x_725 : vec3 = color; - color = vec3(0.0, 0.0, 0.0); + color = vec3(0.0f, 0.0f, 0.0f); color = x_725; let x_432 : vec2 = vec2(x_431.y, x_431.y); let x_726 : QuicksortObject = obj; @@ -810,11 +810,11 @@ fn main_1() { obj = x_758; let x_184 : vec4 = gl_FragCoord; let x_759 : vec2 = uv; - uv = vec2(0.0, 0.0); + uv = vec2(0.0f, 0.0f); uv = x_759; let x_447 : vec2 = vec2(vec2().y, vec2().y); let x_760 : vec2 = uv; - uv = vec2(0.0, 0.0); + uv = vec2(0.0f, 0.0f); uv = x_760; let x_185 : vec2 = vec2(x_184.x, x_184.y); let x_448 : vec3 = vec3(x_185.y, x_446.y, x_446.y); @@ -822,15 +822,15 @@ fn main_1() { obj = QuicksortObject(array(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = x_761; let x_762 : vec2 = uv; - uv = vec2(0.0, 0.0); + uv = vec2(0.0f, 0.0f); uv = x_762; let x_191 : vec2 = x_188.resolution; let x_763 : QuicksortObject = obj; obj = QuicksortObject(array(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = x_763; - let x_449 : vec3 = vec3(x_184.y, vec3(1.0, 2.0, 3.0).z, x_184.w); + let x_449 : vec3 = vec3(x_184.y, vec3(1.0f, 2.0f, 3.0f).z, x_184.w); let x_764 : vec3 = color; - color = vec3(0.0, 0.0, 0.0); + color = vec3(0.0f, 0.0f, 0.0f); color = x_764; let x_192 : vec2 = (x_185 / x_191); let x_765 : QuicksortObject = obj; @@ -838,15 +838,15 @@ fn main_1() { obj = x_765; let x_450 : vec2 = vec2(x_447.x, x_185.y); let x_766 : vec3 = color; - color = vec3(0.0, 0.0, 0.0); + color = vec3(0.0f, 0.0f, 0.0f); let x_767 : vec3 = color; - color = vec3(0.0, 0.0, 0.0); + color = vec3(0.0f, 0.0f, 0.0f); color = x_767; color = x_766; uv = x_192; - color = vec3(1.0, 2.0, 3.0); + color = vec3(1.0f, 2.0f, 3.0f); let x_768 : vec3 = color; - color = vec3(0.0, 0.0, 0.0); + color = vec3(0.0f, 0.0f, 0.0f); color = x_768; let x_451 : vec3 = vec3(x_185.x, x_185.y, x_446.y); let x_769 : QuicksortObject = obj; @@ -864,9 +864,9 @@ fn main_1() { obj.numbers[0u] = x_772; let x_206 : f32 = color.x; let x_773 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_773; - let x_452 : vec2 = vec2(vec3(1.0, 2.0, 3.0).z, vec3(1.0, 2.0, 3.0).y); + let x_452 : vec2 = vec2(vec3(1.0f, 2.0f, 3.0f).z, vec3(1.0f, 2.0f, 3.0f).y); let x_774 : i32 = i_2; i_2 = 0i; i_2 = x_774; @@ -876,21 +876,21 @@ fn main_1() { let x_453 : vec3 = vec3(x_451.x, x_450.x, x_450.y); color.x = (x_206 + f32(x_201)); let x_776 : vec2 = uv; - uv = vec2(0.0, 0.0); + uv = vec2(0.0f, 0.0f); uv = x_776; let x_777 : vec2 = uv; - uv = vec2(0.0, 0.0); + uv = vec2(0.0f, 0.0f); uv = x_777; let x_454 : vec2 = vec2(x_184.y, x_184.y); let x_210 : f32 = uv.x; let x_455 : vec2 = vec2(x_192.y, x_192.x); let x_778 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_778; let x_779 : QuicksortObject = obj; obj = QuicksortObject(array(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = x_779; - if ((x_210 > 0.25)) { + if ((x_210 > 0.25f)) { let x_780 : i32 = i_2; i_2 = 0i; i_2 = x_780; @@ -899,7 +899,7 @@ fn main_1() { obj.numbers[0u] = x_781; let x_456 : vec3 = vec3(vec2().y, x_448.y, x_448.y); let x_782 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_782; let x_216 : i32 = obj.numbers[1i]; let x_783 : QuicksortObject = obj; @@ -907,28 +907,28 @@ fn main_1() { obj = x_783; let x_457 : vec2 = vec2(x_454.x, x_454.x); let x_784 : vec2 = uv; - uv = vec2(0.0, 0.0); + uv = vec2(0.0f, 0.0f); uv = x_784; let x_785 : QuicksortObject = obj; obj = QuicksortObject(array(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = x_785; - let x_458 : vec2 = vec2(vec3(1.0, 2.0, 3.0).z, vec2().y); + let x_458 : vec2 = vec2(vec3(1.0f, 2.0f, 3.0f).z, vec2().y); let x_786 : i32 = i_2; i_2 = 0i; i_2 = x_786; let x_219 : f32 = color[0i]; let x_787 : f32 = color[0i]; - color[0i] = 0.0; + color[0i] = 0.0f; color[0i] = x_787; let x_788 : vec3 = color; - color = vec3(0.0, 0.0, 0.0); + color = vec3(0.0f, 0.0f, 0.0f); color = x_788; let x_789 : vec3 = color; - color = vec3(0.0, 0.0, 0.0); + color = vec3(0.0f, 0.0f, 0.0f); color = x_789; let x_459 : vec3 = vec3(x_454.y, x_454.y, x_447.y); let x_790 : f32 = color[0i]; - color[0i] = 0.0; + color[0i] = 0.0f; color[0i] = x_790; color.x = (f32(x_216) + x_219); let x_791 : i32 = obj.numbers[0u]; @@ -936,54 +936,54 @@ fn main_1() { obj.numbers[0u] = x_791; } let x_792 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_792; let x_793 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_793; let x_223 : f32 = uv.x; let x_794 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_794; let x_460 : vec3 = vec3(x_453.z, x_453.y, x_453.y); let x_795 : vec2 = uv; - uv = vec2(0.0, 0.0); + uv = vec2(0.0f, 0.0f); uv = x_795; let x_796 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_796; let x_461 : vec2 = vec2(vec2().y, vec2().y); let x_797 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_797; - if ((x_223 > 0.5)) { + if ((x_223 > 0.5f)) { let x_798 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_798; let x_462 : vec2 = vec2(x_446.x, x_446.x); let x_799 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_799; let x_800 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_800; let x_463 : vec3 = vec3(x_453.x, x_453.z, x_461.y); let x_801 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_801; let x_230 : i32 = obj.numbers[2u]; let x_802 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_802; let x_803 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_803; let x_804 : i32 = obj.numbers[2u]; obj.numbers[2u] = 0i; obj.numbers[2u] = x_804; let x_464 : vec2 = vec2(x_450.y, x_191.x); let x_805 : f32 = color.y; - color.y = 0.0; + color.y = 0.0f; color.y = x_805; let x_234 : f32 = color.y; let x_806 : i32 = obj.numbers[2u]; @@ -991,7 +991,7 @@ fn main_1() { obj.numbers[2u] = x_806; let x_465 : vec2 = vec2(x_463.x, x_185.x); let x_807 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_807; let x_808 : i32 = i_2; i_2 = 0i; @@ -1002,7 +1002,7 @@ fn main_1() { i_2 = x_809; color.y = (f32(x_230) + x_234); let x_810 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_810; } let x_811 : i32 = i_2; @@ -1010,64 +1010,64 @@ fn main_1() { i_2 = x_811; let x_467 : vec2 = vec2(x_191.x, x_191.x); let x_812 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_812; let x_238 : f32 = uv[0i]; let x_813 : vec3 = color; - color = vec3(0.0, 0.0, 0.0); + color = vec3(0.0f, 0.0f, 0.0f); color = x_813; let x_814 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_814; - if ((x_238 > 0.75)) { + if ((x_238 > 0.75f)) { let x_815 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_815; let x_245 : i32 = obj.numbers[3i]; let x_816 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_816; let x_817 : QuicksortObject = obj; obj = QuicksortObject(array(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = x_817; let x_468 : vec3 = vec3(x_467.x, x_467.x, x_467.x); let x_818 : f32 = uv[0i]; - uv[0i] = 0.0; + uv[0i] = 0.0f; uv[0i] = x_818; let x_819 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_819; let x_249 : f32 = color.z; let x_820 : vec3 = color; - color = vec3(0.0, 0.0, 0.0); + color = vec3(0.0f, 0.0f, 0.0f); color = x_820; let x_469 : vec3 = vec3(x_467.x, x_191.y, x_467.y); let x_821 : f32 = color.z; - color.z = 0.0; + color.z = 0.0f; color.z = x_821; let x_822 : i32 = obj.numbers[0u]; obj.numbers[0u] = 0i; obj.numbers[0u] = x_822; let x_470 : vec2 = vec2(vec2().x, vec2().y); let x_823 : f32 = color.z; - color.z = 0.0; + color.z = 0.0f; color.z = x_823; color.z = (x_249 + f32(x_245)); let x_824 : vec2 = uv; - uv = vec2(0.0, 0.0); + uv = vec2(0.0f, 0.0f); uv = x_824; let x_471 : vec2 = vec2(x_470.y, x_470.y); } let x_825 : f32 = uv[0i]; - uv[0i] = 0.0; + uv[0i] = 0.0f; uv[0i] = x_825; let x_472 : vec3 = vec3(x_454.x, x_454.y, x_454.y); let x_254 : i32 = obj.numbers[4i]; let x_826 : f32 = uv[0i]; - uv[0i] = 0.0; + uv[0i] = 0.0f; uv[0i] = x_826; let x_827 : vec3 = color; - color = vec3(0.0, 0.0, 0.0); + color = vec3(0.0f, 0.0f, 0.0f); color = x_827; let x_473 : vec3 = vec3(x_446.y, x_453.x, x_453.x); let x_828 : i32 = obj.numbers[4i]; @@ -1075,31 +1075,31 @@ fn main_1() { obj.numbers[4i] = x_828; let x_474 : vec2 = vec2(x_191.x, x_184.z); let x_829 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_829; let x_257 : f32 = color.y; let x_830 : f32 = color.y; - color.y = 0.0; + color.y = 0.0f; color.y = x_830; let x_475 : vec2 = vec2(x_467.x, x_450.x); let x_831 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_831; let x_832 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_832; let x_476 : vec2 = vec2(x_451.z, x_460.y); color.y = (x_257 + f32(x_254)); let x_477 : vec3 = vec3(vec2().x, x_472.x, vec2().y); let x_833 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_833; let x_834 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_834; let x_478 : vec2 = vec2(x_472.x, x_472.y); let x_835 : f32 = uv.y; - uv.y = 0.0; + uv.y = 0.0f; uv.y = x_835; let x_261 : f32 = uv.y; let x_836 : i32 = i_2; @@ -1110,20 +1110,20 @@ fn main_1() { obj.numbers[0u] = 0i; obj.numbers[0u] = x_837; let x_838 : f32 = color.y; - color.y = 0.0; + color.y = 0.0f; color.y = x_838; let x_480 : vec3 = vec3(x_446.x, x_446.x, vec2().y); let x_839 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_839; - if ((x_261 > 0.25)) { + if ((x_261 > 0.25f)) { let x_481 : vec2 = vec2(x_447.x, x_480.z); let x_840 : vec3 = color; - color = vec3(0.0, 0.0, 0.0); + color = vec3(0.0f, 0.0f, 0.0f); color = x_840; let x_267 : i32 = obj.numbers[5u]; let x_841 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_841; let x_842 : i32 = i_2; i_2 = 0i; @@ -1133,34 +1133,34 @@ fn main_1() { i_2 = x_843; let x_270 : f32 = color.x; let x_844 : f32 = uv[0i]; - uv[0i] = 0.0; + uv[0i] = 0.0f; uv[0i] = x_844; let x_482 : vec3 = vec3(x_455.x, x_475.y, x_455.y); let x_845 : QuicksortObject = obj; obj = QuicksortObject(array(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = x_845; let x_846 : f32 = uv.y; - uv.y = 0.0; + uv.y = 0.0f; uv.y = x_846; let x_847 : i32 = i_2; i_2 = 0i; i_2 = x_847; let x_483 : vec3 = vec3(x_184.w, x_184.w, x_192.x); let x_848 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_848; color.x = (f32(x_267) + x_270); let x_484 : vec3 = vec3(x_454.y, x_450.x, x_454.y); let x_849 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_849; } let x_850 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_850; let x_485 : vec3 = vec3(x_467.x, x_450.y, x_450.x); let x_851 : f32 = uv.y; - uv.y = 0.0; + uv.y = 0.0f; uv.y = x_851; let x_852 : i32 = obj.numbers[4i]; obj.numbers[4i] = 0i; @@ -1169,21 +1169,21 @@ fn main_1() { let x_853 : i32 = obj.numbers[0u]; obj.numbers[0u] = 0i; obj.numbers[0u] = x_853; - if ((x_274 > 0.5)) { + if ((x_274 > 0.5f)) { let x_854 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_854; let x_486 : vec2 = vec2(x_480.y, x_455.y); let x_855 : f32 = color.y; - color.y = 0.0; + color.y = 0.0f; color.y = x_855; let x_487 : vec2 = vec2(x_449.z, x_449.y); let x_856 : f32 = uv.y; - uv.y = 0.0; + uv.y = 0.0f; uv.y = x_856; let x_280 : i32 = obj.numbers[6u]; let x_857 : f32 = uv.y; - uv.y = 0.0; + uv.y = 0.0f; uv.y = x_857; let x_858 : i32 = i_2; i_2 = 0i; @@ -1194,10 +1194,10 @@ fn main_1() { let x_488 : vec2 = vec2(x_473.z, x_473.y); let x_283 : f32 = color.y; let x_860 : vec2 = uv; - uv = vec2(0.0, 0.0); + uv = vec2(0.0f, 0.0f); uv = x_860; let x_861 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_861; let x_489 : vec2 = vec2(x_475.y, x_475.x); let x_862 : i32 = obj.numbers[6u]; @@ -1212,16 +1212,16 @@ fn main_1() { obj = x_864; color.y = (f32(x_280) + x_283); let x_865 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_865; - let x_491 : vec2 = vec2(vec3(1.0, 2.0, 3.0).y, x_454.x); + let x_491 : vec2 = vec2(vec3(1.0f, 2.0f, 3.0f).y, x_454.x); let x_866 : f32 = color.y; - color.y = 0.0; + color.y = 0.0f; color.y = x_866; } let x_492 : vec2 = vec2(x_455.y, x_455.y); let x_867 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_867; let x_287 : f32 = uv.y; let x_868 : QuicksortObject = obj; @@ -1229,70 +1229,70 @@ fn main_1() { obj = x_868; let x_493 : vec2 = vec2(x_475.x, x_475.y); let x_869 : f32 = uv[0i]; - uv[0i] = 0.0; + uv[0i] = 0.0f; uv[0i] = x_869; let x_870 : f32 = color.y; - color.y = 0.0; + color.y = 0.0f; color.y = x_870; let x_494 : vec3 = vec3(x_191.x, x_191.y, x_191.y); let x_871 : i32 = obj.numbers[4i]; obj.numbers[4i] = 0i; obj.numbers[4i] = x_871; - if ((x_287 > 0.75)) { + if ((x_287 > 0.75f)) { let x_872 : vec3 = color; - color = vec3(0.0, 0.0, 0.0); + color = vec3(0.0f, 0.0f, 0.0f); color = x_872; let x_873 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_873; let x_495 : vec3 = vec3(x_192.y, x_192.x, x_192.y); let x_874 : vec3 = color; - color = vec3(0.0, 0.0, 0.0); + color = vec3(0.0f, 0.0f, 0.0f); color = x_874; let x_293 : i32 = obj.numbers[7i]; let x_875 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_875; let x_496 : vec3 = vec3(x_475.x, x_467.y, x_467.x); let x_876 : f32 = color.y; - color.y = 0.0; + color.y = 0.0f; color.y = x_876; let x_497 : vec2 = vec2(x_477.x, x_461.y); let x_877 : i32 = obj.numbers[0u]; obj.numbers[0u] = 0i; obj.numbers[0u] = x_877; let x_878 : f32 = color.y; - color.y = 0.0; + color.y = 0.0f; color.y = x_878; let x_498 : vec3 = vec3(x_478.x, x_478.y, x_478.x); let x_879 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_879; let x_296 : f32 = color.z; let x_880 : f32 = uv.y; - uv.y = 0.0; + uv.y = 0.0f; uv.y = x_880; let x_499 : vec2 = vec2(x_184.x, x_184.y); let x_881 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_881; let x_882 : f32 = uv.y; - uv.y = 0.0; + uv.y = 0.0f; uv.y = x_882; let x_883 : f32 = uv.y; - uv.y = 0.0; + uv.y = 0.0f; uv.y = x_883; let x_500 : vec3 = vec3(x_499.y, x_499.y, x_494.z); let x_884 : f32 = color.z; - color.z = 0.0; + color.z = 0.0f; color.z = x_884; color.z = (f32(x_293) + x_296); let x_885 : f32 = color.y; - color.y = 0.0; + color.y = 0.0f; color.y = x_885; let x_501 : vec2 = vec2(x_453.x, x_453.z); let x_886 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_886; } let x_887 : i32 = i_2; @@ -1300,7 +1300,7 @@ fn main_1() { i_2 = x_887; let x_502 : vec2 = vec2(x_451.y, x_192.y); let x_888 : vec2 = uv; - uv = vec2(0.0, 0.0); + uv = vec2(0.0f, 0.0f); uv = x_888; let x_301 : i32 = obj.numbers[8i]; let x_889 : i32 = i_2; @@ -1311,78 +1311,78 @@ fn main_1() { obj.numbers[8i] = 0i; obj.numbers[8i] = x_890; let x_891 : f32 = color.y; - color.y = 0.0; + color.y = 0.0f; color.y = x_891; let x_504 : vec2 = vec2(x_453.y, vec2().x); let x_892 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_892; let x_505 : vec3 = vec3(x_504.x, x_504.y, x_504.x); let x_893 : f32 = color.z; - color.z = 0.0; + color.z = 0.0f; color.z = x_893; let x_304 : f32 = color.z; let x_894 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_894; let x_506 : vec2 = vec2(x_493.x, x_492.x); let x_895 : i32 = obj.numbers[4i]; obj.numbers[4i] = 0i; obj.numbers[4i] = x_895; let x_896 : f32 = uv.y; - uv.y = 0.0; + uv.y = 0.0f; uv.y = x_896; let x_507 : vec2 = vec2(x_461.x, x_447.x); let x_897 : f32 = color.y; - color.y = 0.0; + color.y = 0.0f; color.y = x_897; color.z = (x_304 + f32(x_301)); let x_898 : vec2 = uv; - uv = vec2(0.0, 0.0); + uv = vec2(0.0f, 0.0f); uv = x_898; let x_899 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_899; let x_508 : vec3 = vec3(x_461.y, x_461.x, x_506.y); let x_900 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_900; let x_308 : f32 = uv.x; let x_901 : f32 = color.y; - color.y = 0.0; + color.y = 0.0f; color.y = x_901; let x_509 : vec3 = vec3(x_503.y, x_503.x, x_448.z); let x_902 : f32 = uv.y; - uv.y = 0.0; + uv.y = 0.0f; uv.y = x_902; let x_310 : f32 = uv.y; let x_903 : f32 = uv.y; - uv.y = 0.0; + uv.y = 0.0f; uv.y = x_903; let x_904 : f32 = color.z; - color.z = 0.0; + color.z = 0.0f; color.z = x_904; - let x_510 : vec3 = vec3(vec3(1.0, 2.0, 3.0).y, x_485.y, x_485.z); + let x_510 : vec3 = vec3(vec3(1.0f, 2.0f, 3.0f).y, x_485.y, x_485.z); let x_905 : f32 = color.z; - color.z = 0.0; + color.z = 0.0f; color.z = x_905; let x_906 : i32 = i_2; i_2 = 0i; i_2 = x_906; let x_511 : vec2 = vec2(x_485.z, x_485.y); let x_907 : vec3 = color; - color = vec3(0.0, 0.0, 0.0); + color = vec3(0.0f, 0.0f, 0.0f); color = x_907; let x_908 : f32 = uv.y; - uv.y = 0.0; + uv.y = 0.0f; uv.y = x_908; let x_512 : vec3 = vec3(x_455.y, x_455.y, x_455.y); let x_909 : i32 = obj.numbers[4i]; obj.numbers[4i] = 0i; obj.numbers[4i] = x_909; - if ((abs((x_308 - x_310)) < 0.25)) { + if ((abs((x_308 - x_310)) < 0.25f)) { let x_910 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_910; let x_911 : QuicksortObject = obj; obj = QuicksortObject(array(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); @@ -1394,47 +1394,47 @@ fn main_1() { let x_317 : i32 = obj.numbers[9u]; let x_514 : vec3 = vec3(x_474.y, x_474.y, x_474.y); let x_913 : f32 = uv.y; - uv.y = 0.0; + uv.y = 0.0f; uv.y = x_913; let x_320 : f32 = color.x; let x_914 : f32 = uv.y; - uv.y = 0.0; + uv.y = 0.0f; uv.y = x_914; let x_515 : vec2 = vec2(x_502.x, x_502.y); let x_915 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_915; let x_916 : vec3 = color; - color = vec3(0.0, 0.0, 0.0); + color = vec3(0.0f, 0.0f, 0.0f); color = x_916; let x_516 : vec2 = vec2(x_452.x, x_452.x); let x_917 : vec2 = uv; - uv = vec2(0.0, 0.0); + uv = vec2(0.0f, 0.0f); uv = x_917; let x_918 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_918; let x_517 : vec3 = vec3(vec2().x, vec2().x, vec2().y); color.x = (f32(x_317) + x_320); let x_919 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_919; let x_518 : vec3 = vec3(x_480.y, x_508.x, x_480.x); let x_920 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_920; } let x_921 : f32 = uv.y; - uv.y = 0.0; + uv.y = 0.0f; uv.y = x_921; let x_325 : vec3 = color; let x_922 : f32 = uv[0i]; - uv[0i] = 0.0; + uv[0i] = 0.0f; uv[0i] = x_922; let x_519 : vec3 = vec3(x_447.x, x_446.x, x_446.y); let x_326 : vec3 = normalize(x_325); let x_923 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_923; let x_924 : QuicksortObject = obj; obj = QuicksortObject(array(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); @@ -1443,19 +1443,19 @@ fn main_1() { obj = QuicksortObject(array(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = x_925; let x_926 : f32 = color.y; - color.y = 0.0; + color.y = 0.0f; color.y = x_926; let x_520 : vec2 = vec2(x_506.y, x_519.y); let x_927 : f32 = color.y; - color.y = 0.0; + color.y = 0.0f; color.y = x_927; - let x_330 : vec4 = vec4(x_326.x, x_326.y, x_326.z, 1.0); + let x_330 : vec4 = vec4(x_326.x, x_326.y, x_326.z, 1.0f); let x_928 : f32 = uv.y; - uv.y = 0.0; + uv.y = 0.0f; uv.y = x_928; - let x_521 : vec3 = vec3(vec3(1.0, 2.0, 3.0).y, vec3(1.0, 2.0, 3.0).y, x_520.y); + let x_521 : vec3 = vec3(vec3(1.0f, 2.0f, 3.0f).y, vec3(1.0f, 2.0f, 3.0f).y, x_520.y); let x_929 : f32 = uv.x; - uv.x = 0.0; + uv.x = 0.0f; uv.x = x_929; x_GLF_color = x_330; let x_930 : QuicksortObject = obj; @@ -1463,7 +1463,7 @@ fn main_1() { obj = x_930; let x_522 : vec3 = vec3(x_330.w, x_330.y, x_493.x); let x_931 : f32 = color.x; - color.x = 0.0; + color.x = 0.0f; color.x = x_931; return; } diff --git a/test/tint/bug/tint/943.spvasm.expected.wgsl b/test/tint/bug/tint/943.spvasm.expected.wgsl index f168e2efef..30df0007f8 100644 --- a/test/tint/bug/tint/943.spvasm.expected.wgsl +++ b/test/tint/bug/tint/943.spvasm.expected.wgsl @@ -99,7 +99,7 @@ fn mm_readA_i1_i1_(row : ptr, col : ptr) -> f32 { let x_448 : f32 = x_165.A[(((x_438 * x_439) + (x_441 * x_442)) + x_445)]; x_430 = x_448; } else { - x_430 = 0.0; + x_430 = 0.0f; } let x_450 : f32 = x_430; return x_450; @@ -129,7 +129,7 @@ fn mm_readB_i1_i1_(row_1 : ptr, col_1 : ptr) -> f3 let x_485 : f32 = x_185.B[(((x_475 * x_476) + (x_478 * x_479)) + x_482)]; x_468 = x_485; } else { - x_468 = 0.0; + x_468 = 0.0f; } let x_487 : f32 = x_468; return x_487; @@ -251,7 +251,7 @@ fn mm_matMul_i1_i1_i1_(dimAOuter : ptr, dimInner : ptr f32 { fn unaryOperation_f1_(a : ptr) -> f32 { let x_47 : f32 = *(a); - if ((x_47 < 0.0)) { - return 0x1p+128; + if ((x_47 < 0.0f)) { + return 0x1p+128f; } let x_55 : f32 = *(a); return log(x_55); diff --git a/test/tint/bug/tint/977.spvasm.expected.wgsl b/test/tint/bug/tint/977.spvasm.expected.wgsl index 57c9062abc..5b02dce0b4 100644 --- a/test/tint/bug/tint/977.spvasm.expected.wgsl +++ b/test/tint/bug/tint/977.spvasm.expected.wgsl @@ -35,11 +35,11 @@ var gl_GlobalInvocationID : vec3; fn binaryOperation_f1_f1_(a : ptr, b : ptr) -> f32 { var x_26 : f32; let x_13 : f32 = *(b); - if ((x_13 == 0.0)) { - return 1.0; + if ((x_13 == 0.0f)) { + return 1.0f; } let x_21 : f32 = *(b); - if (!((round((x_21 - (2.0 * floor((x_21 / 2.0))))) == 1.0))) { + if (!((round((x_21 - (2.0f * floor((x_21 / 2.0f))))) == 1.0f))) { let x_29 : f32 = *(a); let x_31 : f32 = *(b); x_26 = pow(abs(x_29), x_31); @@ -62,8 +62,8 @@ fn main_1() { index = bitcast(x_54); a_1 = -10i; let x_63 : i32 = index; - param = -4.0; - param_1 = -3.0; + param = -4.0f; + param_1 = -3.0f; let x_68 : f32 = binaryOperation_f1_f1_(&(param), &(param_1)); resultMatrix.numbers[x_63] = x_68; return; diff --git a/test/tint/builtins/degrees.spvasm.expected.wgsl b/test/tint/builtins/degrees.spvasm.expected.wgsl index 823f9f4cd4..d0d2ba5d71 100644 --- a/test/tint/builtins/degrees.spvasm.expected.wgsl +++ b/test/tint/builtins/degrees.spvasm.expected.wgsl @@ -1,7 +1,7 @@ fn main_1() { var a : f32; var b : f32; - a = 42.0; + a = 42.0f; let x_11 : f32 = a; b = degrees(x_11); return; diff --git a/test/tint/builtins/radians.spvasm.expected.wgsl b/test/tint/builtins/radians.spvasm.expected.wgsl index 82cb5fb0e2..72b3e06cb2 100644 --- a/test/tint/builtins/radians.spvasm.expected.wgsl +++ b/test/tint/builtins/radians.spvasm.expected.wgsl @@ -1,7 +1,7 @@ fn main_1() { var a : f32; var b : f32; - a = 42.0; + a = 42.0f; let x_11 : f32 = a; b = radians(x_11); return; diff --git a/test/tint/builtins/textureLoad/depth_ms.spvasm.expected.wgsl b/test/tint/builtins/textureLoad/depth_ms.spvasm.expected.wgsl index 8f6220811b..f494c7776f 100644 --- a/test/tint/builtins/textureLoad/depth_ms.spvasm.expected.wgsl +++ b/test/tint/builtins/textureLoad/depth_ms.spvasm.expected.wgsl @@ -3,8 +3,8 @@ var tint_symbol_1 : vec4 = vec4(); fn textureLoad_6273b1() { - var res : f32 = 0.0; - let x_17 : vec4 = vec4(textureLoad(arg_0, vec2(), 1i), 0.0, 0.0, 0.0); + var res : f32 = 0.0f; + let x_17 : vec4 = vec4(textureLoad(arg_0, vec2(), 1i), 0.0f, 0.0f, 0.0f); res = x_17.x; return; } diff --git a/test/tint/expressions/literals/-inf.spvasm.expected.wgsl b/test/tint/expressions/literals/-inf.spvasm.expected.wgsl index 2588c6b909..eb85662ac3 100644 --- a/test/tint/expressions/literals/-inf.spvasm.expected.wgsl +++ b/test/tint/expressions/literals/-inf.spvasm.expected.wgsl @@ -1,7 +1,7 @@ var out_var_SV_TARGET : vec4; fn main_1() { - out_var_SV_TARGET = vec4(-0x1p+128, -0x1p+128, -0x1p+128, -0x1p+128); + out_var_SV_TARGET = vec4(-0x1p+128f, -0x1p+128f, -0x1p+128f, -0x1p+128f); return; } diff --git a/test/tint/expressions/literals/inf.spvasm.expected.wgsl b/test/tint/expressions/literals/inf.spvasm.expected.wgsl index c18af0d9b1..6f8467c721 100644 --- a/test/tint/expressions/literals/inf.spvasm.expected.wgsl +++ b/test/tint/expressions/literals/inf.spvasm.expected.wgsl @@ -1,7 +1,7 @@ var out_var_SV_TARGET : vec4; fn main_1() { - out_var_SV_TARGET = vec4(0x1p+128, 0x1p+128, 0x1p+128, 0x1p+128); + out_var_SV_TARGET = vec4(0x1p+128f, 0x1p+128f, 0x1p+128f, 0x1p+128f); return; } diff --git a/test/tint/expressions/literals/nan.spvasm.expected.wgsl b/test/tint/expressions/literals/nan.spvasm.expected.wgsl index b1e77023dc..0909a0f125 100644 --- a/test/tint/expressions/literals/nan.spvasm.expected.wgsl +++ b/test/tint/expressions/literals/nan.spvasm.expected.wgsl @@ -1,7 +1,7 @@ var out_var_SV_TARGET : vec4; fn main_1() { - out_var_SV_TARGET = vec4(0x1.9p+128, 0x1.9p+128, 0x1.9p+128, 0x1.9p+128); + out_var_SV_TARGET = vec4(0x1.9p+128f, 0x1.9p+128f, 0x1.9p+128f, 0x1.9p+128f); return; } diff --git a/test/tint/expressions/type_ctor/mat2x2/explicit/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat2x2/explicit/scalars/f32.wgsl index bbf4c71ee0..d2f7f21133 100644 --- a/test/tint/expressions/type_ctor/mat2x2/explicit/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat2x2/explicit/scalars/f32.wgsl @@ -1,2 +1,2 @@ -let m = mat2x2(0.0, 1.0, - 2.0, 3.0); +let m = mat2x2(0.0f, 1.0f, + 2.0f, 3.0f); diff --git a/test/tint/expressions/type_ctor/mat2x2/explicit/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat2x2/explicit/scalars/f32.wgsl.expected.wgsl index c9626bd497..39cec7918e 100644 --- a/test/tint/expressions/type_ctor/mat2x2/explicit/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat2x2/explicit/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat2x2(0.0, 1.0, 2.0, 3.0); +let m = mat2x2(0.0f, 1.0f, 2.0f, 3.0f); diff --git a/test/tint/expressions/type_ctor/mat2x2/explicit/vectors/f32.wgsl b/test/tint/expressions/type_ctor/mat2x2/explicit/vectors/f32.wgsl index b2ceabff10..3841d4ef34 100644 --- a/test/tint/expressions/type_ctor/mat2x2/explicit/vectors/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat2x2/explicit/vectors/f32.wgsl @@ -1,2 +1,2 @@ -let m = mat2x2(vec2(0.0, 1.0), - vec2(2.0, 3.0)); +let m = mat2x2(vec2(0.0f, 1.0f), + vec2(2.0f, 3.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x2/explicit/vectors/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat2x2/explicit/vectors/f32.wgsl.expected.wgsl index 5da680bcea..ff4e2760d8 100644 --- a/test/tint/expressions/type_ctor/mat2x2/explicit/vectors/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat2x2/explicit/vectors/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat2x2(vec2(0.0, 1.0), vec2(2.0, 3.0)); +let m = mat2x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl new file mode 100644 index 0000000000..0195661eb0 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl @@ -0,0 +1,2 @@ +let m = mat2x2(0.0, 1.0, + 2.0, 3.0); diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..f79600efe0 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const mat2 m = mat2(0.0f, 1.0f, 2.0f, 3.0f); diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..c2e0d31160 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float2x2 m = float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..b62a321cb2 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float2x2 m = float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f)); + diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..16c63452ff --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,27 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 15 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v2float = OpTypeVector %float 2 +%mat2v2float = OpTypeMatrix %v2float 2 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %6 = OpConstantComposite %v2float %float_0 %float_1 + %float_2 = OpConstant %float 2 + %float_3 = OpConstant %float 3 + %9 = OpConstantComposite %v2float %float_2 %float_3 + %m = OpConstantComposite %mat2v2float %6 %9 + %void = OpTypeVoid + %11 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %11 + %14 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..e4941d5989 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat2x2(0.0, 1.0, 2.0, 3.0); diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/f32.wgsl index 0195661eb0..802bd0beef 100644 --- a/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/f32.wgsl @@ -1,2 +1,2 @@ -let m = mat2x2(0.0, 1.0, - 2.0, 3.0); +let m = mat2x2(0.0f, 1.0f, + 2.0f, 3.0f); diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/f32.wgsl.expected.wgsl index e4941d5989..1078c57ce2 100644 --- a/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat2x2(0.0, 1.0, 2.0, 3.0); +let m = mat2x2(0.0f, 1.0f, 2.0f, 3.0f); diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl new file mode 100644 index 0000000000..0698377a39 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl @@ -0,0 +1,2 @@ +let m = mat2x2(vec2(0.0, 1.0), + vec2(2.0, 3.0)); diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..f2eeed59ea --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const mat2 m = mat2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..c2e0d31160 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float2x2 m = float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..b62a321cb2 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float2x2 m = float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f)); + diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..16c63452ff --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,27 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 15 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v2float = OpTypeVector %float 2 +%mat2v2float = OpTypeMatrix %v2float 2 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %6 = OpConstantComposite %v2float %float_0 %float_1 + %float_2 = OpConstant %float 2 + %float_3 = OpConstant %float 3 + %9 = OpConstantComposite %v2float %float_2 %float_3 + %m = OpConstantComposite %mat2v2float %6 %9 + %void = OpTypeVoid + %11 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %11 + %14 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..873422d9c9 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat2x2(vec2(0.0, 1.0), vec2(2.0, 3.0)); diff --git a/test/tint/expressions/type_ctor/mat2x3/explicit/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat2x3/explicit/scalars/f32.wgsl index 9b605ccb1c..4f73038e51 100644 --- a/test/tint/expressions/type_ctor/mat2x3/explicit/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat2x3/explicit/scalars/f32.wgsl @@ -1,2 +1,2 @@ -let m = mat2x3(0.0, 1.0, 2.0, - 3.0, 4.0, 5.0); +let m = mat2x3(0.0f, 1.0f, 2.0f, + 3.0f, 4.0f, 5.0f); diff --git a/test/tint/expressions/type_ctor/mat2x3/explicit/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat2x3/explicit/scalars/f32.wgsl.expected.wgsl index 9af09937aa..6de0a5f01c 100644 --- a/test/tint/expressions/type_ctor/mat2x3/explicit/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat2x3/explicit/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat2x3(0.0, 1.0, 2.0, 3.0, 4.0, 5.0); +let m = mat2x3(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f); diff --git a/test/tint/expressions/type_ctor/mat2x3/explicit/vectors/f32.wgsl b/test/tint/expressions/type_ctor/mat2x3/explicit/vectors/f32.wgsl index ffa6470f42..736b493eeb 100644 --- a/test/tint/expressions/type_ctor/mat2x3/explicit/vectors/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat2x3/explicit/vectors/f32.wgsl @@ -1,2 +1,2 @@ -let m = mat2x3(vec3(0.0, 1.0, 2.0), - vec3(3.0, 4.0, 5.0)); +let m = mat2x3(vec3(0.0f, 1.0f, 2.0f), + vec3(3.0f, 4.0f, 5.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x3/explicit/vectors/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat2x3/explicit/vectors/f32.wgsl.expected.wgsl index 2e36381f2f..6bfd68290e 100644 --- a/test/tint/expressions/type_ctor/mat2x3/explicit/vectors/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat2x3/explicit/vectors/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat2x3(vec3(0.0, 1.0, 2.0), vec3(3.0, 4.0, 5.0)); +let m = mat2x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl new file mode 100644 index 0000000000..dc7f65ff3e --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl @@ -0,0 +1,2 @@ +let m = mat2x3(0.0, 1.0, 2.0, + 3.0, 4.0, 5.0); diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..ea329c5a88 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const mat2x3 m = mat2x3(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f); diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..fb12d01088 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float2x3 m = float2x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..443c61f166 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float2x3 m = float2x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f)); + diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..d99921cf67 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,29 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v3float = OpTypeVector %float 3 +%mat2v3float = OpTypeMatrix %v3float 2 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %float_2 = OpConstant %float 2 + %7 = OpConstantComposite %v3float %float_0 %float_1 %float_2 + %float_3 = OpConstant %float 3 + %float_4 = OpConstant %float 4 + %float_5 = OpConstant %float 5 + %11 = OpConstantComposite %v3float %float_3 %float_4 %float_5 + %m = OpConstantComposite %mat2v3float %7 %11 + %void = OpTypeVoid + %13 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %13 + %16 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..0be516f032 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat2x3(0.0, 1.0, 2.0, 3.0, 4.0, 5.0); diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/f32.wgsl index dc7f65ff3e..7107d4ba15 100644 --- a/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/f32.wgsl @@ -1,2 +1,2 @@ -let m = mat2x3(0.0, 1.0, 2.0, - 3.0, 4.0, 5.0); +let m = mat2x3(0.0f, 1.0f, 2.0f, + 3.0f, 4.0f, 5.0f); diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/f32.wgsl.expected.wgsl index 0be516f032..c5a27d61aa 100644 --- a/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat2x3(0.0, 1.0, 2.0, 3.0, 4.0, 5.0); +let m = mat2x3(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f); diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl new file mode 100644 index 0000000000..24f8a6c920 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl @@ -0,0 +1,2 @@ +let m = mat2x3(vec3(0.0, 1.0, 2.0), + vec3(3.0, 4.0, 5.0)); diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..919400a470 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const mat2x3 m = mat2x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..fb12d01088 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float2x3 m = float2x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..443c61f166 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float2x3 m = float2x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f)); + diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..d99921cf67 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,29 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 17 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v3float = OpTypeVector %float 3 +%mat2v3float = OpTypeMatrix %v3float 2 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %float_2 = OpConstant %float 2 + %7 = OpConstantComposite %v3float %float_0 %float_1 %float_2 + %float_3 = OpConstant %float 3 + %float_4 = OpConstant %float 4 + %float_5 = OpConstant %float 5 + %11 = OpConstantComposite %v3float %float_3 %float_4 %float_5 + %m = OpConstantComposite %mat2v3float %7 %11 + %void = OpTypeVoid + %13 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %13 + %16 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..a23b1e2739 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat2x3(vec3(0.0, 1.0, 2.0), vec3(3.0, 4.0, 5.0)); diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/f32.wgsl b/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/f32.wgsl index 6819a819b6..5b8ed92203 100644 --- a/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/f32.wgsl @@ -1,2 +1,2 @@ -let m = mat2x3(vec3(0.0, 1.0, 2.0), - vec3(3.0, 4.0, 5.0)); +let m = mat2x3(vec3(0.0f, 1.0f, 2.0f), + vec3(3.0f, 4.0f, 5.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/f32.wgsl.expected.wgsl index 092445aaf9..bbc2d2af70 100644 --- a/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat2x3(vec3(0.0, 1.0, 2.0), vec3(3.0, 4.0, 5.0)); +let m = mat2x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x4/explicit/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat2x4/explicit/scalars/f32.wgsl index e258e63b11..56d25f5f64 100644 --- a/test/tint/expressions/type_ctor/mat2x4/explicit/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat2x4/explicit/scalars/f32.wgsl @@ -1,2 +1,2 @@ -let m = mat2x4(0.0, 1.0, 2.0, 3.0, - 4.0, 5.0, 6.0, 7.0); +let m = mat2x4(0.0f, 1.0f, 2.0f, 3.0f, + 4.0f, 5.0f, 6.0f, 7.0f); diff --git a/test/tint/expressions/type_ctor/mat2x4/explicit/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat2x4/explicit/scalars/f32.wgsl.expected.wgsl index 9ceabf7f2b..f342196030 100644 --- a/test/tint/expressions/type_ctor/mat2x4/explicit/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat2x4/explicit/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat2x4(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); +let m = mat2x4(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f); diff --git a/test/tint/expressions/type_ctor/mat2x4/explicit/vectors/f32.wgsl b/test/tint/expressions/type_ctor/mat2x4/explicit/vectors/f32.wgsl index 0a9b59a213..5465c36451 100644 --- a/test/tint/expressions/type_ctor/mat2x4/explicit/vectors/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat2x4/explicit/vectors/f32.wgsl @@ -1,2 +1,2 @@ -let m = mat2x4(vec4(0.0, 1.0, 2.0, 3.0), - vec4(4.0, 5.0, 6.0, 7.0)); +let m = mat2x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), + vec4(4.0f, 5.0f, 6.0f, 7.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x4/explicit/vectors/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat2x4/explicit/vectors/f32.wgsl.expected.wgsl index a3a8fd3ab8..be987bb01b 100644 --- a/test/tint/expressions/type_ctor/mat2x4/explicit/vectors/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat2x4/explicit/vectors/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat2x4(vec4(0.0, 1.0, 2.0, 3.0), vec4(4.0, 5.0, 6.0, 7.0)); +let m = mat2x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl new file mode 100644 index 0000000000..81abe9f668 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl @@ -0,0 +1,2 @@ +let m = mat2x4(0.0, 1.0, 2.0, 3.0, + 4.0, 5.0, 6.0, 7.0); diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..6ee3601c95 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const mat2x4 m = mat2x4(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f); diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..5ed2b1bb39 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float2x4 m = float2x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..b309bde1e4 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float2x4 m = float2x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f)); + diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..57110c528c --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%mat2v4float = OpTypeMatrix %v4float 2 + %float_0 = OpConstant %float 0 + %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 + %float_4 = OpConstant %float 4 + %float_5 = OpConstant %float 5 + %float_6 = OpConstant %float 6 + %float_7 = OpConstant %float 7 + %13 = OpConstantComposite %v4float %float_4 %float_5 %float_6 %float_7 + %m = OpConstantComposite %mat2v4float %8 %13 + %void = OpTypeVoid + %15 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %15 + %18 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..bcb4dfe908 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat2x4(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/f32.wgsl index 81abe9f668..394b079e70 100644 --- a/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/f32.wgsl @@ -1,2 +1,2 @@ -let m = mat2x4(0.0, 1.0, 2.0, 3.0, - 4.0, 5.0, 6.0, 7.0); +let m = mat2x4(0.0f, 1.0f, 2.0f, 3.0f, + 4.0f, 5.0f, 6.0f, 7.0f); diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/f32.wgsl.expected.wgsl index bcb4dfe908..dc53810d1c 100644 --- a/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat2x4(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); +let m = mat2x4(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f); diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl new file mode 100644 index 0000000000..e391fbe021 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl @@ -0,0 +1,2 @@ +let m = mat2x4(vec4(0.0, 1.0, 2.0, 3.0), + vec4(4.0, 5.0, 6.0, 7.0)); diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..461bebd73a --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const mat2x4 m = mat2x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..5ed2b1bb39 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float2x4 m = float2x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..b309bde1e4 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float2x4 m = float2x4(float4(0.0f, 1.0f, 2.0f, 3.0f), float4(4.0f, 5.0f, 6.0f, 7.0f)); + diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..57110c528c --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 19 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%mat2v4float = OpTypeMatrix %v4float 2 + %float_0 = OpConstant %float 0 + %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 + %float_4 = OpConstant %float 4 + %float_5 = OpConstant %float 5 + %float_6 = OpConstant %float 6 + %float_7 = OpConstant %float 7 + %13 = OpConstantComposite %v4float %float_4 %float_5 %float_6 %float_7 + %m = OpConstantComposite %mat2v4float %8 %13 + %void = OpTypeVoid + %15 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %15 + %18 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..80bb8ca202 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat2x4(vec4(0.0, 1.0, 2.0, 3.0), vec4(4.0, 5.0, 6.0, 7.0)); diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/f32.wgsl b/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/f32.wgsl index c57c2ed3bd..4a9db50269 100644 --- a/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/f32.wgsl @@ -1,2 +1,2 @@ -let m = mat2x4(vec4(0.0, 1.0, 2.0, 3.0), - vec4(4.0, 5.0, 6.0, 7.0)); +let m = mat2x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), + vec4(4.0f, 5.0f, 6.0f, 7.0f)); diff --git a/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/f32.wgsl.expected.wgsl index f6335df52a..99f104bbd7 100644 --- a/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat2x4(vec4(0.0, 1.0, 2.0, 3.0), vec4(4.0, 5.0, 6.0, 7.0)); +let m = mat2x4(vec4(0.0f, 1.0f, 2.0f, 3.0f), vec4(4.0f, 5.0f, 6.0f, 7.0f)); diff --git a/test/tint/expressions/type_ctor/mat3x2/explicit/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat3x2/explicit/scalars/f32.wgsl index 67b5b1914d..b6fb489c88 100644 --- a/test/tint/expressions/type_ctor/mat3x2/explicit/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat3x2/explicit/scalars/f32.wgsl @@ -1,3 +1,3 @@ -let m = mat3x2(0.0, 1.0, - 2.0, 3.0, - 4.0, 5.0); +let m = mat3x2(0.0f, 1.0f, + 2.0f, 3.0f, + 4.0f, 5.0f); diff --git a/test/tint/expressions/type_ctor/mat3x2/explicit/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x2/explicit/scalars/f32.wgsl.expected.wgsl index 2be115ead5..c1034f7f91 100644 --- a/test/tint/expressions/type_ctor/mat3x2/explicit/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat3x2/explicit/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat3x2(0.0, 1.0, 2.0, 3.0, 4.0, 5.0); +let m = mat3x2(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f); diff --git a/test/tint/expressions/type_ctor/mat3x2/explicit/vectors/f32.wgsl b/test/tint/expressions/type_ctor/mat3x2/explicit/vectors/f32.wgsl index 2afe85b7d0..6d080cbd8b 100644 --- a/test/tint/expressions/type_ctor/mat3x2/explicit/vectors/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat3x2/explicit/vectors/f32.wgsl @@ -1,3 +1,3 @@ -let m = mat3x2(vec2(0.0, 1.0), - vec2(2.0, 3.0), - vec2(4.0, 5.0)); +let m = mat3x2(vec2(0.0f, 1.0f), + vec2(2.0f, 3.0f), + vec2(4.0f, 5.0f)); diff --git a/test/tint/expressions/type_ctor/mat3x2/explicit/vectors/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x2/explicit/vectors/f32.wgsl.expected.wgsl index 23a270ec14..5ba17fb363 100644 --- a/test/tint/expressions/type_ctor/mat3x2/explicit/vectors/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat3x2/explicit/vectors/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat3x2(vec2(0.0, 1.0), vec2(2.0, 3.0), vec2(4.0, 5.0)); +let m = mat3x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f)); diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl new file mode 100644 index 0000000000..6fbe3b8504 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl @@ -0,0 +1,3 @@ +let m = mat3x2(0.0, 1.0, + 2.0, 3.0, + 4.0, 5.0); diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..ee6b9c0c34 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const mat3x2 m = mat3x2(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f); diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..27568edf53 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float3x2 m = float3x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f)); diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..ae7f33c2da --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float3x2 m = float3x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f)); + diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..ffaa504ab7 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,30 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 18 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v2float = OpTypeVector %float 2 +%mat3v2float = OpTypeMatrix %v2float 3 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %6 = OpConstantComposite %v2float %float_0 %float_1 + %float_2 = OpConstant %float 2 + %float_3 = OpConstant %float 3 + %9 = OpConstantComposite %v2float %float_2 %float_3 + %float_4 = OpConstant %float 4 + %float_5 = OpConstant %float 5 + %12 = OpConstantComposite %v2float %float_4 %float_5 + %m = OpConstantComposite %mat3v2float %6 %9 %12 + %void = OpTypeVoid + %14 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %14 + %17 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..4d48f5936f --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat3x2(0.0, 1.0, 2.0, 3.0, 4.0, 5.0); diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/f32.wgsl index 6fbe3b8504..f64977f15c 100644 --- a/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/f32.wgsl @@ -1,3 +1,3 @@ -let m = mat3x2(0.0, 1.0, - 2.0, 3.0, - 4.0, 5.0); +let m = mat3x2(0.0f, 1.0f, + 2.0f, 3.0f, + 4.0f, 5.0f); diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/f32.wgsl.expected.wgsl index 4d48f5936f..f418892fd7 100644 --- a/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat3x2(0.0, 1.0, 2.0, 3.0, 4.0, 5.0); +let m = mat3x2(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f); diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl new file mode 100644 index 0000000000..990b243a42 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl @@ -0,0 +1,3 @@ +let m = mat3x2(vec2(0.0, 1.0), + vec2(2.0, 3.0), + vec2(4.0, 5.0)); diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..1447967e95 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const mat3x2 m = mat3x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f)); diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..27568edf53 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float3x2 m = float3x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f)); diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..ae7f33c2da --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float3x2 m = float3x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f)); + diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..ffaa504ab7 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,30 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 18 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v2float = OpTypeVector %float 2 +%mat3v2float = OpTypeMatrix %v2float 3 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %6 = OpConstantComposite %v2float %float_0 %float_1 + %float_2 = OpConstant %float 2 + %float_3 = OpConstant %float 3 + %9 = OpConstantComposite %v2float %float_2 %float_3 + %float_4 = OpConstant %float 4 + %float_5 = OpConstant %float 5 + %12 = OpConstantComposite %v2float %float_4 %float_5 + %m = OpConstantComposite %mat3v2float %6 %9 %12 + %void = OpTypeVoid + %14 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %14 + %17 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..b8ff25a09a --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat3x2(vec2(0.0, 1.0), vec2(2.0, 3.0), vec2(4.0, 5.0)); diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/f32.wgsl b/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/f32.wgsl index d9950cad64..287ee1b932 100644 --- a/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/f32.wgsl @@ -1,3 +1,3 @@ -let m = mat3x2(vec2(0.0, 1.0), - vec2(2.0, 3.0), - vec2(4.0, 5.0)); +let m = mat3x2(vec2(0.0f, 1.0f), + vec2(2.0f, 3.0f), + vec2(4.0f, 5.0f)); diff --git a/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/f32.wgsl.expected.wgsl index 70fc4e69a3..913dd6bb47 100644 --- a/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat3x2(vec2(0.0, 1.0), vec2(2.0, 3.0), vec2(4.0, 5.0)); +let m = mat3x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f)); diff --git a/test/tint/expressions/type_ctor/mat3x3/explicit/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat3x3/explicit/scalars/f32.wgsl index b6a5ce10f7..33d7b14418 100644 --- a/test/tint/expressions/type_ctor/mat3x3/explicit/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat3x3/explicit/scalars/f32.wgsl @@ -1,3 +1,3 @@ -let m = mat3x3(0.0, 1.0, 2.0, - 3.0, 4.0, 5.0, - 6.0, 7.0, 8.0); +let m = mat3x3(0.0f, 1.0f, 2.0f, + 3.0f, 4.0f, 5.0f, + 6.0f, 7.0f, 8.0f); diff --git a/test/tint/expressions/type_ctor/mat3x3/explicit/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x3/explicit/scalars/f32.wgsl.expected.wgsl index acd785e24a..033c8f659b 100644 --- a/test/tint/expressions/type_ctor/mat3x3/explicit/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat3x3/explicit/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat3x3(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); +let m = mat3x3(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f); diff --git a/test/tint/expressions/type_ctor/mat3x3/explicit/vectors/f32.wgsl b/test/tint/expressions/type_ctor/mat3x3/explicit/vectors/f32.wgsl index fd4d236f38..cb6ac10f06 100644 --- a/test/tint/expressions/type_ctor/mat3x3/explicit/vectors/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat3x3/explicit/vectors/f32.wgsl @@ -1,3 +1,3 @@ -let m = mat3x3(vec3(0.0, 1.0, 2.0), - vec3(3.0, 4.0, 5.0), - vec3(6.0, 7.0, 8.0)); +let m = mat3x3(vec3(0.0f, 1.0f, 2.0f), + vec3(3.0f, 4.0f, 5.0f), + vec3(6.0f, 7.0f, 8.0f)); diff --git a/test/tint/expressions/type_ctor/mat3x3/explicit/vectors/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x3/explicit/vectors/f32.wgsl.expected.wgsl index 9a9a20f64a..9ac30b5b1c 100644 --- a/test/tint/expressions/type_ctor/mat3x3/explicit/vectors/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat3x3/explicit/vectors/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat3x3(vec3(0.0, 1.0, 2.0), vec3(3.0, 4.0, 5.0), vec3(6.0, 7.0, 8.0)); +let m = mat3x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f)); diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl new file mode 100644 index 0000000000..ecdafe7191 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl @@ -0,0 +1,3 @@ +let m = mat3x3(0.0, 1.0, 2.0, + 3.0, 4.0, 5.0, + 6.0, 7.0, 8.0); diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..0006430145 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const mat3 m = mat3(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f); diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..c35ca2af2e --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float3x3 m = float3x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f)); diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..2635df5e2e --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float3x3 m = float3x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f)); + diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..8ec1da43f0 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,33 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v3float = OpTypeVector %float 3 +%mat3v3float = OpTypeMatrix %v3float 3 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %float_2 = OpConstant %float 2 + %7 = OpConstantComposite %v3float %float_0 %float_1 %float_2 + %float_3 = OpConstant %float 3 + %float_4 = OpConstant %float 4 + %float_5 = OpConstant %float 5 + %11 = OpConstantComposite %v3float %float_3 %float_4 %float_5 + %float_6 = OpConstant %float 6 + %float_7 = OpConstant %float 7 + %float_8 = OpConstant %float 8 + %15 = OpConstantComposite %v3float %float_6 %float_7 %float_8 + %m = OpConstantComposite %mat3v3float %7 %11 %15 + %void = OpTypeVoid + %17 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %17 + %20 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..18ca6e3c20 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat3x3(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/f32.wgsl index ecdafe7191..de0b7c5c91 100644 --- a/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/f32.wgsl @@ -1,3 +1,3 @@ -let m = mat3x3(0.0, 1.0, 2.0, - 3.0, 4.0, 5.0, - 6.0, 7.0, 8.0); +let m = mat3x3(0.0f, 1.0f, 2.0f, + 3.0f, 4.0f, 5.0f, + 6.0f, 7.0f, 8.0f); diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/f32.wgsl.expected.wgsl index 18ca6e3c20..c4f87ec1b6 100644 --- a/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat3x3(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); +let m = mat3x3(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f); diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl new file mode 100644 index 0000000000..7b5f129ecd --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl @@ -0,0 +1,3 @@ +let m = mat3x3(vec3(0.0, 1.0, 2.0), + vec3(3.0, 4.0, 5.0), + vec3(6.0, 7.0, 8.0)); diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..f4631cb30a --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +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)); diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..c35ca2af2e --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float3x3 m = float3x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f)); diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..2635df5e2e --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float3x3 m = float3x3(float3(0.0f, 1.0f, 2.0f), float3(3.0f, 4.0f, 5.0f), float3(6.0f, 7.0f, 8.0f)); + diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..8ec1da43f0 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,33 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v3float = OpTypeVector %float 3 +%mat3v3float = OpTypeMatrix %v3float 3 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %float_2 = OpConstant %float 2 + %7 = OpConstantComposite %v3float %float_0 %float_1 %float_2 + %float_3 = OpConstant %float 3 + %float_4 = OpConstant %float 4 + %float_5 = OpConstant %float 5 + %11 = OpConstantComposite %v3float %float_3 %float_4 %float_5 + %float_6 = OpConstant %float 6 + %float_7 = OpConstant %float 7 + %float_8 = OpConstant %float 8 + %15 = OpConstantComposite %v3float %float_6 %float_7 %float_8 + %m = OpConstantComposite %mat3v3float %7 %11 %15 + %void = OpTypeVoid + %17 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %17 + %20 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..21c62e8e24 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat3x3(vec3(0.0, 1.0, 2.0), vec3(3.0, 4.0, 5.0), vec3(6.0, 7.0, 8.0)); diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/f32.wgsl b/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/f32.wgsl index 5c2b614103..ab6a8dd7ff 100644 --- a/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/f32.wgsl @@ -1,3 +1,3 @@ -let m = mat3x3(vec3(0.0, 1.0, 2.0), - vec3(3.0, 4.0, 5.0), - vec3(6.0, 7.0, 8.0)); +let m = mat3x3(vec3(0.0f, 1.0f, 2.0f), + vec3(3.0f, 4.0f, 5.0f), + vec3(6.0f, 7.0f, 8.0f)); diff --git a/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/f32.wgsl.expected.wgsl index 9fdc4c906e..9117012306 100644 --- a/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat3x3(vec3(0.0, 1.0, 2.0), vec3(3.0, 4.0, 5.0), vec3(6.0, 7.0, 8.0)); +let m = mat3x3(vec3(0.0f, 1.0f, 2.0f), vec3(3.0f, 4.0f, 5.0f), vec3(6.0f, 7.0f, 8.0f)); diff --git a/test/tint/expressions/type_ctor/mat3x4/explicit/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat3x4/explicit/scalars/f32.wgsl index 8b1a949a9d..0a2e8e04d8 100644 --- a/test/tint/expressions/type_ctor/mat3x4/explicit/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat3x4/explicit/scalars/f32.wgsl @@ -1,3 +1,3 @@ -let m = mat3x4(0.0, 1.0, 2.0, 3.0, - 4.0, 5.0, 6.0, 7.0, - 8.0, 9.0, 10.0, 11.0); +let m = mat3x4(0.0f, 1.0f, 2.0f, 3.0f, + 4.0f, 5.0f, 6.0f, 7.0f, + 8.0f, 9.0f, 10.0f, 11.0f); diff --git a/test/tint/expressions/type_ctor/mat3x4/explicit/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x4/explicit/scalars/f32.wgsl.expected.wgsl index 84d2e1f4de..205baa2a5f 100644 --- a/test/tint/expressions/type_ctor/mat3x4/explicit/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat3x4/explicit/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat3x4(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0); +let m = mat3x4(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f); diff --git a/test/tint/expressions/type_ctor/mat3x4/explicit/vectors/f32.wgsl b/test/tint/expressions/type_ctor/mat3x4/explicit/vectors/f32.wgsl index 0551705012..a3fc9c6fa5 100644 --- a/test/tint/expressions/type_ctor/mat3x4/explicit/vectors/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat3x4/explicit/vectors/f32.wgsl @@ -1,3 +1,3 @@ -let m = mat3x4(vec4(0.0, 1.0, 2.0, 3.0), - vec4(4.0, 5.0, 6.0, 7.0), - vec4(8.0, 9.0, 10.0, 11.0)); +let 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)); diff --git a/test/tint/expressions/type_ctor/mat3x4/explicit/vectors/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x4/explicit/vectors/f32.wgsl.expected.wgsl index 9c51aa682a..05bc2e61d4 100644 --- a/test/tint/expressions/type_ctor/mat3x4/explicit/vectors/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat3x4/explicit/vectors/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat3x4(vec4(0.0, 1.0, 2.0, 3.0), vec4(4.0, 5.0, 6.0, 7.0), vec4(8.0, 9.0, 10.0, 11.0)); +let 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)); diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl new file mode 100644 index 0000000000..cce81618e0 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl @@ -0,0 +1,3 @@ +let m = mat3x4(0.0, 1.0, 2.0, 3.0, + 4.0, 5.0, 6.0, 7.0, + 8.0, 9.0, 10.0, 11.0); diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..824c533694 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const mat3x4 m = mat3x4(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f); diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..fae68dfa2d --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float3x4 m = 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)); diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..3608220014 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float3x4 m = 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)); + diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..b6ff57d5e3 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%mat3v4float = OpTypeMatrix %v4float 3 + %float_0 = OpConstant %float 0 + %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 + %float_4 = OpConstant %float 4 + %float_5 = OpConstant %float 5 + %float_6 = OpConstant %float 6 + %float_7 = OpConstant %float 7 + %13 = OpConstantComposite %v4float %float_4 %float_5 %float_6 %float_7 + %float_8 = OpConstant %float 8 + %float_9 = OpConstant %float 9 + %float_10 = OpConstant %float 10 + %float_11 = OpConstant %float 11 + %18 = OpConstantComposite %v4float %float_8 %float_9 %float_10 %float_11 + %m = OpConstantComposite %mat3v4float %8 %13 %18 + %void = OpTypeVoid + %20 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %20 + %23 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..5fce07ff64 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat3x4(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0); diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/f32.wgsl index cce81618e0..9af3d0e53d 100644 --- a/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/f32.wgsl @@ -1,3 +1,3 @@ -let m = mat3x4(0.0, 1.0, 2.0, 3.0, - 4.0, 5.0, 6.0, 7.0, - 8.0, 9.0, 10.0, 11.0); +let m = mat3x4(0.0f, 1.0f, 2.0f, 3.0f, + 4.0f, 5.0f, 6.0f, 7.0f, + 8.0f, 9.0f, 10.0f, 11.0f); diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/f32.wgsl.expected.wgsl index 5fce07ff64..8843467662 100644 --- a/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat3x4(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0); +let m = mat3x4(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f); diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl new file mode 100644 index 0000000000..cf638c26be --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl @@ -0,0 +1,3 @@ +let m = mat3x4(vec4(0.0, 1.0, 2.0, 3.0), + vec4(4.0, 5.0, 6.0, 7.0), + vec4(8.0, 9.0, 10.0, 11.0)); diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..2b8f5786b9 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +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)); diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..fae68dfa2d --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float3x4 m = 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)); diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..3608220014 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float3x4 m = 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)); + diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..b6ff57d5e3 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,36 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%mat3v4float = OpTypeMatrix %v4float 3 + %float_0 = OpConstant %float 0 + %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 + %float_4 = OpConstant %float 4 + %float_5 = OpConstant %float 5 + %float_6 = OpConstant %float 6 + %float_7 = OpConstant %float 7 + %13 = OpConstantComposite %v4float %float_4 %float_5 %float_6 %float_7 + %float_8 = OpConstant %float 8 + %float_9 = OpConstant %float 9 + %float_10 = OpConstant %float 10 + %float_11 = OpConstant %float 11 + %18 = OpConstantComposite %v4float %float_8 %float_9 %float_10 %float_11 + %m = OpConstantComposite %mat3v4float %8 %13 %18 + %void = OpTypeVoid + %20 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %20 + %23 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..4b5d529ee0 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat3x4(vec4(0.0, 1.0, 2.0, 3.0), vec4(4.0, 5.0, 6.0, 7.0), vec4(8.0, 9.0, 10.0, 11.0)); diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/f32.wgsl b/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/f32.wgsl index eb6fad25a3..32169b897f 100644 --- a/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/f32.wgsl @@ -1,3 +1,3 @@ -let m = mat3x4(vec4(0.0, 1.0, 2.0, 3.0), - vec4(4.0, 5.0, 6.0, 7.0), - vec4(8.0, 9.0, 10.0, 11.0)); +let 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)); diff --git a/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/f32.wgsl.expected.wgsl index 6d3960ee3d..7ce7445f9f 100644 --- a/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat3x4(vec4(0.0, 1.0, 2.0, 3.0), vec4(4.0, 5.0, 6.0, 7.0), vec4(8.0, 9.0, 10.0, 11.0)); +let 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)); diff --git a/test/tint/expressions/type_ctor/mat4x2/explicit/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat4x2/explicit/scalars/f32.wgsl index 0148e38439..51b68392bf 100644 --- a/test/tint/expressions/type_ctor/mat4x2/explicit/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat4x2/explicit/scalars/f32.wgsl @@ -1,4 +1,4 @@ -let m = mat4x2(0.0, 1.0, - 2.0, 3.0, - 4.0, 5.0, - 6.0, 7.0); +let m = mat4x2(0.0f, 1.0f, + 2.0f, 3.0f, + 4.0f, 5.0f, + 6.0f, 7.0f); diff --git a/test/tint/expressions/type_ctor/mat4x2/explicit/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x2/explicit/scalars/f32.wgsl.expected.wgsl index 5cb1e08bdd..f8b02e2c49 100644 --- a/test/tint/expressions/type_ctor/mat4x2/explicit/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat4x2/explicit/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat4x2(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); +let m = mat4x2(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f); diff --git a/test/tint/expressions/type_ctor/mat4x2/explicit/vectors/f32.wgsl b/test/tint/expressions/type_ctor/mat4x2/explicit/vectors/f32.wgsl index a1a32f807b..80b3345e34 100644 --- a/test/tint/expressions/type_ctor/mat4x2/explicit/vectors/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat4x2/explicit/vectors/f32.wgsl @@ -1,4 +1,4 @@ -let m = mat4x2(vec2(0.0, 1.0), - vec2(2.0, 3.0), - vec2(4.0, 5.0), - vec2(6.0, 7.0)); +let m = mat4x2(vec2(0.0f, 1.0f), + vec2(2.0f, 3.0f), + vec2(4.0f, 5.0f), + vec2(6.0f, 7.0f)); diff --git a/test/tint/expressions/type_ctor/mat4x2/explicit/vectors/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x2/explicit/vectors/f32.wgsl.expected.wgsl index dea4919d69..2d10da9ad2 100644 --- a/test/tint/expressions/type_ctor/mat4x2/explicit/vectors/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat4x2/explicit/vectors/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat4x2(vec2(0.0, 1.0), vec2(2.0, 3.0), vec2(4.0, 5.0), vec2(6.0, 7.0)); +let m = mat4x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f), vec2(6.0f, 7.0f)); diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl new file mode 100644 index 0000000000..f0946b93a5 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl @@ -0,0 +1,4 @@ +let m = mat4x2(0.0, 1.0, + 2.0, 3.0, + 4.0, 5.0, + 6.0, 7.0); diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..864c631eee --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const mat4x2 m = mat4x2(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f); diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..2acab36b4d --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float4x2 m = float4x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f), float2(6.0f, 7.0f)); diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..0597230800 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float4x2 m = float4x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f), float2(6.0f, 7.0f)); + diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..c6a6c63a6e --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,33 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v2float = OpTypeVector %float 2 +%mat4v2float = OpTypeMatrix %v2float 4 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %6 = OpConstantComposite %v2float %float_0 %float_1 + %float_2 = OpConstant %float 2 + %float_3 = OpConstant %float 3 + %9 = OpConstantComposite %v2float %float_2 %float_3 + %float_4 = OpConstant %float 4 + %float_5 = OpConstant %float 5 + %12 = OpConstantComposite %v2float %float_4 %float_5 + %float_6 = OpConstant %float 6 + %float_7 = OpConstant %float 7 + %15 = OpConstantComposite %v2float %float_6 %float_7 + %m = OpConstantComposite %mat4v2float %6 %9 %12 %15 + %void = OpTypeVoid + %17 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %17 + %20 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..8f695084f5 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat4x2(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/f32.wgsl index f0946b93a5..f5a544c0fb 100644 --- a/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/f32.wgsl @@ -1,4 +1,4 @@ -let m = mat4x2(0.0, 1.0, - 2.0, 3.0, - 4.0, 5.0, - 6.0, 7.0); +let m = mat4x2(0.0f, 1.0f, + 2.0f, 3.0f, + 4.0f, 5.0f, + 6.0f, 7.0f); diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/f32.wgsl.expected.wgsl index 8f695084f5..5c582f071c 100644 --- a/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat4x2(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0); +let m = mat4x2(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f); diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl new file mode 100644 index 0000000000..2d90c356dd --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl @@ -0,0 +1,4 @@ +let m = mat4x2(vec2(0.0, 1.0), + vec2(2.0, 3.0), + vec2(4.0, 5.0), + vec2(6.0, 7.0)); diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..93ae98cd4b --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const mat4x2 m = mat4x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f), vec2(6.0f, 7.0f)); diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..2acab36b4d --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float4x2 m = float4x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f), float2(6.0f, 7.0f)); diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..0597230800 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float4x2 m = float4x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f), float2(4.0f, 5.0f), float2(6.0f, 7.0f)); + diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..c6a6c63a6e --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,33 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 21 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v2float = OpTypeVector %float 2 +%mat4v2float = OpTypeMatrix %v2float 4 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %6 = OpConstantComposite %v2float %float_0 %float_1 + %float_2 = OpConstant %float 2 + %float_3 = OpConstant %float 3 + %9 = OpConstantComposite %v2float %float_2 %float_3 + %float_4 = OpConstant %float 4 + %float_5 = OpConstant %float 5 + %12 = OpConstantComposite %v2float %float_4 %float_5 + %float_6 = OpConstant %float 6 + %float_7 = OpConstant %float 7 + %15 = OpConstantComposite %v2float %float_6 %float_7 + %m = OpConstantComposite %mat4v2float %6 %9 %12 %15 + %void = OpTypeVoid + %17 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %17 + %20 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..17866498cb --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat4x2(vec2(0.0, 1.0), vec2(2.0, 3.0), vec2(4.0, 5.0), vec2(6.0, 7.0)); diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/f32.wgsl b/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/f32.wgsl index c1bd5eee1a..952511e952 100644 --- a/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/f32.wgsl @@ -1,4 +1,4 @@ -let m = mat4x2(vec2(0.0, 1.0), - vec2(2.0, 3.0), - vec2(4.0, 5.0), - vec2(6.0, 7.0)); +let m = mat4x2(vec2(0.0f, 1.0f), + vec2(2.0f, 3.0f), + vec2(4.0f, 5.0f), + vec2(6.0f, 7.0f)); diff --git a/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/f32.wgsl.expected.wgsl index ca404bf655..e585e38033 100644 --- a/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat4x2(vec2(0.0, 1.0), vec2(2.0, 3.0), vec2(4.0, 5.0), vec2(6.0, 7.0)); +let m = mat4x2(vec2(0.0f, 1.0f), vec2(2.0f, 3.0f), vec2(4.0f, 5.0f), vec2(6.0f, 7.0f)); diff --git a/test/tint/expressions/type_ctor/mat4x3/explicit/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat4x3/explicit/scalars/f32.wgsl index d29dcf731b..4dcaf4c892 100644 --- a/test/tint/expressions/type_ctor/mat4x3/explicit/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat4x3/explicit/scalars/f32.wgsl @@ -1,4 +1,4 @@ -let m = mat4x3(0.0, 1.0, 2.0, - 3.0, 4.0, 5.0, - 6.0, 7.0, 8.0, - 9.0, 10.0, 11.0); +let m = mat4x3(0.0f, 1.0f, 2.0f, + 3.0f, 4.0f, 5.0f, + 6.0f, 7.0f, 8.0f, + 9.0f, 10.0f, 11.0f); diff --git a/test/tint/expressions/type_ctor/mat4x3/explicit/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x3/explicit/scalars/f32.wgsl.expected.wgsl index 2172728eb5..dbe4773a8f 100644 --- a/test/tint/expressions/type_ctor/mat4x3/explicit/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat4x3/explicit/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat4x3(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0); +let m = mat4x3(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f); diff --git a/test/tint/expressions/type_ctor/mat4x3/explicit/vectors/f32.wgsl b/test/tint/expressions/type_ctor/mat4x3/explicit/vectors/f32.wgsl index 7f218e143d..74b3e9c652 100644 --- a/test/tint/expressions/type_ctor/mat4x3/explicit/vectors/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat4x3/explicit/vectors/f32.wgsl @@ -1,4 +1,4 @@ -let m = mat4x3(vec3(0.0, 1.0, 2.0), - vec3(3.0, 4.0, 5.0), - vec3(6.0, 7.0, 8.0), - vec3(9.0, 10.0, 11.0)); +let 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)); diff --git a/test/tint/expressions/type_ctor/mat4x3/explicit/vectors/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x3/explicit/vectors/f32.wgsl.expected.wgsl index ae271221da..2196b1e2f5 100644 --- a/test/tint/expressions/type_ctor/mat4x3/explicit/vectors/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat4x3/explicit/vectors/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat4x3(vec3(0.0, 1.0, 2.0), vec3(3.0, 4.0, 5.0), vec3(6.0, 7.0, 8.0), vec3(9.0, 10.0, 11.0)); +let 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)); diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl new file mode 100644 index 0000000000..32326a9ed8 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl @@ -0,0 +1,4 @@ +let m = mat4x3(0.0, 1.0, 2.0, + 3.0, 4.0, 5.0, + 6.0, 7.0, 8.0, + 9.0, 10.0, 11.0); diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..d18bd377c5 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const mat4x3 m = mat4x3(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f); diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..254cc408e6 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float4x3 m = 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)); diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..d935650860 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float4x3 m = 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)); + diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..d99b492f7e --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v3float = OpTypeVector %float 3 +%mat4v3float = OpTypeMatrix %v3float 4 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %float_2 = OpConstant %float 2 + %7 = OpConstantComposite %v3float %float_0 %float_1 %float_2 + %float_3 = OpConstant %float 3 + %float_4 = OpConstant %float 4 + %float_5 = OpConstant %float 5 + %11 = OpConstantComposite %v3float %float_3 %float_4 %float_5 + %float_6 = OpConstant %float 6 + %float_7 = OpConstant %float 7 + %float_8 = OpConstant %float 8 + %15 = OpConstantComposite %v3float %float_6 %float_7 %float_8 + %float_9 = OpConstant %float 9 + %float_10 = OpConstant %float 10 + %float_11 = OpConstant %float 11 + %19 = OpConstantComposite %v3float %float_9 %float_10 %float_11 + %m = OpConstantComposite %mat4v3float %7 %11 %15 %19 + %void = OpTypeVoid + %21 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %21 + %24 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..209a37625f --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat4x3(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0); diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/f32.wgsl index 32326a9ed8..f9dd14646a 100644 --- a/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/f32.wgsl @@ -1,4 +1,4 @@ -let m = mat4x3(0.0, 1.0, 2.0, - 3.0, 4.0, 5.0, - 6.0, 7.0, 8.0, - 9.0, 10.0, 11.0); +let m = mat4x3(0.0f, 1.0f, 2.0f, + 3.0f, 4.0f, 5.0f, + 6.0f, 7.0f, 8.0f, + 9.0f, 10.0f, 11.0f); diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/f32.wgsl.expected.wgsl index 209a37625f..424df3dd4b 100644 --- a/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat4x3(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0); +let m = mat4x3(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f); diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl new file mode 100644 index 0000000000..8a80c15412 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl @@ -0,0 +1,4 @@ +let m = mat4x3(vec3(0.0, 1.0, 2.0), + vec3(3.0, 4.0, 5.0), + vec3(6.0, 7.0, 8.0), + vec3(9.0, 10.0, 11.0)); diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..532369fbf2 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +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)); diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..254cc408e6 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float4x3 m = 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)); diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..d935650860 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float4x3 m = 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)); + diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..d99b492f7e --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,37 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v3float = OpTypeVector %float 3 +%mat4v3float = OpTypeMatrix %v3float 4 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %float_2 = OpConstant %float 2 + %7 = OpConstantComposite %v3float %float_0 %float_1 %float_2 + %float_3 = OpConstant %float 3 + %float_4 = OpConstant %float 4 + %float_5 = OpConstant %float 5 + %11 = OpConstantComposite %v3float %float_3 %float_4 %float_5 + %float_6 = OpConstant %float 6 + %float_7 = OpConstant %float 7 + %float_8 = OpConstant %float 8 + %15 = OpConstantComposite %v3float %float_6 %float_7 %float_8 + %float_9 = OpConstant %float 9 + %float_10 = OpConstant %float 10 + %float_11 = OpConstant %float 11 + %19 = OpConstantComposite %v3float %float_9 %float_10 %float_11 + %m = OpConstantComposite %mat4v3float %7 %11 %15 %19 + %void = OpTypeVoid + %21 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %21 + %24 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..6e9e96bbfd --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat4x3(vec3(0.0, 1.0, 2.0), vec3(3.0, 4.0, 5.0), vec3(6.0, 7.0, 8.0), vec3(9.0, 10.0, 11.0)); diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/f32.wgsl b/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/f32.wgsl index a3ae9f2839..d6c8650f72 100644 --- a/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/f32.wgsl @@ -1,4 +1,4 @@ -let m = mat4x3(vec3(0.0, 1.0, 2.0), - vec3(3.0, 4.0, 5.0), - vec3(6.0, 7.0, 8.0), - vec3(9.0, 10.0, 11.0)); +let 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)); diff --git a/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/f32.wgsl.expected.wgsl index ca7b45f34e..eddcb09456 100644 --- a/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat4x3(vec3(0.0, 1.0, 2.0), vec3(3.0, 4.0, 5.0), vec3(6.0, 7.0, 8.0), vec3(9.0, 10.0, 11.0)); +let 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)); diff --git a/test/tint/expressions/type_ctor/mat4x4/explicit/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat4x4/explicit/scalars/f32.wgsl index b89957b6f7..8ab5b1608f 100644 --- a/test/tint/expressions/type_ctor/mat4x4/explicit/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat4x4/explicit/scalars/f32.wgsl @@ -1,4 +1,4 @@ -let m = mat4x4(0.0, 1.0, 2.0, 3.0, - 4.0, 5.0, 6.0, 7.0, - 8.0, 9.0, 10.0, 11.0, - 12.0, 13.0, 14.0, 15.0); +let m = mat4x4(0.0f, 1.0f, 2.0f, 3.0f, + 4.0f, 5.0f, 6.0f, 7.0f, + 8.0f, 9.0f, 10.0f, 11.0f, + 12.0f, 13.0f, 14.0f, 15.0f); diff --git a/test/tint/expressions/type_ctor/mat4x4/explicit/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x4/explicit/scalars/f32.wgsl.expected.wgsl index 5916e6a519..36fe95df21 100644 --- a/test/tint/expressions/type_ctor/mat4x4/explicit/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat4x4/explicit/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat4x4(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0); +let m = mat4x4(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f); diff --git a/test/tint/expressions/type_ctor/mat4x4/explicit/vectors/f32.wgsl b/test/tint/expressions/type_ctor/mat4x4/explicit/vectors/f32.wgsl index 02b4118093..be1d34217f 100644 --- a/test/tint/expressions/type_ctor/mat4x4/explicit/vectors/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat4x4/explicit/vectors/f32.wgsl @@ -1,4 +1,4 @@ -let m = mat4x4(vec4(0.0, 1.0, 2.0, 3.0), - vec4(4.0, 5.0, 6.0, 7.0), - vec4(8.0, 9.0, 10.0, 11.0), - vec4(12.0, 13.0, 14.0, 15.0)); +let m = mat4x4(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)); diff --git a/test/tint/expressions/type_ctor/mat4x4/explicit/vectors/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x4/explicit/vectors/f32.wgsl.expected.wgsl index 6bdb25745f..a09649c479 100644 --- a/test/tint/expressions/type_ctor/mat4x4/explicit/vectors/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat4x4/explicit/vectors/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat4x4(vec4(0.0, 1.0, 2.0, 3.0), vec4(4.0, 5.0, 6.0, 7.0), vec4(8.0, 9.0, 10.0, 11.0), vec4(12.0, 13.0, 14.0, 15.0)); +let m = mat4x4(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)); diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl new file mode 100644 index 0000000000..571610f480 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl @@ -0,0 +1,4 @@ +let m = mat4x4(0.0, 1.0, 2.0, 3.0, + 4.0, 5.0, 6.0, 7.0, + 8.0, 9.0, 10.0, 11.0, + 12.0, 13.0, 14.0, 15.0); diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..c1bb385a4c --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const mat4 m = mat4(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f); diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..270799912a --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float4x4 m = 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)); diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..053e23dbe9 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float4x4 m = 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)); + diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..84a8f8962d --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%mat4v4float = OpTypeMatrix %v4float 4 + %float_0 = OpConstant %float 0 + %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 + %float_4 = OpConstant %float 4 + %float_5 = OpConstant %float 5 + %float_6 = OpConstant %float 6 + %float_7 = OpConstant %float 7 + %13 = OpConstantComposite %v4float %float_4 %float_5 %float_6 %float_7 + %float_8 = OpConstant %float 8 + %float_9 = OpConstant %float 9 + %float_10 = OpConstant %float 10 + %float_11 = OpConstant %float 11 + %18 = OpConstantComposite %v4float %float_8 %float_9 %float_10 %float_11 + %float_12 = OpConstant %float 12 + %float_13 = OpConstant %float 13 + %float_14 = OpConstant %float 14 + %float_15 = OpConstant %float 15 + %23 = OpConstantComposite %v4float %float_12 %float_13 %float_14 %float_15 + %m = OpConstantComposite %mat4v4float %8 %13 %18 %23 + %void = OpTypeVoid + %25 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %25 + %28 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..33b0598be3 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat4x4(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0); diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/f32.wgsl b/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/f32.wgsl index 571610f480..a47089b116 100644 --- a/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/f32.wgsl @@ -1,4 +1,4 @@ -let m = mat4x4(0.0, 1.0, 2.0, 3.0, - 4.0, 5.0, 6.0, 7.0, - 8.0, 9.0, 10.0, 11.0, - 12.0, 13.0, 14.0, 15.0); +let m = mat4x4(0.0f, 1.0f, 2.0f, 3.0f, + 4.0f, 5.0f, 6.0f, 7.0f, + 8.0f, 9.0f, 10.0f, 11.0f, + 12.0f, 13.0f, 14.0f, 15.0f); diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/f32.wgsl.expected.wgsl index 33b0598be3..2374280d5d 100644 --- a/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat4x4(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0); +let m = mat4x4(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f); diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl b/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl new file mode 100644 index 0000000000..a11a785eb2 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl @@ -0,0 +1,4 @@ +let m = mat4x4(vec4(0.0, 1.0, 2.0, 3.0), + vec4(4.0, 5.0, 6.0, 7.0), + vec4(8.0, 9.0, 10.0, 11.0), + vec4(12.0, 13.0, 14.0, 15.0)); diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..b86a544c92 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +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)); diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..270799912a --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float4x4 m = 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)); diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..053e23dbe9 --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float4x4 m = 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)); + diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..84a8f8962d --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %m "m" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%mat4v4float = OpTypeMatrix %v4float 4 + %float_0 = OpConstant %float 0 + %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 + %float_4 = OpConstant %float 4 + %float_5 = OpConstant %float 5 + %float_6 = OpConstant %float 6 + %float_7 = OpConstant %float 7 + %13 = OpConstantComposite %v4float %float_4 %float_5 %float_6 %float_7 + %float_8 = OpConstant %float 8 + %float_9 = OpConstant %float 9 + %float_10 = OpConstant %float 10 + %float_11 = OpConstant %float 11 + %18 = OpConstantComposite %v4float %float_8 %float_9 %float_10 %float_11 + %float_12 = OpConstant %float 12 + %float_13 = OpConstant %float 13 + %float_14 = OpConstant %float 14 + %float_15 = OpConstant %float 15 + %23 = OpConstantComposite %v4float %float_12 %float_13 %float_14 %float_15 + %m = OpConstantComposite %mat4v4float %8 %13 %18 %23 + %void = OpTypeVoid + %25 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %25 + %28 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..faf14ff03c --- /dev/null +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let m = mat4x4(vec4(0.0, 1.0, 2.0, 3.0), vec4(4.0, 5.0, 6.0, 7.0), vec4(8.0, 9.0, 10.0, 11.0), vec4(12.0, 13.0, 14.0, 15.0)); diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/f32.wgsl b/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/f32.wgsl index 1e2c0d775f..77740a21b2 100644 --- a/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/f32.wgsl +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/f32.wgsl @@ -1,4 +1,4 @@ -let m = mat4x4(vec4(0.0, 1.0, 2.0, 3.0), - vec4(4.0, 5.0, 6.0, 7.0), - vec4(8.0, 9.0, 10.0, 11.0), - vec4(12.0, 13.0, 14.0, 15.0)); +let m = mat4x4(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)); diff --git a/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/f32.wgsl.expected.wgsl index b022afe64a..7bbde6baa9 100644 --- a/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let m = mat4x4(vec4(0.0, 1.0, 2.0, 3.0), vec4(4.0, 5.0, 6.0, 7.0), vec4(8.0, 9.0, 10.0, 11.0), vec4(12.0, 13.0, 14.0, 15.0)); +let m = mat4x4(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)); diff --git a/test/tint/expressions/type_ctor/vec2/explicit/f32.wgsl b/test/tint/expressions/type_ctor/vec2/explicit/f32.wgsl index 87b10550fd..074655c917 100644 --- a/test/tint/expressions/type_ctor/vec2/explicit/f32.wgsl +++ b/test/tint/expressions/type_ctor/vec2/explicit/f32.wgsl @@ -1 +1 @@ -let v = vec2(0.0, 1.0); +let v = vec2(0.0f, 1.0f); diff --git a/test/tint/expressions/type_ctor/vec2/explicit/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec2/explicit/f32.wgsl.expected.wgsl index 87b10550fd..074655c917 100644 --- a/test/tint/expressions/type_ctor/vec2/explicit/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/vec2/explicit/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let v = vec2(0.0, 1.0); +let v = vec2(0.0f, 1.0f); diff --git a/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl b/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl new file mode 100644 index 0000000000..e0e5dc904f --- /dev/null +++ b/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl @@ -0,0 +1 @@ +let v = vec2(0.0, 1.0); diff --git a/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..af91949ceb --- /dev/null +++ b/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const vec2 v = vec2(0.0f, 1.0f); diff --git a/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..8802bbb621 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float2 v = float2(0.0f, 1.0f); diff --git a/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..f343a2593e --- /dev/null +++ b/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float2 v = float2(0.0f, 1.0f); + diff --git a/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..d12bbf2285 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,22 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 10 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %v "v" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v2float = OpTypeVector %float 2 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %v = OpConstantComposite %v2float %float_0 %float_1 + %void = OpTypeVoid + %6 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %6 + %9 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..e0e5dc904f --- /dev/null +++ b/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let v = vec2(0.0, 1.0); diff --git a/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl b/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl new file mode 100644 index 0000000000..de5642e08a --- /dev/null +++ b/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl @@ -0,0 +1 @@ +let v = vec2(0, 1); diff --git a/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl.expected.glsl b/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl.expected.glsl new file mode 100644 index 0000000000..ebef7ff07d --- /dev/null +++ b/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const ivec2 v = ivec2(0, 1); diff --git a/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl.expected.hlsl new file mode 100644 index 0000000000..afa632e39a --- /dev/null +++ b/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const int2 v = int2(0, 1); diff --git a/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl.expected.msl b/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl.expected.msl new file mode 100644 index 0000000000..af85d231cc --- /dev/null +++ b/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant int2 v = int2(0, 1); + diff --git a/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl.expected.spvasm new file mode 100644 index 0000000000..2e021f90e8 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl.expected.spvasm @@ -0,0 +1,22 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 10 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %v "v" + OpName %unused_entry_point "unused_entry_point" + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %int_0 = OpConstant %int 0 + %int_1 = OpConstant %int 1 + %v = OpConstantComposite %v2int %int_0 %int_1 + %void = OpTypeVoid + %6 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %6 + %9 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl.expected.wgsl new file mode 100644 index 0000000000..de5642e08a --- /dev/null +++ b/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl.expected.wgsl @@ -0,0 +1 @@ +let v = vec2(0, 1); diff --git a/test/tint/expressions/type_ctor/vec2/inferred/f32.wgsl b/test/tint/expressions/type_ctor/vec2/inferred/f32.wgsl index e0e5dc904f..3ca3308d24 100644 --- a/test/tint/expressions/type_ctor/vec2/inferred/f32.wgsl +++ b/test/tint/expressions/type_ctor/vec2/inferred/f32.wgsl @@ -1 +1 @@ -let v = vec2(0.0, 1.0); +let v = vec2(0.0f, 1.0f); diff --git a/test/tint/expressions/type_ctor/vec2/inferred/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec2/inferred/f32.wgsl.expected.wgsl index e0e5dc904f..3ca3308d24 100644 --- a/test/tint/expressions/type_ctor/vec2/inferred/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/vec2/inferred/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let v = vec2(0.0, 1.0); +let v = vec2(0.0f, 1.0f); diff --git a/test/tint/expressions/type_ctor/vec2/inferred/i32.wgsl b/test/tint/expressions/type_ctor/vec2/inferred/i32.wgsl index de5642e08a..7207f3436b 100644 --- a/test/tint/expressions/type_ctor/vec2/inferred/i32.wgsl +++ b/test/tint/expressions/type_ctor/vec2/inferred/i32.wgsl @@ -1 +1 @@ -let v = vec2(0, 1); +let v = vec2(0i, 1i); diff --git a/test/tint/expressions/type_ctor/vec2/inferred/i32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec2/inferred/i32.wgsl.expected.wgsl index de5642e08a..7207f3436b 100644 --- a/test/tint/expressions/type_ctor/vec2/inferred/i32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/vec2/inferred/i32.wgsl.expected.wgsl @@ -1 +1 @@ -let v = vec2(0, 1); +let v = vec2(0i, 1i); diff --git a/test/tint/expressions/type_ctor/vec3/explicit/bool.wgsl b/test/tint/expressions/type_ctor/vec3/explicit/bool.wgsl index 9f3a1f3852..0acf3bf9cb 100644 --- a/test/tint/expressions/type_ctor/vec3/explicit/bool.wgsl +++ b/test/tint/expressions/type_ctor/vec3/explicit/bool.wgsl @@ -1 +1 @@ -let v = vec3(false, true, false); +let v = vec3(false, true, false); diff --git a/test/tint/expressions/type_ctor/vec3/explicit/bool.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec3/explicit/bool.wgsl.expected.wgsl index 9f3a1f3852..0acf3bf9cb 100644 --- a/test/tint/expressions/type_ctor/vec3/explicit/bool.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/vec3/explicit/bool.wgsl.expected.wgsl @@ -1 +1 @@ -let v = vec3(false, true, false); +let v = vec3(false, true, false); diff --git a/test/tint/expressions/type_ctor/vec3/explicit/f32.wgsl b/test/tint/expressions/type_ctor/vec3/explicit/f32.wgsl index 376f901c51..0978438943 100644 --- a/test/tint/expressions/type_ctor/vec3/explicit/f32.wgsl +++ b/test/tint/expressions/type_ctor/vec3/explicit/f32.wgsl @@ -1 +1 @@ -let v = vec3(0.0, 1.0, 2.0); +let v = vec3(0.0f, 1.0f, 2.0f); diff --git a/test/tint/expressions/type_ctor/vec3/explicit/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec3/explicit/f32.wgsl.expected.wgsl index 376f901c51..0978438943 100644 --- a/test/tint/expressions/type_ctor/vec3/explicit/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/vec3/explicit/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let v = vec3(0.0, 1.0, 2.0); +let v = vec3(0.0f, 1.0f, 2.0f); diff --git a/test/tint/expressions/type_ctor/vec3/explicit/i32.wgsl b/test/tint/expressions/type_ctor/vec3/explicit/i32.wgsl index 7b9ebcb87e..605fa301ee 100644 --- a/test/tint/expressions/type_ctor/vec3/explicit/i32.wgsl +++ b/test/tint/expressions/type_ctor/vec3/explicit/i32.wgsl @@ -1 +1 @@ -let v = vec3(0, 1, 2); +let v = vec3(0i, 1i, 2i); diff --git a/test/tint/expressions/type_ctor/vec3/explicit/i32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec3/explicit/i32.wgsl.expected.wgsl index 7b9ebcb87e..605fa301ee 100644 --- a/test/tint/expressions/type_ctor/vec3/explicit/i32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/vec3/explicit/i32.wgsl.expected.wgsl @@ -1 +1 @@ -let v = vec3(0, 1, 2); +let v = vec3(0i, 1i, 2i); diff --git a/test/tint/expressions/type_ctor/vec3/explicit/u32.wgsl b/test/tint/expressions/type_ctor/vec3/explicit/u32.wgsl index 0040d27e6c..111a1d3ad0 100644 --- a/test/tint/expressions/type_ctor/vec3/explicit/u32.wgsl +++ b/test/tint/expressions/type_ctor/vec3/explicit/u32.wgsl @@ -1 +1 @@ -let v = vec3(0u, 1u, 2u); +let v = vec3(0u, 1u, 2u); diff --git a/test/tint/expressions/type_ctor/vec3/explicit/u32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec3/explicit/u32.wgsl.expected.wgsl index 0040d27e6c..111a1d3ad0 100644 --- a/test/tint/expressions/type_ctor/vec3/explicit/u32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/vec3/explicit/u32.wgsl.expected.wgsl @@ -1 +1 @@ -let v = vec3(0u, 1u, 2u); +let v = vec3(0u, 1u, 2u); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl b/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl new file mode 100644 index 0000000000..376f901c51 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl @@ -0,0 +1 @@ +let v = vec3(0.0, 1.0, 2.0); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..9f73b75785 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const vec3 v = vec3(0.0f, 1.0f, 2.0f); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..daa5a1c21d --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float3 v = float3(0.0f, 1.0f, 2.0f); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..b0b245a391 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float3 v = float3(0.0f, 1.0f, 2.0f); + diff --git a/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..62e8bc30c7 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,23 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 11 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %v "v" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v3float = OpTypeVector %float 3 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %float_2 = OpConstant %float 2 + %v = OpConstantComposite %v3float %float_0 %float_1 %float_2 + %void = OpTypeVoid + %7 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %7 + %10 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..376f901c51 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let v = vec3(0.0, 1.0, 2.0); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl b/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl new file mode 100644 index 0000000000..7b9ebcb87e --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl @@ -0,0 +1 @@ +let v = vec3(0, 1, 2); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl.expected.glsl b/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl.expected.glsl new file mode 100644 index 0000000000..0392e707da --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const ivec3 v = ivec3(0, 1, 2); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl.expected.hlsl new file mode 100644 index 0000000000..9bc1dc4652 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const int3 v = int3(0, 1, 2); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl.expected.msl b/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl.expected.msl new file mode 100644 index 0000000000..63fbce8f89 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant int3 v = int3(0, 1, 2); + diff --git a/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl.expected.spvasm new file mode 100644 index 0000000000..fe0276e9ba --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl.expected.spvasm @@ -0,0 +1,23 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 11 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %v "v" + OpName %unused_entry_point "unused_entry_point" + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_0 = OpConstant %int 0 + %int_1 = OpConstant %int 1 + %int_2 = OpConstant %int 2 + %v = OpConstantComposite %v3int %int_0 %int_1 %int_2 + %void = OpTypeVoid + %7 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %7 + %10 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl.expected.wgsl new file mode 100644 index 0000000000..7b9ebcb87e --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl.expected.wgsl @@ -0,0 +1 @@ +let v = vec3(0, 1, 2); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl b/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl new file mode 100644 index 0000000000..9f3a1f3852 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl @@ -0,0 +1 @@ +let v = vec3(false, true, false); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl.expected.glsl b/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl.expected.glsl new file mode 100644 index 0000000000..e7d7818003 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const bvec3 v = bvec3(false, true, false); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl.expected.hlsl new file mode 100644 index 0000000000..d5acfa022d --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const bool3 v = bool3(false, true, false); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl.expected.msl b/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl.expected.msl new file mode 100644 index 0000000000..0cd9b5b483 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant bool3 v = bool3(false, true, false); + diff --git a/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl.expected.spvasm new file mode 100644 index 0000000000..b712760ab3 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl.expected.spvasm @@ -0,0 +1,22 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 10 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %v "v" + OpName %unused_entry_point "unused_entry_point" + %bool = OpTypeBool + %v3bool = OpTypeVector %bool 3 + %false = OpConstantFalse %bool + %true = OpConstantTrue %bool + %v = OpConstantComposite %v3bool %false %true %false + %void = OpTypeVoid + %6 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %6 + %9 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl.expected.wgsl new file mode 100644 index 0000000000..9f3a1f3852 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl.expected.wgsl @@ -0,0 +1 @@ +let v = vec3(false, true, false); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl b/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl new file mode 100644 index 0000000000..e09c928751 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl @@ -0,0 +1 @@ +let v = vec3(0.0f, 1.0f, 2.0f); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl.expected.glsl new file mode 100644 index 0000000000..9f73b75785 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const vec3 v = vec3(0.0f, 1.0f, 2.0f); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl.expected.hlsl new file mode 100644 index 0000000000..daa5a1c21d --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float3 v = float3(0.0f, 1.0f, 2.0f); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl.expected.msl new file mode 100644 index 0000000000..b0b245a391 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float3 v = float3(0.0f, 1.0f, 2.0f); + diff --git a/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl.expected.spvasm new file mode 100644 index 0000000000..62e8bc30c7 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl.expected.spvasm @@ -0,0 +1,23 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 11 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %v "v" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v3float = OpTypeVector %float 3 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %float_2 = OpConstant %float 2 + %v = OpConstantComposite %v3float %float_0 %float_1 %float_2 + %void = OpTypeVoid + %7 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %7 + %10 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl.expected.wgsl new file mode 100644 index 0000000000..e09c928751 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl.expected.wgsl @@ -0,0 +1 @@ +let v = vec3(0.0f, 1.0f, 2.0f); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl b/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl new file mode 100644 index 0000000000..73cd9730fb --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl @@ -0,0 +1 @@ +let v = vec3(0i, 1i, 2i); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl.expected.glsl new file mode 100644 index 0000000000..0392e707da --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const ivec3 v = ivec3(0, 1, 2); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl.expected.hlsl new file mode 100644 index 0000000000..9bc1dc4652 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const int3 v = int3(0, 1, 2); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl.expected.msl b/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl.expected.msl new file mode 100644 index 0000000000..63fbce8f89 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant int3 v = int3(0, 1, 2); + diff --git a/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl.expected.spvasm new file mode 100644 index 0000000000..fe0276e9ba --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl.expected.spvasm @@ -0,0 +1,23 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 11 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %v "v" + OpName %unused_entry_point "unused_entry_point" + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_0 = OpConstant %int 0 + %int_1 = OpConstant %int 1 + %int_2 = OpConstant %int 2 + %v = OpConstantComposite %v3int %int_0 %int_1 %int_2 + %void = OpTypeVoid + %7 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %7 + %10 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl.expected.wgsl new file mode 100644 index 0000000000..73cd9730fb --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl.expected.wgsl @@ -0,0 +1 @@ +let v = vec3(0i, 1i, 2i); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl b/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl new file mode 100644 index 0000000000..0040d27e6c --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl @@ -0,0 +1 @@ +let v = vec3(0u, 1u, 2u); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl.expected.glsl new file mode 100644 index 0000000000..1aabf2da89 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const uvec3 v = uvec3(0u, 1u, 2u); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl.expected.hlsl new file mode 100644 index 0000000000..18899ea0d3 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const uint3 v = uint3(0u, 1u, 2u); diff --git a/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl.expected.msl b/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl.expected.msl new file mode 100644 index 0000000000..6090ecfdc8 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant uint3 v = uint3(0u, 1u, 2u); + diff --git a/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl.expected.spvasm new file mode 100644 index 0000000000..e4b4797464 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl.expected.spvasm @@ -0,0 +1,23 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 11 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %v "v" + OpName %unused_entry_point "unused_entry_point" + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 + %uint_2 = OpConstant %uint 2 + %v = OpConstantComposite %v3uint %uint_0 %uint_1 %uint_2 + %void = OpTypeVoid + %7 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %7 + %10 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl.expected.wgsl new file mode 100644 index 0000000000..0040d27e6c --- /dev/null +++ b/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl.expected.wgsl @@ -0,0 +1 @@ +let v = vec3(0u, 1u, 2u); diff --git a/test/tint/expressions/type_ctor/vec4/explicit/f32.wgsl b/test/tint/expressions/type_ctor/vec4/explicit/f32.wgsl index bb1280e19d..5a04e5ba0d 100644 --- a/test/tint/expressions/type_ctor/vec4/explicit/f32.wgsl +++ b/test/tint/expressions/type_ctor/vec4/explicit/f32.wgsl @@ -1 +1 @@ -let v = vec4(0.0, 1.0, 2.0, 3.0); +let v = vec4(0.f, 1.f, 2.f, 3.f); diff --git a/test/tint/expressions/type_ctor/vec4/explicit/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec4/explicit/f32.wgsl.expected.wgsl index bb1280e19d..89c6254ef3 100644 --- a/test/tint/expressions/type_ctor/vec4/explicit/f32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/vec4/explicit/f32.wgsl.expected.wgsl @@ -1 +1 @@ -let v = vec4(0.0, 1.0, 2.0, 3.0); +let v = vec4(0.0f, 1.0f, 2.0f, 3.0f); diff --git a/test/tint/expressions/type_ctor/vec4/explicit/i32.wgsl b/test/tint/expressions/type_ctor/vec4/explicit/i32.wgsl index ab60e6e781..38a4ff8f91 100644 --- a/test/tint/expressions/type_ctor/vec4/explicit/i32.wgsl +++ b/test/tint/expressions/type_ctor/vec4/explicit/i32.wgsl @@ -1 +1 @@ -let v = vec4(0, 1, 2, 3); +let v = vec4(0i, 1i, 2i, 3i); diff --git a/test/tint/expressions/type_ctor/vec4/explicit/i32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec4/explicit/i32.wgsl.expected.wgsl index ab60e6e781..38a4ff8f91 100644 --- a/test/tint/expressions/type_ctor/vec4/explicit/i32.wgsl.expected.wgsl +++ b/test/tint/expressions/type_ctor/vec4/explicit/i32.wgsl.expected.wgsl @@ -1 +1 @@ -let v = vec4(0, 1, 2, 3); +let v = vec4(0i, 1i, 2i, 3i); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl b/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl new file mode 100644 index 0000000000..bb1280e19d --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl @@ -0,0 +1 @@ +let v = vec4(0.0, 1.0, 2.0, 3.0); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl.expected.glsl b/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl.expected.glsl new file mode 100644 index 0000000000..254bda9e7a --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const vec4 v = vec4(0.0f, 1.0f, 2.0f, 3.0f); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl.expected.hlsl new file mode 100644 index 0000000000..bd679f3022 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float4 v = float4(0.0f, 1.0f, 2.0f, 3.0f); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl.expected.msl b/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl.expected.msl new file mode 100644 index 0000000000..568e746ed8 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float4 v = float4(0.0f, 1.0f, 2.0f, 3.0f); + diff --git a/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl.expected.spvasm new file mode 100644 index 0000000000..783aa84a45 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl.expected.spvasm @@ -0,0 +1,24 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 12 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %v "v" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %float_2 = OpConstant %float 2 + %float_3 = OpConstant %float 3 + %v = OpConstantComposite %v4float %float_0 %float_1 %float_2 %float_3 + %void = OpTypeVoid + %8 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %8 + %11 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl.expected.wgsl new file mode 100644 index 0000000000..bb1280e19d --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl.expected.wgsl @@ -0,0 +1 @@ +let v = vec4(0.0, 1.0, 2.0, 3.0); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl b/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl new file mode 100644 index 0000000000..ab60e6e781 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl @@ -0,0 +1 @@ +let v = vec4(0, 1, 2, 3); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl.expected.glsl b/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl.expected.glsl new file mode 100644 index 0000000000..77c907bcd1 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const ivec4 v = ivec4(0, 1, 2, 3); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl.expected.hlsl new file mode 100644 index 0000000000..58b86cecad --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const int4 v = int4(0, 1, 2, 3); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl.expected.msl b/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl.expected.msl new file mode 100644 index 0000000000..f00d2ebbd7 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant int4 v = int4(0, 1, 2, 3); + diff --git a/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl.expected.spvasm new file mode 100644 index 0000000000..88201cc543 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl.expected.spvasm @@ -0,0 +1,24 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 12 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %v "v" + OpName %unused_entry_point "unused_entry_point" + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 + %int_0 = OpConstant %int 0 + %int_1 = OpConstant %int 1 + %int_2 = OpConstant %int 2 + %int_3 = OpConstant %int 3 + %v = OpConstantComposite %v4int %int_0 %int_1 %int_2 %int_3 + %void = OpTypeVoid + %8 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %8 + %11 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl.expected.wgsl new file mode 100644 index 0000000000..ab60e6e781 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl.expected.wgsl @@ -0,0 +1 @@ +let v = vec4(0, 1, 2, 3); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl b/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl new file mode 100644 index 0000000000..baeff0f35f --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl @@ -0,0 +1 @@ +let v = vec4(false, true, false, true); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl.expected.glsl b/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl.expected.glsl new file mode 100644 index 0000000000..11236dbca8 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const bvec4 v = bvec4(false, true, false, true); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl.expected.hlsl new file mode 100644 index 0000000000..af7e30f4e6 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const bool4 v = bool4(false, true, false, true); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl.expected.msl b/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl.expected.msl new file mode 100644 index 0000000000..840b113e49 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant bool4 v = bool4(false, true, false, true); + diff --git a/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl.expected.spvasm new file mode 100644 index 0000000000..1ecbff115e --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl.expected.spvasm @@ -0,0 +1,22 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 10 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %v "v" + OpName %unused_entry_point "unused_entry_point" + %bool = OpTypeBool + %v4bool = OpTypeVector %bool 4 + %false = OpConstantFalse %bool + %true = OpConstantTrue %bool + %v = OpConstantComposite %v4bool %false %true %false %true + %void = OpTypeVoid + %6 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %6 + %9 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl.expected.wgsl new file mode 100644 index 0000000000..baeff0f35f --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl.expected.wgsl @@ -0,0 +1 @@ +let v = vec4(false, true, false, true); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl b/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl new file mode 100644 index 0000000000..89c6254ef3 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl @@ -0,0 +1 @@ +let v = vec4(0.0f, 1.0f, 2.0f, 3.0f); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl.expected.glsl new file mode 100644 index 0000000000..254bda9e7a --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const vec4 v = vec4(0.0f, 1.0f, 2.0f, 3.0f); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl.expected.hlsl new file mode 100644 index 0000000000..bd679f3022 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const float4 v = float4(0.0f, 1.0f, 2.0f, 3.0f); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl.expected.msl b/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl.expected.msl new file mode 100644 index 0000000000..568e746ed8 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant float4 v = float4(0.0f, 1.0f, 2.0f, 3.0f); + diff --git a/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl.expected.spvasm new file mode 100644 index 0000000000..783aa84a45 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl.expected.spvasm @@ -0,0 +1,24 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 12 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %v "v" + OpName %unused_entry_point "unused_entry_point" + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %float_0 = OpConstant %float 0 + %float_1 = OpConstant %float 1 + %float_2 = OpConstant %float 2 + %float_3 = OpConstant %float 3 + %v = OpConstantComposite %v4float %float_0 %float_1 %float_2 %float_3 + %void = OpTypeVoid + %8 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %8 + %11 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl.expected.wgsl new file mode 100644 index 0000000000..89c6254ef3 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl.expected.wgsl @@ -0,0 +1 @@ +let v = vec4(0.0f, 1.0f, 2.0f, 3.0f); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl b/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl new file mode 100644 index 0000000000..38a4ff8f91 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl @@ -0,0 +1 @@ +let v = vec4(0i, 1i, 2i, 3i); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl.expected.glsl new file mode 100644 index 0000000000..77c907bcd1 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const ivec4 v = ivec4(0, 1, 2, 3); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl.expected.hlsl new file mode 100644 index 0000000000..58b86cecad --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const int4 v = int4(0, 1, 2, 3); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl.expected.msl b/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl.expected.msl new file mode 100644 index 0000000000..f00d2ebbd7 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant int4 v = int4(0, 1, 2, 3); + diff --git a/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl.expected.spvasm new file mode 100644 index 0000000000..88201cc543 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl.expected.spvasm @@ -0,0 +1,24 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 12 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %v "v" + OpName %unused_entry_point "unused_entry_point" + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 + %int_0 = OpConstant %int 0 + %int_1 = OpConstant %int 1 + %int_2 = OpConstant %int 2 + %int_3 = OpConstant %int 3 + %v = OpConstantComposite %v4int %int_0 %int_1 %int_2 %int_3 + %void = OpTypeVoid + %8 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %8 + %11 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl.expected.wgsl new file mode 100644 index 0000000000..38a4ff8f91 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl.expected.wgsl @@ -0,0 +1 @@ +let v = vec4(0i, 1i, 2i, 3i); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl b/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl new file mode 100644 index 0000000000..ef7c7662f5 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl @@ -0,0 +1 @@ +let v = vec4(0u, 1u, 2u, 3u); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl.expected.glsl b/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl.expected.glsl new file mode 100644 index 0000000000..a6bfcaefda --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl.expected.glsl @@ -0,0 +1,7 @@ +#version 310 es + +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +void unused_entry_point() { + return; +} +const uvec4 v = uvec4(0u, 1u, 2u, 3u); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl.expected.hlsl b/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl.expected.hlsl new file mode 100644 index 0000000000..014390a471 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl.expected.hlsl @@ -0,0 +1,6 @@ +[numthreads(1, 1, 1)] +void unused_entry_point() { + return; +} + +static const uint4 v = uint4(0u, 1u, 2u, 3u); diff --git a/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl.expected.msl b/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl.expected.msl new file mode 100644 index 0000000000..83695b894d --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl.expected.msl @@ -0,0 +1,5 @@ +#include + +using namespace metal; +constant uint4 v = uint4(0u, 1u, 2u, 3u); + diff --git a/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl.expected.spvasm b/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl.expected.spvasm new file mode 100644 index 0000000000..23b7d4495e --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl.expected.spvasm @@ -0,0 +1,24 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 12 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %unused_entry_point "unused_entry_point" + OpExecutionMode %unused_entry_point LocalSize 1 1 1 + OpName %v "v" + OpName %unused_entry_point "unused_entry_point" + %uint = OpTypeInt 32 0 + %v4uint = OpTypeVector %uint 4 + %uint_0 = OpConstant %uint 0 + %uint_1 = OpConstant %uint 1 + %uint_2 = OpConstant %uint 2 + %uint_3 = OpConstant %uint 3 + %v = OpConstantComposite %v4uint %uint_0 %uint_1 %uint_2 %uint_3 + %void = OpTypeVoid + %8 = OpTypeFunction %void +%unused_entry_point = OpFunction %void None %8 + %11 = OpLabel + OpReturn + OpFunctionEnd diff --git a/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl.expected.wgsl b/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl.expected.wgsl new file mode 100644 index 0000000000..ef7c7662f5 --- /dev/null +++ b/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl.expected.wgsl @@ -0,0 +1 @@ +let v = vec4(0u, 1u, 2u, 3u); diff --git a/test/tint/ptr_ref/access/matrix.spvasm.expected.wgsl b/test/tint/ptr_ref/access/matrix.spvasm.expected.wgsl index 1df5dca066..c5e748eda0 100644 --- a/test/tint/ptr_ref/access/matrix.spvasm.expected.wgsl +++ b/test/tint/ptr_ref/access/matrix.spvasm.expected.wgsl @@ -1,7 +1,7 @@ fn main_1() { var m : mat3x3 = mat3x3(); - m = mat3x3(vec3(1.0, 2.0, 3.0), vec3(4.0, 5.0, 6.0), vec3(7.0, 8.0, 9.0)); - m[1i] = vec3(5.0, 5.0, 5.0); + m = mat3x3(vec3(1.0f, 2.0f, 3.0f), vec3(4.0f, 5.0f, 6.0f), vec3(7.0f, 8.0f, 9.0f)); + m[1i] = vec3(5.0f, 5.0f, 5.0f); return; } diff --git a/test/tint/samples/simple_vertex.spvasm.expected.wgsl b/test/tint/samples/simple_vertex.spvasm.expected.wgsl index 3aaf1efc2b..ece46723d9 100644 --- a/test/tint/samples/simple_vertex.spvasm.expected.wgsl +++ b/test/tint/samples/simple_vertex.spvasm.expected.wgsl @@ -1,7 +1,7 @@ var gl_Position : vec4; fn main_1() { - gl_Position = vec4(0.0, 0.0, 0.0, 0.0); + gl_Position = vec4(0.0f, 0.0f, 0.0f, 0.0f); return; }