tint/writer/wgsl: Emit 'f' suffix on FloatLiteralExpressions
If the literal was constructed with an 'f', make sure we print it.
Bug: tint:1504
Change-Id: I6f04e31a166919c07574db56b0a2063ce5b8ca5c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91965
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/ast/float_literal_expression.cc b/src/tint/ast/float_literal_expression.cc
index ab2d6cf..36cb42a 100644
--- a/src/tint/ast/float_literal_expression.cc
+++ b/src/tint/ast/float_literal_expression.cc
@@ -36,4 +36,15 @@
return ctx->dst->create<FloatLiteralExpression>(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 72a395f..7f03caf 100644
--- a/src/tint/ast/float_literal_expression.h
+++ b/src/tint/ast/float_literal_expression.h
@@ -55,6 +55,12 @@
const Suffix suffix;
};
+/// Writes the float literal suffix to the std::ostream.
+/// @param out the std::ostream to write to
+/// @param suffix the suffix to write
+/// @returns out so calls can be chained
+std::ostream& operator<<(std::ostream& out, FloatLiteralExpression::Suffix suffix);
+
} // namespace tint::ast
#endif // SRC_TINT_AST_FLOAT_LITERAL_EXPRESSION_H_
diff --git a/src/tint/ast/float_literal_expression_test.cc b/src/tint/ast/float_literal_expression_test.cc
index a2f9b25..5ec5f0f 100644
--- a/src/tint/ast/float_literal_expression_test.cc
+++ b/src/tint/ast/float_literal_expression_test.cc
@@ -33,5 +33,24 @@
EXPECT_EQ(i->suffix, FloatLiteralExpression::Suffix::kF);
}
+TEST_F(FloatLiteralExpressionTest, SuffixH) {
+ auto* i = create<FloatLiteralExpression>(42.0, FloatLiteralExpression::Suffix::kH);
+ ASSERT_TRUE(i->Is<FloatLiteralExpression>());
+ 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 8bc3d2f..969e1b9 100644
--- a/src/tint/ast/int_literal_expression_test.cc
+++ b/src/tint/ast/int_literal_expression_test.cc
@@ -40,5 +40,17 @@
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 9db49d9..0597916 100644
--- a/src/tint/reader/spirv/function_arithmetic_test.cc
+++ b/src/tint/reader/spirv/function_arithmetic_test.cc
@@ -93,10 +93,10 @@
return "bitcast<vec2<u32>>(vec2<i32>(40i, 30i))";
}
if (assembly == "v2float_50_60") {
- return "vec2<f32>(50.0, 60.0)";
+ return "vec2<f32>(50.0f, 60.0f)";
}
if (assembly == "v2float_60_50") {
- return "vec2<f32>(60.0, 50.0)";
+ return "vec2<f32>(60.0f, 50.0f)";
}
return "bad case";
}
@@ -253,7 +253,7 @@
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 @@
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<f32> = -(vec2<f32>(50.0, 60.0));"));
+ HasSubstr("let x_1 : vec2<f32> = -(vec2<f32>(50.0f, 60.0f));"));
}
struct BinaryData {
@@ -394,8 +394,8 @@
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<f32>", AstFor("v2float_50_60"), "+",
AstFor("v2float_60_50")}));
@@ -441,8 +441,8 @@
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<f32>", AstFor("v2float_50_60"), "-",
AstFor("v2float_60_50")}));
@@ -488,8 +488,8 @@
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<f32>", AstFor("v2float_50_60"), "*",
AstFor("v2float_60_50")}));
@@ -576,8 +576,8 @@
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<f32>", AstFor("v2float_50_60"), "/",
AstFor("v2float_60_50")}));
@@ -667,8 +667,8 @@
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<f32>", AstFor("v2float_50_60"), "%",
AstFor("v2float_60_50")}));
@@ -687,7 +687,7 @@
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 @@
EXPECT_THAT(
test::ToString(p->program(), ast_body),
HasSubstr(
- R"(let x_1 : vec2<f32> = (vec2<f32>(50.0, 60.0) - (vec2<f32>(60.0, 50.0) * floor((vec2<f32>(50.0, 60.0) / vec2<f32>(60.0, 50.0)))));)"));
+ R"(let x_1 : vec2<f32> = (vec2<f32>(50.0f, 60.0f) - (vec2<f32>(60.0f, 50.0f) * floor((vec2<f32>(50.0f, 60.0f) / vec2<f32>(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 2e15743..2b26d14 100644
--- a/src/tint/reader/spirv/function_composite_test.cc
+++ b/src/tint/reader/spirv/function_composite_test.cc
@@ -98,7 +98,7 @@
EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr(R"(let x_1 : vec2<u32> = vec2<u32>(10u, 20u);
let x_2 : vec2<i32> = vec2<i32>(30i, 40i);
-let x_3 : vec2<f32> = vec2<f32>(50.0, 60.0);
+let x_3 : vec2<f32> = vec2<f32>(50.0f, 60.0f);
)"));
}
@@ -117,9 +117,9 @@
auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr("let x_1 : mat3x2<f32> = mat3x2<f32>("
- "vec2<f32>(50.0, 60.0), "
- "vec2<f32>(60.0, 50.0), "
- "vec2<f32>(70.0, 70.0));"));
+ "vec2<f32>(50.0f, 60.0f), "
+ "vec2<f32>(60.0f, 50.0f), "
+ "vec2<f32>(70.0f, 70.0f));"));
}
TEST_F(SpvParserTest_Composite_Construct, Array) {
@@ -153,7 +153,7 @@
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<f32>(50.0, 60.0), 5u, 30i);"));
+ HasSubstr("let x_1 : S = S(vec2<f32>(50.0f, 60.0f), 5u, 30i);"));
}
TEST_F(SpvParserTest_Composite_Construct, ConstantComposite_Struct_NoDeduplication) {
@@ -201,7 +201,7 @@
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<f32>(50.0, 60.0).y;"));
+ HasSubstr("let x_1 : f32 = vec2<f32>(50.0f, 60.0f).y;"));
}
TEST_F(SpvParserTest_CompositeExtract, Vector_IndexTooBigError) {
@@ -448,8 +448,8 @@
auto ast_body = fe.ast_body();
auto got = test::ToString(p->program(), ast_body);
const auto* expected =
- R"(var x_1_1 : vec2<f32> = vec2<f32>(50.0, 60.0);
-x_1_1.y = 70.0;
+ R"(var x_1_1 : vec2<f32> = vec2<f32>(50.0f, 60.0f);
+x_1_1.y = 70.0f;
let x_1 : vec2<f32> = x_1_1;
return;
)";
@@ -492,7 +492,7 @@
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<f32> = x_1;
-x_2_1[2u] = vec2<f32>(50.0, 60.0);
+x_2_1[2u] = vec2<f32>(50.0f, 60.0f);
let x_2 : mat3x2<f32> = x_2_1;
)")) << body_str;
}
@@ -537,7 +537,7 @@
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<f32> = x_1;
-x_2_1[2u] = vec2<f32>(50.0, 60.0);
+x_2_1[2u] = vec2<f32>(50.0f, 60.0f);
let x_2 : mat3x2<f32> = x_2_1;
return;
)")) << body_str;
@@ -713,7 +713,7 @@
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 e2f10b2..eab0031 100644
--- a/src/tint/reader/spirv/function_conversion_test.cc
+++ b/src/tint/reader/spirv/function_conversion_test.cc
@@ -83,7 +83,7 @@
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<u32>(50.0);"));
+ HasSubstr("let x_1 : u32 = bitcast<u32>(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 bced935..8af9da2 100644
--- a/src/tint/reader/spirv/function_decl_test.cc
+++ b/src/tint/reader/spirv/function_decl_test.cc
@@ -93,7 +93,7 @@
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 319332a..4836a68 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 @@
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 @@
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<f32>(f1, 0.0), vec2<f32>(f2, 0.0), f3).x;)";
+ R"(let x_1 : f32 = refract(vec2<f32>(f1, 0.0f), vec2<f32>(f2, 0.0f), f3).x;)";
EXPECT_THAT(body, HasSubstr(expected)) << body;
}
@@ -1019,7 +1019,7 @@
// 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 @@
// 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 ba73d5d..474af2e 100644
--- a/src/tint/reader/spirv/function_logical_test.cc
+++ b/src/tint/reader/spirv/function_logical_test.cc
@@ -112,10 +112,10 @@
return "bitcast<vec2<u32>>(vec2<i32>(40i, 30i))";
}
if (assembly == "v2float_50_60") {
- return "vec2<f32>(50.0, 60.0)";
+ return "vec2<f32>(50.0f, 60.0f)";
}
if (assembly == "v2float_60_50") {
- return "vec2<f32>(60.0, 50.0)";
+ return "vec2<f32>(60.0f, 50.0f)";
}
return "bad case";
}
@@ -219,7 +219,7 @@
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<bool>",
AstFor("v2float_50_60"),
@@ -249,7 +249,7 @@
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<bool>",
AstFor("v2float_50_60"),
@@ -258,7 +258,7 @@
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<bool>",
AstFor("v2float_50_60"), "<",
@@ -267,7 +267,7 @@
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<bool>", AstFor("v2float_50_60"),
@@ -276,7 +276,7 @@
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<bool>", AstFor("v2float_50_60"), ">",
@@ -285,7 +285,7 @@
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<bool>", AstFor("v2float_50_60"),
@@ -515,7 +515,7 @@
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 @@
auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr("let x_1 : vec2<bool> = "
- "!((vec2<f32>(50.0, 60.0) != vec2<f32>(60.0, 50.0)));"));
+ "!((vec2<f32>(50.0f, 60.0f) != vec2<f32>(60.0f, 50.0f)));"));
}
TEST_F(SpvFUnordTest, FUnordNotEqual_Scalar) {
@@ -550,7 +550,7 @@
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 @@
auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr("let x_1 : vec2<bool> = "
- "!((vec2<f32>(50.0, 60.0) == vec2<f32>(60.0, 50.0)));"));
+ "!((vec2<f32>(50.0f, 60.0f) == vec2<f32>(60.0f, 50.0f)));"));
}
TEST_F(SpvFUnordTest, FUnordLessThan_Scalar) {
@@ -585,7 +585,7 @@
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 @@
auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr("let x_1 : vec2<bool> = "
- "!((vec2<f32>(50.0, 60.0) >= vec2<f32>(60.0, 50.0)));"));
+ "!((vec2<f32>(50.0f, 60.0f) >= vec2<f32>(60.0f, 50.0f)));"));
}
TEST_F(SpvFUnordTest, FUnordLessThanEqual_Scalar) {
@@ -620,7 +620,7 @@
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 @@
auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr("let x_1 : vec2<bool> = "
- "!((vec2<f32>(50.0, 60.0) > vec2<f32>(60.0, 50.0)));"));
+ "!((vec2<f32>(50.0f, 60.0f) > vec2<f32>(60.0f, 50.0f)));"));
}
TEST_F(SpvFUnordTest, FUnordGreaterThan_Scalar) {
@@ -655,7 +655,7 @@
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 @@
auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr("let x_1 : vec2<bool> = "
- "!((vec2<f32>(50.0, 60.0) <= vec2<f32>(60.0, 50.0)));"));
+ "!((vec2<f32>(50.0f, 60.0f) <= vec2<f32>(60.0f, 50.0f)));"));
}
TEST_F(SpvFUnordTest, FUnordGreaterThanEqual_Scalar) {
@@ -690,7 +690,7 @@
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 @@
auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr("let x_1 : vec2<bool> = !(("
- "vec2<f32>(50.0, 60.0) < vec2<f32>(60.0, 50.0)"
+ "vec2<f32>(50.0f, 60.0f) < vec2<f32>(60.0f, 50.0f)"
"));"));
}
@@ -762,7 +762,7 @@
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 @@
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 @@
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<bool> = isNan(vec2<f32>(50.0, 60.0));"));
+ HasSubstr("let x_1 : vec2<bool> = isNan(vec2<f32>(50.0f, 60.0f));"));
}
TEST_F(SpvLogicalTest, IsInf_Scalar) {
@@ -892,7 +893,8 @@
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 @@
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<bool> = isInf(vec2<f32>(50.0, 60.0));"));
+ HasSubstr("let x_1 : vec2<bool> = isInf(vec2<f32>(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 58cceda..ed39e21 100644
--- a/src/tint/reader/spirv/function_memory_test.cc
+++ b/src/tint/reader/spirv/function_memory_test.cc
@@ -133,8 +133,9 @@
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 @@
EXPECT_TRUE(fe.EmitBody());
auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body),
- HasSubstr("myvar[2u] = vec4<f32>(42.0, 42.0, 42.0, 42.0);"));
+ HasSubstr("myvar[2u] = vec4<f32>(42.0f, 42.0f, 42.0f, 42.0f);"));
}
TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Array) {
@@ -529,7 +530,7 @@
EXPECT_TRUE(fe.EmitBody());
auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body),
- HasSubstr("myvar[2u] = vec4<f32>(42.0, 42.0, 42.0, 42.0);"));
+ HasSubstr("myvar[2u] = vec4<f32>(42.0f, 42.0f, 42.0f, 42.0f);"));
}
TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Struct) {
@@ -559,7 +560,7 @@
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 @@
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 @@
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 @@
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 9d40ffc..3f9c398 100644
--- a/src/tint/reader/spirv/function_misc_test.cc
+++ b/src/tint/reader/spirv/function_misc_test.cc
@@ -75,7 +75,8 @@
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 @@
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 @@
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 @@
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 c986af8..6371234 100644
--- a/src/tint/reader/spirv/function_var_test.cc
+++ b/src/tint/reader/spirv/function_var_test.cc
@@ -184,7 +184,7 @@
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 @@
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 @@
auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body),
- HasSubstr("var x_200 : vec2<f32> = vec2<f32>(1.5, 2.0);"));
+ HasSubstr("var x_200 : vec2<f32> = vec2<f32>(1.5f, 2.0f);"));
}
TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_MatrixInitializer) {
@@ -261,9 +261,9 @@
auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr("var x_200 : mat3x2<f32> = mat3x2<f32>("
- "vec2<f32>(1.5, 2.0), "
- "vec2<f32>(2.0, 3.0), "
- "vec2<f32>(3.0, 4.0));"));
+ "vec2<f32>(1.5f, 2.0f), "
+ "vec2<f32>(2.0f, 3.0f), "
+ "vec2<f32>(3.0f, 4.0f));"));
}
TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ArrayInitializer) {
@@ -382,7 +382,7 @@
auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body),
- HasSubstr("var x_200 : S = S(1u, 1.5, array<u32, 2u>(1u, 2u));"));
+ HasSubstr("var x_200 : S = S(1u, 1.5f, array<u32, 2u>(1u, 2u));"));
}
TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_StructInitializer_Null) {
@@ -404,7 +404,7 @@
auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body),
- HasSubstr("var x_200 : S = S(0u, 0.0, array<u32, 2u>());"));
+ HasSubstr("var x_200 : S = S(0u, 0.0f, array<u32, 2u>());"));
}
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 c821c85..fe6b1e0 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 @@
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 0af3cc5..84f3dcb 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 @@
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 @@
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<i32>(3i, 4i))"},
// OpImageDrefGather 2DDepth ConstOffset unsigned
ImageAccessCase{"%float 2D 1 0 0 1 Unknown",
@@ -1666,7 +1666,7 @@
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<i32>(vec2<u32>(3u, 4u)))"},
// OpImageDrefGather 2DDepth Array
ImageAccessCase{"%float 2D 1 1 0 1 Unknown",
@@ -1676,7 +1676,7 @@
@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 @@
@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<i32>(3i, 4i))"},
+ "i32(round(coords123.z)), 0.200000003f, vec2<i32>(3i, 4i))"},
// OpImageDrefGather 2DDepth Array ConstOffset unsigned
ImageAccessCase{"%float 2D 1 1 0 1 Unknown",
"%result = OpImageDrefGather "
@@ -1695,7 +1695,7 @@
@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<i32>(vec2<u32>(3u, 4u)))"},
// OpImageDrefGather DepthCube
ImageAccessCase{"%float Cube 1 0 0 1 Unknown",
@@ -1704,7 +1704,7 @@
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 @@
@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 @@
R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)",
- "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 @@
R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d_array<f32>;)",
- 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 @@
R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)",
- R"(textureSampleBias(x_20, x_10, coords12, 7.0, vec2<i32>(3i, 4i))"},
+ R"(textureSampleBias(x_20, x_10, coords12, 7.0f, vec2<i32>(3i, 4i))"},
// OpImageSampleImplicitLod with Bias and unsigned ConstOffset
// Convert ConstOffset to signed
@@ -1796,7 +1796,7 @@
R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)",
- R"(textureSampleBias(x_20, x_10, coords12, 7.0, vec2<i32>(vec2<u32>(3u, 4u)))"},
+ R"(textureSampleBias(x_20, x_10, coords12, 7.0f, vec2<i32>(vec2<u32>(3u, 4u)))"},
// OpImageSampleImplicitLod arrayed with Bias
ImageAccessCase{
"%float 2D 0 1 0 1 Unknown",
@@ -1806,7 +1806,7 @@
R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d_array<f32>;)",
- R"(textureSampleBias(x_20, x_10, coords123.xy, i32(round(coords123.z)), 7.0, vec2<i32>(3i, 4i))"}));
+ R"(textureSampleBias(x_20, x_10, coords123.xy, i32(round(coords123.z)), 7.0f, vec2<i32>(3i, 4i))"}));
INSTANTIATE_TEST_SUITE_P(
// This test shows the use of a sampled image used with both regular
@@ -1831,8 +1831,8 @@
@group(0) @binding(1) var x_30 : sampler_comparison;
)",
R"(
- let x_200 : vec4<f32> = vec4<f32>(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<f32> = vec4<f32>(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 @@
@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 @@
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 @@
@group(2) @binding(1) var x_20 : texture_depth_2d;
)",
- R"(textureSampleCompare(x_20, x_10, coords12, 0.200000003, vec2<i32>(3i, 4i)))"},
+ R"(textureSampleCompare(x_20, x_10, coords12, 0.200000003f, vec2<i32>(3i, 4i)))"},
// ImageSampleDrefImplicitLod arrayed with ConstOffset
ImageAccessCase{
"%float 2D 0 1 0 1 Unknown",
@@ -1875,7 +1875,7 @@
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<i32>(3i, 4i)))"}));
+ R"(textureSampleCompare(x_20, x_10, coords123.xy, i32(round(coords123.z)), 0.200000003f, vec2<i32>(3i, 4i)))"}));
INSTANTIATE_TEST_SUITE_P(
ImageSampleDrefExplicitLod,
@@ -1891,7 +1891,7 @@
@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 @@
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 @@
@group(2) @binding(1) var x_20 : texture_depth_2d;
)",
- R"(textureSampleCompareLevel(x_20, x_10, coords12, 0.200000003, vec2<i32>(3i, 4i)))"},
+ R"(textureSampleCompareLevel(x_20, x_10, coords12, 0.200000003f, vec2<i32>(3i, 4i)))"},
// 2D array, ConstOffset
ImageAccessCase{
"%float 2D 1 1 0 1 Unknown",
@@ -1921,7 +1921,7 @@
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<i32>(3i, 4i)))"},
+ R"(textureSampleCompareLevel(x_20, x_10, coords123.xy, i32(round(coords123.z)), 0.200000003f, vec2<i32>(3i, 4i)))"},
// Cube
ImageAccessCase{"%float Cube 1 0 0 1 Unknown",
"%result = OpImageSampleDrefExplicitLod "
@@ -1929,7 +1929,7 @@
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 @@
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 @@
R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)",
- 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 @@
R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d_array<f32>;)",
- 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 @@
R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)",
- R"(textureSampleLevel(x_20, x_10, coords12, 0.0, vec2<i32>(3i, 4i)))"},
+ R"(textureSampleLevel(x_20, x_10, coords12, 0.0f, vec2<i32>(3i, 4i)))"},
// OpImageSampleExplicitLod - using Lod and unsigned ConstOffset
// Convert the ConstOffset operand to signed
@@ -1984,7 +1984,7 @@
R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)",
- R"(textureSampleLevel(x_20, x_10, coords12, 0.0, vec2<i32>(vec2<u32>(3u, 4u)))"},
+ R"(textureSampleLevel(x_20, x_10, coords12, 0.0f, vec2<i32>(vec2<u32>(3u, 4u)))"},
// OpImageSampleExplicitLod arrayed - using Lod and ConstOffset
ImageAccessCase{
@@ -1995,7 +1995,7 @@
R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d_array<f32>;)",
- R"(textureSampleLevel(x_20, x_10, coords123.xy, i32(round(coords123.z)), 0.0, vec2<i32>(3i, 4i)))"}));
+ R"(textureSampleLevel(x_20, x_10, coords123.xy, i32(round(coords123.z)), 0.0f, vec2<i32>(3i, 4i)))"}));
INSTANTIATE_TEST_SUITE_P(
ImageSampleExplicitLod_UsingGrad,
@@ -2092,7 +2092,7 @@
@group(2) @binding(1) var x_20 : texture_depth_2d;
)",
- R"(vec4<f32>(textureSampleLevel(x_20, x_10, vf12, i32(f1)), 0.0, 0.0, 0.0))"}}));
+ R"(vec4<f32>(textureSampleLevel(x_20, x_10, vf12, i32(f1)), 0.0f, 0.0f, 0.0f))"}}));
/////
// Projection sampling
@@ -2176,7 +2176,7 @@
R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)",
- 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 @@
R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)",
- R"(textureSampleBias(x_20, x_10, (coords123.xy / coords123.z), 7.0, vec2<i32>(3i, 4i)))"},
+ R"(textureSampleBias(x_20, x_10, (coords123.xy / coords123.z), 7.0f, vec2<i32>(3i, 4i)))"},
// OpImageSampleProjImplicitLod with Bias and unsigned ConstOffset
// Convert ConstOffset to signed
@@ -2199,7 +2199,7 @@
R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)",
- R"(textureSampleBias(x_20, x_10, (coords123.xy / coords123.z), 7.0, vec2<i32>(vec2<u32>(3u, 4u))))"}));
+ R"(textureSampleBias(x_20, x_10, (coords123.xy / coords123.z), 7.0f, vec2<i32>(vec2<u32>(3u, 4u))))"}));
INSTANTIATE_TEST_SUITE_P(
ImageSampleProjExplicitLod_Lod,
@@ -2266,7 +2266,7 @@
// Sampling the depth texture yields an f32, but the
// SPIR-V operation yiedls vec4<f32>, so fill out the
// remaining components with 0.
- R"(vec4<f32>(textureSample(x_20, x_10, (coords123.xy / coords123.z)), 0.0, 0.0, 0.0))"}));
+ R"(vec4<f32>(textureSample(x_20, x_10, (coords123.xy / coords123.z)), 0.0f, 0.0f, 0.0f))"}));
INSTANTIATE_TEST_SUITE_P(
ImageSampleProjDrefImplicitLod,
@@ -2311,7 +2311,7 @@
@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 @@
@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<i32>(3i, 4i)))"}));
+ R"(textureSampleCompareLevel(x_20, x_10, (coords123.xy / coords123.z), 0.200000003f, 0.0f, vec2<i32>(3i, 4i)))"}));
/////
// End projection sampling
@@ -2416,15 +2416,15 @@
// 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<r32float, write>;)",
- "textureStore(x_20, vi12, vec4<f32>(f1, 0.0, 0.0, 0.0));"},
+ "textureStore(x_20, vi12, vec4<f32>(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<r32float, write>;)",
- "textureStore(x_20, vi12, vec4<f32>(vf12, 0.0, 0.0));"},
+ "textureStore(x_20, vi12, vec4<f32>(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<r32float, write>;)",
- "textureStore(x_20, vi12, vec4<f32>(vf123, 0.0));"},
+ "textureStore(x_20, vi12, vec4<f32>(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<r32float, write>;)",
@@ -2432,11 +2432,11 @@
// 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<rg32float, write>;)",
- "textureStore(x_20, vi12, vec4<f32>(vf12, 0.0, 0.0));"},
+ "textureStore(x_20, vi12, vec4<f32>(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<rg32float, write>;)",
- "textureStore(x_20, vi12, vec4<f32>(vf123, 0.0));"},
+ "textureStore(x_20, vi12, vec4<f32>(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<rg32float, write>;)",
@@ -2583,11 +2583,11 @@
// 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<f32> = vec4<f32>(textureLoad(x_20, vi12, 0i), 0.0, 0.0, 0.0);)"},
+ R"(let x_99 : vec4<f32> = vec4<f32>(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<f32> = vec4<f32>(textureLoad(x_20, vi12, 3i), 0.0, 0.0, 0.0);)"}}));
+ R"(let x_99 : vec4<f32> = vec4<f32>(textureLoad(x_20, vi12, 3i), 0.0f, 0.0f, 0.0f);)"}}));
INSTANTIATE_TEST_SUITE_P(
ImageFetch_Depth,
@@ -2600,7 +2600,7 @@
// 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<f32> = vec4<f32>(textureLoad(x_20, vi12, 0i), 0.0, 0.0, 0.0);)"}}));
+ R"(let x_99 : vec4<f32> = vec4<f32>(textureLoad(x_20, vi12, 0i), 0.0f, 0.0f, 0.0f);)"}}));
INSTANTIATE_TEST_SUITE_P(
ImageFetch_DepthMultisampled,
@@ -2613,7 +2613,7 @@
// 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<f32> = vec4<f32>(textureLoad(x_20, vi12, i1), 0.0, 0.0, 0.0);)"}}));
+ R"(let x_99 : vec4<f32> = vec4<f32>(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 8ef704e..622d383 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 @@
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 @@
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 @@
var<private> gl_Position : vec4<f32>;
fn main_1() {
- x_900 = 1.0;
+ x_900 = 1.0f;
return;
}
@@ -681,7 +681,7 @@
var<private> x_900 : f32;
fn main_1() {
- x_900 = 1.0;
+ x_900 = 1.0f;
return;
}
@@ -889,7 +889,7 @@
var<private> x_4 : u32 = 1u;
-var<private> x_5 : f32 = 1.5;
+var<private> x_5 : f32 = 1.5f;
)"));
}
@@ -914,7 +914,7 @@
var<private> x_3 : u32 = 0u;
-var<private> x_4 : f32 = 0.0;
+var<private> x_4 : f32 = 0.0f;
)"));
}
@@ -939,7 +939,7 @@
var<private> x_3 : u32 = 0u;
-var<private> x_4 : f32 = 0.0;
+var<private> x_4 : f32 = 0.0f;
)"));
// This example module emits ok, but is not valid SPIR-V in the first place.
@@ -956,7 +956,7 @@
ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions());
EXPECT_TRUE(p->error().empty());
const auto module_str = test::ToString(p->program());
- EXPECT_THAT(module_str, HasSubstr("var<private> x_200 : vec2<f32> = vec2<f32>(1.5, 2.0);"));
+ EXPECT_THAT(module_str, HasSubstr("var<private> x_200 : vec2<f32> = vec2<f32>(1.5f, 2.0f);"));
}
TEST_F(SpvModuleScopeVarParserTest, VectorBoolNullInitializer) {
@@ -1083,9 +1083,9 @@
EXPECT_TRUE(p->error().empty());
const auto module_str = test::ToString(p->program());
EXPECT_THAT(module_str, HasSubstr("var<private> x_200 : mat3x2<f32> = mat3x2<f32>("
- "vec2<f32>(1.5, 2.0), "
- "vec2<f32>(2.0, 3.0), "
- "vec2<f32>(3.0, 4.0));"));
+ "vec2<f32>(1.5f, 2.0f), "
+ "vec2<f32>(2.0f, 3.0f), "
+ "vec2<f32>(3.0f, 4.0f));"));
}
TEST_F(SpvModuleScopeVarParserTest, MatrixNullInitializer) {
@@ -1168,7 +1168,7 @@
EXPECT_TRUE(p->error().empty());
const auto module_str = test::ToString(p->program());
EXPECT_THAT(module_str,
- HasSubstr("var<private> x_200 : S = S(1u, 1.5, array<u32, 2u>(1u, 2u));"))
+ HasSubstr("var<private> x_200 : S = S(1u, 1.5f, array<u32, 2u>(1u, 2u));"))
<< module_str;
}
@@ -1181,7 +1181,7 @@
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<private> x_200 : S = S(0u, 0.0, array<u32, 2u>());"))
+ EXPECT_THAT(module_str, HasSubstr("var<private> x_200 : S = S(0u, 0.0f, array<u32, 2u>());"))
<< module_str;
}
@@ -1195,7 +1195,7 @@
EXPECT_TRUE(p->error().empty());
const auto module_str = test::ToString(p->program());
- EXPECT_THAT(module_str, HasSubstr("var<private> x_200 : S = S(0u, 0.0, array<u32, 2u>());"))
+ EXPECT_THAT(module_str, HasSubstr("var<private> x_200 : S = S(0u, 0.0f, array<u32, 2u>());"))
<< module_str;
// This example module emits ok, but is not valid SPIR-V in the first place.
@@ -1565,7 +1565,7 @@
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 @@
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 @@
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<private> x_1 : f32 = 0.0;
+ const std::string expected = R"(var<private> x_1 : f32 = 0.0f;
fn main_1() {
return;
@@ -3957,7 +3957,7 @@
const auto got = test::ToString(p->program());
const std::string expected =
- R"(var<private> gl_Position : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
+ R"(var<private> gl_Position : vec4<f32> = vec4<f32>(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 d3fe95a..68ccb8b 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() {
let inner_result = vert_main_inner();
value = inner_result;
- vertex_point_size = 1.0;
+ vertex_point_size = 1.0f;
}
)";
@@ -3210,7 +3210,7 @@
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() {
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() {
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
let inner_result = vertex_main(bitcast<u32>(gl_VertexID), bitcast<u32>(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 1d84859..cad3109 100644
--- a/src/tint/transform/combine_samplers_test.cc
+++ b/src/tint/transform/combine_samplers_test.cc
@@ -872,7 +872,7 @@
@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>) -> 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 @@
@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>) -> 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 53b335e..e911df3 100644
--- a/src/tint/transform/decompose_strided_array_test.cc
+++ b/src/tint/transform/decompose_strided_array_test.cc
@@ -374,8 +374,8 @@
@stage(compute) @workgroup_size(1i)
fn f() {
s.a = array<strided_arr, 4u>();
- s.a = array<strided_arr, 4u>(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, 4u>(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 @@
@stage(compute) @workgroup_size(1i)
fn f() {
s.a = array<f32, 4u>();
- s.a = array<f32, 4u>(1.0, 2.0, 3.0, 4.0);
- s.a[1i] = 5.0;
+ s.a = array<f32, 4u>(1.0f, 2.0f, 3.0f, 4.0f);
+ s.a[1i] = 5.0f;
}
)";
@@ -483,8 +483,8 @@
fn f() {
let c = s.a;
let d = s.a[1i].el;
- s.a = array<strided_arr, 4u>(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, 4u>(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 @@
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 @@
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 803ae73..2367cf1 100644
--- a/src/tint/transform/decompose_strided_matrix_test.cc
+++ b/src/tint/transform/decompose_strided_matrix_test.cc
@@ -376,7 +376,7 @@
@stage(compute) @workgroup_size(1i)
fn f() {
- s.m = mat2x2_stride_32_to_arr(mat2x2<f32>(vec2<f32>(1.0, 2.0), vec2<f32>(3.0, 4.0)));
+ s.m = mat2x2_stride_32_to_arr(mat2x2<f32>(vec2<f32>(1.0f, 2.0f), vec2<f32>(3.0f, 4.0f)));
}
)";
@@ -429,7 +429,7 @@
@stage(compute) @workgroup_size(1i)
fn f() {
- s.m[1i] = vec2<f32>(1.0, 2.0);
+ s.m[1i] = vec2<f32>(1.0f, 2.0f);
}
)";
@@ -505,8 +505,8 @@
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<f32>(vec2<f32>(1.0, 2.0), vec2<f32>(3.0, 4.0)));
- s.m[1i] = vec2<f32>(5.0, 6.0);
+ s.m = mat2x2_stride_32_to_arr(mat2x2<f32>(vec2<f32>(1.0f, 2.0f), vec2<f32>(3.0f, 4.0f)));
+ s.m[1i] = vec2<f32>(5.0f, 6.0f);
}
)";
@@ -613,7 +613,7 @@
@stage(compute) @workgroup_size(1i)
fn f() {
- s.m = mat2x2<f32>(vec2<f32>(1.0, 2.0), vec2<f32>(3.0, 4.0));
+ s.m = mat2x2<f32>(vec2<f32>(1.0f, 2.0f), vec2<f32>(3.0f, 4.0f));
}
)";
diff --git a/src/tint/transform/fold_constants_test.cc b/src/tint/transform/fold_constants_test.cc
index f27ede6..54bb2e3 100644
--- a/src/tint/transform/fold_constants_test.cc
+++ b/src/tint/transform/fold_constants_test.cc
@@ -41,7 +41,7 @@
var<private> b : u32 = 123u;
-var<private> c : f32 = 123.0;
+var<private> c : f32 = 123.0f;
var<private> d : bool = true;
@@ -70,7 +70,7 @@
var<private> b : u32 = 123u;
-var<private> c : f32 = 123.0;
+var<private> c : f32 = 123.0f;
var<private> d : bool = true;
@@ -99,7 +99,7 @@
var<private> b : u32 = 123u;
-var<private> c : f32 = 123.0;
+var<private> c : f32 = 123.0f;
var<private> d : bool = true;
@@ -128,7 +128,7 @@
var<private> b : vec3<u32> = vec3<u32>(123u);
-var<private> c : vec3<f32> = vec3<f32>(123.0);
+var<private> c : vec3<f32> = vec3<f32>(123.0f);
var<private> d : vec3<bool> = vec3<bool>(true);
@@ -157,7 +157,7 @@
var<private> b : vec3<u32> = vec3<u32>(123u);
-var<private> c : vec3<f32> = vec3<f32>(123.0);
+var<private> c : vec3<f32> = vec3<f32>(123.0f);
var<private> d : vec3<bool> = vec3<bool>(true);
@@ -186,7 +186,7 @@
var<private> b : vec3<u32> = vec3<u32>(123u);
-var<private> c : vec3<f32> = vec3<f32>(123.0);
+var<private> c : vec3<f32> = vec3<f32>(123.0f);
var<private> d : vec3<bool> = vec3<bool>(true);
@@ -245,7 +245,7 @@
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() {
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() {
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 @@
fn f() {
var a : vec3<i32> = vec3<i32>(123i);
var b : vec3<u32> = vec3<u32>(123u);
- var c : vec3<f32> = vec3<f32>(123.0);
+ var c : vec3<f32> = vec3<f32>(123.0f);
var d : vec3<bool> = vec3<bool>(true);
}
)";
@@ -317,7 +317,7 @@
fn f() {
var a : vec3<i32> = vec3<i32>(123i);
var b : vec3<u32> = vec3<u32>(123u);
- var c : vec3<f32> = vec3<f32>(123.0);
+ var c : vec3<f32> = vec3<f32>(123.0f);
var d : vec3<bool> = vec3<bool>(true);
}
)";
@@ -341,7 +341,7 @@
fn f() {
var a : vec3<i32> = vec3<i32>(123i);
var b : vec3<u32> = vec3<u32>(123u);
- var c : vec3<f32> = vec3<f32>(123.0);
+ var c : vec3<f32> = vec3<f32>(123.0f);
var d : vec3<bool> = vec3<bool>(true);
}
)";
@@ -365,7 +365,7 @@
fn f() {
var a : vec3<i32> = vec3<i32>(123i);
var b : vec3<u32> = vec3<u32>(123u);
- var c : vec3<f32> = vec3<f32>(123.0);
+ var c : vec3<f32> = vec3<f32>(123.0f);
var d : vec3<bool> = vec3<bool>(true);
}
)";
@@ -412,7 +412,7 @@
auto* expect = R"(
fn f() {
var a : f32 = f32();
- var b : vec2<f32> = vec2<f32>(1.0, a);
+ var b : vec2<f32> = vec2<f32>(1.0f, a);
}
)";
diff --git a/src/tint/transform/multiplanar_external_texture_test.cc b/src/tint/transform/multiplanar_external_texture_test.cc
index 171df8d..39c4602 100644
--- a/src/tint/transform/multiplanar_external_texture_test.cc
+++ b/src/tint/transform/multiplanar_external_texture_test.cc
@@ -249,14 +249,14 @@
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>;
if ((params.numPlanes == 1u)) {
- color = textureSampleLevel(plane0, smp, coord, 0.0).rgb;
+ color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else {
- color = (vec4<f32>(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
@stage(fragment)
@@ -318,14 +318,14 @@
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>;
if ((params.numPlanes == 1u)) {
- color = textureSampleLevel(plane0, smp, coord, 0.0).rgb;
+ color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else {
- color = (vec4<f32>(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
@stage(fragment)
@@ -394,12 +394,12 @@
if ((params.numPlanes == 1u)) {
color = textureLoad(plane0, coord, 0i).rgb;
} else {
- color = (vec4<f32>(textureLoad(plane0, coord, 0i).r, textureLoad(plane1, coord, 0i).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
@stage(fragment)
@@ -462,12 +462,12 @@
if ((params.numPlanes == 1u)) {
color = textureLoad(plane0, coord, 0i).rgb;
} else {
- color = (vec4<f32>(textureLoad(plane0, coord, 0i).r, textureLoad(plane1, coord, 0i).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
@stage(fragment)
@@ -536,14 +536,14 @@
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>;
if ((params.numPlanes == 1u)) {
- color = textureSampleLevel(plane0, smp, coord, 0.0).rgb;
+ color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else {
- color = (vec4<f32>(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
fn textureLoadExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, coord : vec2<i32>, params : ExternalTextureParams) -> vec4<f32> {
@@ -551,12 +551,12 @@
if ((params.numPlanes == 1u)) {
color = textureLoad(plane0, coord, 0i).rgb;
} else {
- color = (vec4<f32>(textureLoad(plane0, coord, 0i).r, textureLoad(plane1, coord, 0i).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
@stage(fragment)
@@ -619,14 +619,14 @@
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>;
if ((params.numPlanes == 1u)) {
- color = textureSampleLevel(plane0, smp, coord, 0.0).rgb;
+ color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else {
- color = (vec4<f32>(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
fn textureLoadExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, coord : vec2<i32>, params : ExternalTextureParams) -> vec4<f32> {
@@ -634,12 +634,12 @@
if ((params.numPlanes == 1u)) {
color = textureLoad(plane0, coord, 0i).rgb;
} else {
- color = (vec4<f32>(textureLoad(plane0, coord, 0i).r, textureLoad(plane1, coord, 0i).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
@stage(fragment)
@@ -730,14 +730,14 @@
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>;
if ((params.numPlanes == 1u)) {
- color = textureSampleLevel(plane0, smp, coord, 0.0).rgb;
+ color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else {
- color = (vec4<f32>(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
@stage(fragment)
@@ -808,14 +808,14 @@
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>;
if ((params.numPlanes == 1u)) {
- color = textureSampleLevel(plane0, smp, coord, 0.0).rgb;
+ color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else {
- color = (vec4<f32>(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
fn f(t : texture_2d<f32>, ext_tex_plane_1_1 : texture_2d<f32>, ext_tex_params_1 : ExternalTextureParams, s : sampler) {
@@ -895,14 +895,14 @@
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>;
if ((params.numPlanes == 1u)) {
- color = textureSampleLevel(plane0, smp, coord, 0.0).rgb;
+ color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else {
- color = (vec4<f32>(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
fn f(t : texture_2d<f32>, ext_tex_plane_1_1 : texture_2d<f32>, ext_tex_params_1 : ExternalTextureParams, s : sampler) {
@@ -972,14 +972,14 @@
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>;
if ((params.numPlanes == 1u)) {
- color = textureSampleLevel(plane0, smp, coord, 0.0).rgb;
+ color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else {
- color = (vec4<f32>(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
fn f(s : sampler, t : texture_2d<f32>, ext_tex_plane_1_1 : texture_2d<f32>, ext_tex_params_1 : ExternalTextureParams) {
@@ -1060,14 +1060,14 @@
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>;
if ((params.numPlanes == 1u)) {
- color = textureSampleLevel(plane0, smp, coord, 0.0).rgb;
+ color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else {
- color = (vec4<f32>(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
fn f(t : texture_2d<f32>, ext_tex_plane_1_2 : texture_2d<f32>, ext_tex_params_2 : ExternalTextureParams, s : sampler, t2 : texture_2d<f32>, ext_tex_plane_1_3 : texture_2d<f32>, ext_tex_params_3 : ExternalTextureParams) {
@@ -1158,14 +1158,14 @@
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>;
if ((params.numPlanes == 1u)) {
- color = textureSampleLevel(plane0, smp, coord, 0.0).rgb;
+ color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else {
- color = (vec4<f32>(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
fn f(t : texture_2d<f32>, ext_tex_plane_1_2 : texture_2d<f32>, ext_tex_params_2 : ExternalTextureParams, s : sampler, t2 : texture_2d<f32>, ext_tex_plane_1_3 : texture_2d<f32>, ext_tex_params_3 : ExternalTextureParams) {
@@ -1243,14 +1243,14 @@
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>;
if ((params.numPlanes == 1u)) {
- color = textureSampleLevel(plane0, smp, coord, 0.0).rgb;
+ color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else {
- color = (vec4<f32>(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
fn nested(t : texture_2d<f32>, ext_tex_plane_1_1 : texture_2d<f32>, ext_tex_params_1 : ExternalTextureParams, s : sampler) {
@@ -1333,14 +1333,14 @@
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>;
if ((params.numPlanes == 1u)) {
- color = textureSampleLevel(plane0, smp, coord, 0.0).rgb;
+ color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else {
- color = (vec4<f32>(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
fn nested(t : texture_2d<f32>, ext_tex_plane_1_1 : texture_2d<f32>, ext_tex_params_1 : ExternalTextureParams, s : sampler) {
@@ -1463,14 +1463,14 @@
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>;
if ((params.numPlanes == 1u)) {
- color = textureSampleLevel(plane0, smp, coord, 0.0).rgb;
+ color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else {
- color = (vec4<f32>(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
fn f(t : texture_2d<f32>, ext_tex_plane_1_1 : texture_2d<f32>, ext_tex_params_1 : ExternalTextureParams, s : sampler) {
@@ -1551,14 +1551,14 @@
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>;
if ((params.numPlanes == 1u)) {
- color = textureSampleLevel(plane0, smp, coord, 0.0).rgb;
+ color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else {
- color = (vec4<f32>(textureSampleLevel(plane0, smp, coord, 0.0).r, textureSampleLevel(plane1, smp, coord, 0.0).rg, 1.0) * params.yuvToRgbConversionMatrix);
+ color = (vec4<f32>(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<f32>(color, 1.0);
+ return vec4<f32>(color, 1.0f);
}
fn f(t : texture_2d<f32>, ext_tex_plane_1_1 : texture_2d<f32>, 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 80768a7..ef37631 100644
--- a/src/tint/transform/vertex_pulling_test.cc
+++ b/src/tint/transform/vertex_pulling_test.cc
@@ -1172,22 +1172,22 @@
uint8x4 = (((vec4<u32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]) << vec4<u32>(24u, 16u, 8u, 0u)) >> vec4<u32>(24u))).xy;
sint8x2 = (((vec2<i32>(bitcast<i32>((tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)] << 16u))) << vec2<u32>(8u, 0u)) >> vec2<u32>(24u))).x;
sint8x4 = (((vec4<i32>(bitcast<i32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)])) << vec4<u32>(24u, 16u, 8u, 0u)) >> vec4<u32>(24u))).xy;
- unorm8x2 = vec4<f32>(unpack4x8unorm((tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)] & 65535u)).xy, 0.0, 1.0);
+ unorm8x2 = vec4<f32>(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<f32>(unpack4x8snorm((tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)] & 65535u)).xy, 0.0);
+ snorm8x2 = vec3<f32>(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<u32>(((vec2<u32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]) << vec2<u32>(16u, 0u)) >> vec2<u32>(16u)), 0u);
uint16x4 = (((vec2<u32>(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<u32>(16u, 0u, 16u, 0u)) >> vec4<u32>(16u))).xy;
sint16x2 = vec4<i32>(((vec2<i32>(bitcast<i32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)])) << vec2<u32>(16u, 0u)) >> vec2<u32>(16u)), 0i, 1i);
sint16x4 = (((vec2<i32>(bitcast<i32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), bitcast<i32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 17u)])).xxyy << vec4<u32>(16u, 0u, 16u, 0u)) >> vec4<u32>(16u))).x;
- unorm16x2 = vec3<f32>(unpack2x16unorm(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), 0.0);
+ unorm16x2 = vec3<f32>(unpack2x16unorm(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), 0.0f);
unorm16x4 = vec4<f32>(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<f32>(unpack2x16snorm(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), 0.0, 1.0);
+ snorm16x2 = vec4<f32>(unpack2x16snorm(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), 0.0f, 1.0f);
snorm16x4 = vec4<f32>(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<f32>(unpack2x16float(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), 0.0, 1.0);
+ float16x2 = vec4<f32>(unpack2x16float(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), 0.0f, 1.0f);
float16x4 = vec4<f32>(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<f32>(bitcast<f32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), 0.0, 0.0, 1.0);
- float32x2 = vec4<f32>(vec2<f32>(bitcast<f32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), bitcast<f32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 17u)])), 0.0, 1.0);
+ float32 = vec4<f32>(bitcast<f32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), 0.0f, 0.0f, 1.0f);
+ float32x2 = vec4<f32>(vec2<f32>(bitcast<f32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), bitcast<f32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 17u)])), 0.0f, 1.0f);
float32x3 = vec3<f32>(bitcast<f32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), bitcast<f32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 17u)]), bitcast<f32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 18u)])).xy;
float32x4 = vec4<f32>(bitcast<f32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)]), bitcast<f32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 17u)]), bitcast<f32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 18u)]), bitcast<f32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 19u)])).xyz;
uint32 = vec3<u32>(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 677421d..c71cd49 100644
--- a/src/tint/writer/wgsl/generator_impl.cc
+++ b/src/tint/writer/wgsl/generator_impl.cc
@@ -258,7 +258,7 @@
return true;
},
[&](const ast::FloatLiteralExpression* l) { //
- out << FloatToBitPreservingString(static_cast<float>(l->value));
+ out << FloatToBitPreservingString(static_cast<float>(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 7a147c2..ae9f2b7 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 @@
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 @@
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 @@
GeneratorImpl& gen = Build();
ASSERT_TRUE(gen.Generate()) << gen.error();
- EXPECT_THAT(gen.result(), HasSubstr("vec3<f32>(1.0, 2.0, 3.0)"));
+ EXPECT_THAT(gen.result(), HasSubstr("vec3<f32>(1.0f, 2.0f, 3.0f)"));
}
TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Mat) {
@@ -112,8 +112,8 @@
GeneratorImpl& gen = Build();
ASSERT_TRUE(gen.Generate()) << gen.error();
- EXPECT_THAT(gen.result(), HasSubstr("mat2x3<f32>(vec3<f32>(1.0, 2.0, 3.0), "
- "vec3<f32>(3.0, 4.0, 5.0))"));
+ EXPECT_THAT(gen.result(), HasSubstr("mat2x3<f32>(vec3<f32>(1.0f, 2.0f, 3.0f), "
+ "vec3<f32>(3.0f, 4.0f, 5.0f))"));
}
TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Array) {
@@ -123,8 +123,9 @@
GeneratorImpl& gen = Build();
ASSERT_TRUE(gen.Generate()) << gen.error();
- EXPECT_THAT(gen.result(), HasSubstr("array<vec3<f32>, 3u>(vec3<f32>(1.0, 2.0, 3.0), "
- "vec3<f32>(4.0, 5.0, 6.0), vec3<f32>(7.0, 8.0, 9.0))"));
+ EXPECT_THAT(gen.result(),
+ HasSubstr("array<vec3<f32>, 3u>(vec3<f32>(1.0f, 2.0f, 3.0f), "
+ "vec3<f32>(4.0f, 5.0f, 6.0f), vec3<f32>(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 da91948..4c43a59 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 @@
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 353bd36..dd715d4 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 @@
INSTANTIATE_TEST_SUITE_P(Zero,
WgslGenerator_FloatLiteralTest,
- ::testing::ValuesIn(std::vector<FloatData>{{0_f, "0.0"},
- {MakeFloat(0, 0, 0), "0.0"},
- {MakeFloat(1, 0, 0), "-0.0"}}));
+ ::testing::ValuesIn(std::vector<FloatData>{
+ {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<FloatData>{{1_f, "1.0"},
- {-1_f, "-1.0"},
- {101.375_f, "101.375"}}));
+ ::testing::ValuesIn(std::vector<FloatData>{{1_f, "1.0f"},
+ {-1_f, "-1.0f"},
+ {101.375_f, "101.375f"}}));
INSTANTIATE_TEST_SUITE_P(Subnormal,
WgslGenerator_FloatLiteralTest,
::testing::ValuesIn(std::vector<FloatData>{
- {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<FloatData>{
- {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 @@
WgslGenerator_FloatLiteralTest,
::testing::ValuesIn(std::vector<FloatData>{
// 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 80f6259..83af7c2 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 @@
std::stringstream out;
ASSERT_TRUE(gen.EmitVariable(out, v)) << gen.error();
- EXPECT_EQ(out.str(), R"(var<private> a : f32 = 1.0;)");
+ EXPECT_EQ(out.str(), R"(var<private> a : f32 = 1.0f;)");
}
TEST_F(WgslGeneratorImplTest, EmitVariable_Const) {
@@ -118,7 +118,7 @@
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 d2a2590..9b26713 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<f32>(vec3<f32>(1.0, 2.0, 3.0), vec3<f32>(4.0, 5.0, 6.0), vec3<f32>(7.0, 8.0, 9.0))[1u].y;
+ let x_24 : f32 = mat3x3<f32>(vec3<f32>(1.0f, 2.0f, 3.0f), vec3<f32>(4.0f, 5.0f, 6.0f), vec3<f32>(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 2781fcc..a5385e1 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<f32>(1.0, 2.0, 3.0).y;
- let x_13 : vec2<f32> = vec2<f32>(vec3<f32>(1.0, 2.0, 3.0).x, vec3<f32>(1.0, 2.0, 3.0).z);
- let x_14 : vec3<f32> = vec3<f32>(vec3<f32>(1.0, 2.0, 3.0).x, vec3<f32>(1.0, 2.0, 3.0).z, vec3<f32>(1.0, 2.0, 3.0).y);
+ let x_11 : f32 = vec3<f32>(1.0f, 2.0f, 3.0f).y;
+ let x_13 : vec2<f32> = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).x, vec3<f32>(1.0f, 2.0f, 3.0f).z);
+ let x_14 : vec3<f32> = vec3<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).x, vec3<f32>(1.0f, 2.0f, 3.0f).z, vec3<f32>(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 6713a16..14e0a9e 100644
--- a/test/tint/array/strides.spvasm.expected.wgsl
+++ b/test/tint/array/strides.spvasm.expected.wgsl
@@ -26,7 +26,7 @@
let x_28 : Arr = s.a[3i].el[2i];
let x_32 : f32 = s.a[3i].el[2i][1i].el;
s.a = array<strided_arr_1, 4u>();
- 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 e8db8e1..23899cc 100644
--- a/test/tint/bug/tint/1088.spvasm.expected.wgsl
+++ b/test/tint/bug/tint/1088.spvasm.expected.wgsl
@@ -32,7 +32,7 @@
var q : vec4<f32>;
var p : vec3<f32>;
let x_13 : vec3<f32> = position;
- q = vec4<f32>(x_13.x, x_13.y, x_13.z, 1.0);
+ q = vec4<f32>(x_13.x, x_13.y, x_13.z, 1.0f);
let x_21 : vec4<f32> = q;
p = vec3<f32>(x_21.x, x_21.y, x_21.z);
let x_27 : f32 = p.x;
@@ -42,14 +42,14 @@
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<f32> = x_14.worldViewProjection;
let x_70 : vec3<f32> = p;
- gl_Position = (x_69 * vec4<f32>(x_70.x, x_70.y, x_70.z, 1.0));
+ gl_Position = (x_69 * vec4<f32>(x_70.x, x_70.y, x_70.z, 1.0f));
let x_83 : vec2<f32> = 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 108847d..88c4ea4 100644
--- a/test/tint/bug/tint/1520.spvasm.expected.wgsl
+++ b/test/tint/bug/tint/1520.spvasm.expected.wgsl
@@ -95,20 +95,20 @@
x_9_ok = true;
x_87_phi = false;
if (true) {
- x_86 = all(((vec4<f32>(0.0, 0.0, 0.0, 0.0) / vec4<f32>(x_77, x_77, x_77, x_77)) == vec4<f32>(0.0, 0.0, 0.0, 0.0)));
+ x_86 = all(((vec4<f32>(0.0f, 0.0f, 0.0f, 0.0f) / vec4<f32>(x_77, x_77, x_77, x_77)) == vec4<f32>(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<f32> = vec4<f32>(x_77, x_77, x_77, x_77);
x_10_val = x_89;
- let x_92 : vec4<f32> = (x_89 + vec4<f32>(1.0, 1.0, 1.0, 1.0));
+ let x_92 : vec4<f32> = (x_89 + vec4<f32>(1.0f, 1.0f, 1.0f, 1.0f));
x_10_val = x_92;
- let x_93 : vec4<f32> = (x_92 - vec4<f32>(1.0, 1.0, 1.0, 1.0));
+ let x_93 : vec4<f32> = (x_92 - vec4<f32>(1.0f, 1.0f, 1.0f, 1.0f));
x_10_val = x_93;
- let x_94 : vec4<f32> = (x_93 + vec4<f32>(1.0, 1.0, 1.0, 1.0));
+ let x_94 : vec4<f32> = (x_93 + vec4<f32>(1.0f, 1.0f, 1.0f, 1.0f));
x_10_val = x_94;
- let x_95 : vec4<f32> = (x_94 - vec4<f32>(1.0, 1.0, 1.0, 1.0));
+ let x_95 : vec4<f32> = (x_94 - vec4<f32>(1.0f, 1.0f, 1.0f, 1.0f));
x_10_val = x_95;
x_100_phi = false;
if (x_87) {
@@ -117,13 +117,13 @@
}
let x_100 : bool = x_100_phi;
x_9_ok = x_100;
- let x_103 : vec4<f32> = (x_95 * vec4<f32>(2.0, 2.0, 2.0, 2.0));
+ let x_103 : vec4<f32> = (x_95 * vec4<f32>(2.0f, 2.0f, 2.0f, 2.0f));
x_10_val = x_103;
- let x_104 : vec4<f32> = (x_103 / vec4<f32>(2.0, 2.0, 2.0, 2.0));
+ let x_104 : vec4<f32> = (x_103 / vec4<f32>(2.0f, 2.0f, 2.0f, 2.0f));
x_10_val = x_104;
- let x_105 : vec4<f32> = (x_104 * vec4<f32>(2.0, 2.0, 2.0, 2.0));
+ let x_105 : vec4<f32> = (x_104 * vec4<f32>(2.0f, 2.0f, 2.0f, 2.0f));
x_10_val = x_105;
- let x_106 : vec4<f32> = (x_105 / vec4<f32>(2.0, 2.0, 2.0, 2.0));
+ let x_106 : vec4<f32> = (x_105 / vec4<f32>(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 b8b5785..851d66a 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 e48b877..577838b 100644
--- a/test/tint/bug/tint/749.spvasm.expected.wgsl
+++ b/test/tint/bug/tint/749.spvasm.expected.wgsl
@@ -19,7 +19,7 @@
let x_932 : i32 = temp;
temp = 0i;
temp = x_932;
- let x_523 : vec3<f32> = vec3<f32>(vec3<f32>(1.0, 2.0, 3.0).z, vec3<f32>(1.0, 2.0, 3.0).y, vec3<f32>(1.0, 2.0, 3.0).z);
+ let x_523 : vec3<f32> = vec3<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).z, vec3<f32>(1.0f, 2.0f, 3.0f).y, vec3<f32>(1.0f, 2.0f, 3.0f).z);
let x_933 : i32 = *(i);
*(i) = 0i;
*(i) = x_933;
@@ -43,7 +43,7 @@
let x_938 : i32 = *(j);
*(j) = 0i;
*(j) = x_938;
- let x_525 : vec3<f32> = vec3<f32>(x_523.z, vec3<f32>(1.0, 2.0, 3.0).x, x_523.y);
+ let x_525 : vec3<f32> = vec3<f32>(x_523.z, vec3<f32>(1.0f, 2.0f, 3.0f).x, x_523.y);
let x_939 : i32 = *(i);
*(i) = 0i;
*(i) = x_939;
@@ -127,7 +127,7 @@
let x_955 : i32 = param_3;
param_3 = 0i;
param_3 = x_955;
- let x_534 : vec3<f32> = vec3<f32>(vec3<f32>(1.0, 2.0, 3.0).z, vec3<f32>(1.0, 2.0, 3.0).x, vec3<f32>(1.0, 2.0, 3.0).z);
+ let x_534 : vec3<f32> = vec3<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).z, vec3<f32>(1.0f, 2.0f, 3.0f).x, vec3<f32>(1.0f, 2.0f, 3.0f).z);
let x_956 : i32 = param_1;
param_1 = 0i;
param_1 = x_956;
@@ -161,7 +161,7 @@
let x_963 : i32 = pivot;
pivot = 0i;
pivot = x_963;
- x_537 = vec2<f32>(vec3<f32>(1.0, 2.0, 3.0).y, vec3<f32>(1.0, 2.0, 3.0).z);
+ x_537 = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).y, vec3<f32>(1.0f, 2.0f, 3.0f).z);
let x_964 : QuicksortObject = obj;
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_964;
@@ -200,7 +200,7 @@
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_972;
let x_63 : i32 = pivot;
- let x_540 : vec2<f32> = vec2<f32>(vec3<f32>(1.0, 2.0, 3.0).y, x_534.z);
+ let x_540 : vec2<f32> = vec2<f32>(vec3<f32>(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 @@
let x_980 : i32 = *(l);
*(l) = 0i;
*(l) = x_980;
- let x_544 : vec3<f32> = vec3<f32>(vec3<f32>(1.0, 2.0, 3.0).z, vec3<f32>(1.0, 2.0, 3.0).y, x_540.x);
+ let x_544 : vec3<f32> = vec3<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).z, vec3<f32>(1.0f, 2.0f, 3.0f).y, x_540.x);
let x_70 : i32 = i_1;
let x_545 : vec2<f32> = vec2<f32>(x_537.y, x_538.x);
let x_981 : i32 = param;
@@ -329,7 +329,7 @@
let x_1003 : i32 = *(l);
*(l) = 0i;
*(l) = x_1003;
- let x_554 : vec2<f32> = vec2<f32>(x_536.z, vec3<f32>(1.0, 2.0, 3.0).y);
+ let x_554 : vec2<f32> = vec2<f32>(x_536.z, vec3<f32>(1.0f, 2.0f, 3.0f).y);
let x_1004 : i32 = param_1;
param_1 = 0i;
param_1 = x_1004;
@@ -360,7 +360,7 @@
let x_1008 : array<i32, 10u> = stack;
stack = array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i);
stack = x_1008;
- let x_556 : vec2<f32> = vec2<f32>(vec3<f32>(1.0, 2.0, 3.0).y, vec3<f32>(1.0, 2.0, 3.0).y);
+ let x_556 : vec2<f32> = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).y, vec3<f32>(1.0f, 2.0f, 3.0f).y);
let x_1009 : i32 = param_5;
param_5 = 0i;
param_5 = x_1009;
@@ -369,7 +369,7 @@
p = 0i;
p = x_1010;
let x_93 : i32 = top;
- let x_557 : vec2<f32> = vec2<f32>(vec3<f32>(1.0, 2.0, 3.0).x, vec3<f32>(1.0, 2.0, 3.0).x);
+ let x_557 : vec2<f32> = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).x, vec3<f32>(1.0f, 2.0f, 3.0f).x);
let x_1011 : i32 = p;
p = 0i;
p = x_1011;
@@ -410,7 +410,7 @@
let x_1020 : i32 = param_4;
param_4 = 0i;
param_4 = x_1020;
- let x_562 : vec3<f32> = vec3<f32>(vec3<f32>(1.0, 2.0, 3.0).z, x_558.y, vec3<f32>(1.0, 2.0, 3.0).y);
+ let x_562 : vec3<f32> = vec3<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).z, x_558.y, vec3<f32>(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 @@
let x_1043 : i32 = stack[x_100_save];
stack[x_100_save] = 0i;
stack[x_100_save] = x_1043;
- let x_573 : vec2<f32> = vec2<f32>(vec3<f32>(1.0, 2.0, 3.0).y, vec3<f32>(1.0, 2.0, 3.0).z);
+ let x_573 : vec2<f32> = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).y, vec3<f32>(1.0f, 2.0f, 3.0f).z);
top = (x_112 - 1i);
let x_1044 : i32 = param_5;
param_5 = 0i;
@@ -540,7 +540,7 @@
stack[x_110_save] = x_1050;
let x_577 : vec2<f32> = vec2<f32>(x_569.y, x_569.z);
let x_120 : i32 = h_1;
- let x_578 : vec2<f32> = vec2<f32>(x_558.x, vec3<f32>(1.0, 2.0, 3.0).y);
+ let x_578 : vec2<f32> = vec2<f32>(x_558.x, vec3<f32>(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 @@
let x_1076 : i32 = stack[x_96_save];
stack[x_96_save] = 0i;
stack[x_96_save] = x_1076;
- let x_592 : vec2<f32> = vec2<f32>(vec3<f32>(1.0, 2.0, 3.0).x, vec3<f32>(1.0, 2.0, 3.0).y);
+ let x_592 : vec2<f32> = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).x, vec3<f32>(1.0f, 2.0f, 3.0f).y);
let x_1077 : QuicksortObject = obj;
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_1077;
@@ -774,7 +774,7 @@
var i_2 : i32;
var uv : vec2<f32>;
let x_717 : vec2<f32> = uv;
- uv = vec2<f32>(0.0, 0.0);
+ uv = vec2<f32>(0.0f, 0.0f);
uv = x_717;
i_2 = 0i;
let x_721 : QuicksortObject = obj;
@@ -784,13 +784,13 @@
let x_722 : QuicksortObject = obj;
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_722;
- let x_431 : vec2<f32> = vec2<f32>(vec3<f32>(1.0, 2.0, 3.0).x, vec3<f32>(1.0, 2.0, 3.0).x);
+ let x_431 : vec2<f32> = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).x, vec3<f32>(1.0f, 2.0f, 3.0f).x);
let x_158 : i32 = i_2;
let x_723 : vec2<f32> = uv;
- uv = vec2<f32>(0.0, 0.0);
+ uv = vec2<f32>(0.0f, 0.0f);
uv = x_723;
let x_725 : vec3<f32> = color;
- color = vec3<f32>(0.0, 0.0, 0.0);
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
color = x_725;
let x_432 : vec2<f32> = vec2<f32>(x_431.y, x_431.y);
let x_726 : QuicksortObject = obj;
@@ -810,11 +810,11 @@
obj = x_758;
let x_184 : vec4<f32> = gl_FragCoord;
let x_759 : vec2<f32> = uv;
- uv = vec2<f32>(0.0, 0.0);
+ uv = vec2<f32>(0.0f, 0.0f);
uv = x_759;
let x_447 : vec2<f32> = vec2<f32>(vec2<f32>().y, vec2<f32>().y);
let x_760 : vec2<f32> = uv;
- uv = vec2<f32>(0.0, 0.0);
+ uv = vec2<f32>(0.0f, 0.0f);
uv = x_760;
let x_185 : vec2<f32> = vec2<f32>(x_184.x, x_184.y);
let x_448 : vec3<f32> = vec3<f32>(x_185.y, x_446.y, x_446.y);
@@ -822,15 +822,15 @@
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_761;
let x_762 : vec2<f32> = uv;
- uv = vec2<f32>(0.0, 0.0);
+ uv = vec2<f32>(0.0f, 0.0f);
uv = x_762;
let x_191 : vec2<f32> = x_188.resolution;
let x_763 : QuicksortObject = obj;
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_763;
- let x_449 : vec3<f32> = vec3<f32>(x_184.y, vec3<f32>(1.0, 2.0, 3.0).z, x_184.w);
+ let x_449 : vec3<f32> = vec3<f32>(x_184.y, vec3<f32>(1.0f, 2.0f, 3.0f).z, x_184.w);
let x_764 : vec3<f32> = color;
- color = vec3<f32>(0.0, 0.0, 0.0);
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
color = x_764;
let x_192 : vec2<f32> = (x_185 / x_191);
let x_765 : QuicksortObject = obj;
@@ -838,15 +838,15 @@
obj = x_765;
let x_450 : vec2<f32> = vec2<f32>(x_447.x, x_185.y);
let x_766 : vec3<f32> = color;
- color = vec3<f32>(0.0, 0.0, 0.0);
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
let x_767 : vec3<f32> = color;
- color = vec3<f32>(0.0, 0.0, 0.0);
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
color = x_767;
color = x_766;
uv = x_192;
- color = vec3<f32>(1.0, 2.0, 3.0);
+ color = vec3<f32>(1.0f, 2.0f, 3.0f);
let x_768 : vec3<f32> = color;
- color = vec3<f32>(0.0, 0.0, 0.0);
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
color = x_768;
let x_451 : vec3<f32> = vec3<f32>(x_185.x, x_185.y, x_446.y);
let x_769 : QuicksortObject = obj;
@@ -864,9 +864,9 @@
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<f32> = vec2<f32>(vec3<f32>(1.0, 2.0, 3.0).z, vec3<f32>(1.0, 2.0, 3.0).y);
+ let x_452 : vec2<f32> = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).z, vec3<f32>(1.0f, 2.0f, 3.0f).y);
let x_774 : i32 = i_2;
i_2 = 0i;
i_2 = x_774;
@@ -876,21 +876,21 @@
let x_453 : vec3<f32> = vec3<f32>(x_451.x, x_450.x, x_450.y);
color.x = (x_206 + f32(x_201));
let x_776 : vec2<f32> = uv;
- uv = vec2<f32>(0.0, 0.0);
+ uv = vec2<f32>(0.0f, 0.0f);
uv = x_776;
let x_777 : vec2<f32> = uv;
- uv = vec2<f32>(0.0, 0.0);
+ uv = vec2<f32>(0.0f, 0.0f);
uv = x_777;
let x_454 : vec2<f32> = vec2<f32>(x_184.y, x_184.y);
let x_210 : f32 = uv.x;
let x_455 : vec2<f32> = vec2<f32>(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<i32, 10u>(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 @@
obj.numbers[0u] = x_781;
let x_456 : vec3<f32> = vec3<f32>(vec2<f32>().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 @@
obj = x_783;
let x_457 : vec2<f32> = vec2<f32>(x_454.x, x_454.x);
let x_784 : vec2<f32> = uv;
- uv = vec2<f32>(0.0, 0.0);
+ uv = vec2<f32>(0.0f, 0.0f);
uv = x_784;
let x_785 : QuicksortObject = obj;
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_785;
- let x_458 : vec2<f32> = vec2<f32>(vec3<f32>(1.0, 2.0, 3.0).z, vec2<f32>().y);
+ let x_458 : vec2<f32> = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).z, vec2<f32>().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<f32> = color;
- color = vec3<f32>(0.0, 0.0, 0.0);
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
color = x_788;
let x_789 : vec3<f32> = color;
- color = vec3<f32>(0.0, 0.0, 0.0);
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
color = x_789;
let x_459 : vec3<f32> = vec3<f32>(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 @@
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<f32> = vec3<f32>(x_453.z, x_453.y, x_453.y);
let x_795 : vec2<f32> = uv;
- uv = vec2<f32>(0.0, 0.0);
+ uv = vec2<f32>(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<f32> = vec2<f32>(vec2<f32>().y, vec2<f32>().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<f32> = vec2<f32>(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<f32> = vec3<f32>(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<f32> = vec2<f32>(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 @@
obj.numbers[2u] = x_806;
let x_465 : vec2<f32> = vec2<f32>(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 @@
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 @@
i_2 = x_811;
let x_467 : vec2<f32> = vec2<f32>(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<f32> = color;
- color = vec3<f32>(0.0, 0.0, 0.0);
+ color = vec3<f32>(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<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_817;
let x_468 : vec3<f32> = vec3<f32>(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<f32> = color;
- color = vec3<f32>(0.0, 0.0, 0.0);
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
color = x_820;
let x_469 : vec3<f32> = vec3<f32>(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<f32> = vec2<f32>(vec2<f32>().x, vec2<f32>().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<f32> = uv;
- uv = vec2<f32>(0.0, 0.0);
+ uv = vec2<f32>(0.0f, 0.0f);
uv = x_824;
let x_471 : vec2<f32> = vec2<f32>(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<f32> = vec3<f32>(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<f32> = color;
- color = vec3<f32>(0.0, 0.0, 0.0);
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
color = x_827;
let x_473 : vec3<f32> = vec3<f32>(x_446.y, x_453.x, x_453.x);
let x_828 : i32 = obj.numbers[4i];
@@ -1075,31 +1075,31 @@
obj.numbers[4i] = x_828;
let x_474 : vec2<f32> = vec2<f32>(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<f32> = vec2<f32>(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<f32> = vec2<f32>(x_451.z, x_460.y);
color.y = (x_257 + f32(x_254));
let x_477 : vec3<f32> = vec3<f32>(vec2<f32>().x, x_472.x, vec2<f32>().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<f32> = vec2<f32>(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 @@
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<f32> = vec3<f32>(x_446.x, x_446.x, vec2<f32>().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<f32> = vec2<f32>(x_447.x, x_480.z);
let x_840 : vec3<f32> = color;
- color = vec3<f32>(0.0, 0.0, 0.0);
+ color = vec3<f32>(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 @@
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<f32> = vec3<f32>(x_455.x, x_475.y, x_455.y);
let x_845 : QuicksortObject = obj;
obj = QuicksortObject(array<i32, 10u>(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<f32> = vec3<f32>(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<f32> = vec3<f32>(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<f32> = vec3<f32>(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 @@
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<f32> = vec2<f32>(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<f32> = vec2<f32>(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 @@
let x_488 : vec2<f32> = vec2<f32>(x_473.z, x_473.y);
let x_283 : f32 = color.y;
let x_860 : vec2<f32> = uv;
- uv = vec2<f32>(0.0, 0.0);
+ uv = vec2<f32>(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<f32> = vec2<f32>(x_475.y, x_475.x);
let x_862 : i32 = obj.numbers[6u];
@@ -1212,16 +1212,16 @@
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<f32> = vec2<f32>(vec3<f32>(1.0, 2.0, 3.0).y, x_454.x);
+ let x_491 : vec2<f32> = vec2<f32>(vec3<f32>(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<f32> = vec2<f32>(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 @@
obj = x_868;
let x_493 : vec2<f32> = vec2<f32>(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<f32> = vec3<f32>(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<f32> = color;
- color = vec3<f32>(0.0, 0.0, 0.0);
+ color = vec3<f32>(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<f32> = vec3<f32>(x_192.y, x_192.x, x_192.y);
let x_874 : vec3<f32> = color;
- color = vec3<f32>(0.0, 0.0, 0.0);
+ color = vec3<f32>(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<f32> = vec3<f32>(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<f32> = vec2<f32>(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<f32> = vec3<f32>(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<f32> = vec2<f32>(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<f32> = vec3<f32>(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<f32> = vec2<f32>(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 @@
i_2 = x_887;
let x_502 : vec2<f32> = vec2<f32>(x_451.y, x_192.y);
let x_888 : vec2<f32> = uv;
- uv = vec2<f32>(0.0, 0.0);
+ uv = vec2<f32>(0.0f, 0.0f);
uv = x_888;
let x_301 : i32 = obj.numbers[8i];
let x_889 : i32 = i_2;
@@ -1311,78 +1311,78 @@
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<f32> = vec2<f32>(x_453.y, vec2<f32>().x);
let x_892 : f32 = color.x;
- color.x = 0.0;
+ color.x = 0.0f;
color.x = x_892;
let x_505 : vec3<f32> = vec3<f32>(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<f32> = vec2<f32>(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<f32> = vec2<f32>(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<f32> = uv;
- uv = vec2<f32>(0.0, 0.0);
+ uv = vec2<f32>(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<f32> = vec3<f32>(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<f32> = vec3<f32>(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<f32> = vec3<f32>(vec3<f32>(1.0, 2.0, 3.0).y, x_485.y, x_485.z);
+ let x_510 : vec3<f32> = vec3<f32>(vec3<f32>(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<f32> = vec2<f32>(x_485.z, x_485.y);
let x_907 : vec3<f32> = color;
- color = vec3<f32>(0.0, 0.0, 0.0);
+ color = vec3<f32>(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<f32> = vec3<f32>(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<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
@@ -1394,47 +1394,47 @@
let x_317 : i32 = obj.numbers[9u];
let x_514 : vec3<f32> = vec3<f32>(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<f32> = vec2<f32>(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<f32> = color;
- color = vec3<f32>(0.0, 0.0, 0.0);
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
color = x_916;
let x_516 : vec2<f32> = vec2<f32>(x_452.x, x_452.x);
let x_917 : vec2<f32> = uv;
- uv = vec2<f32>(0.0, 0.0);
+ uv = vec2<f32>(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<f32> = vec3<f32>(vec2<f32>().x, vec2<f32>().x, vec2<f32>().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<f32> = vec3<f32>(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<f32> = color;
let x_922 : f32 = uv[0i];
- uv[0i] = 0.0;
+ uv[0i] = 0.0f;
uv[0i] = x_922;
let x_519 : vec3<f32> = vec3<f32>(x_447.x, x_446.x, x_446.y);
let x_326 : vec3<f32> = 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<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
@@ -1443,19 +1443,19 @@
obj = QuicksortObject(array<i32, 10u>(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<f32> = vec2<f32>(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<f32> = vec4<f32>(x_326.x, x_326.y, x_326.z, 1.0);
+ let x_330 : vec4<f32> = vec4<f32>(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<f32> = vec3<f32>(vec3<f32>(1.0, 2.0, 3.0).y, vec3<f32>(1.0, 2.0, 3.0).y, x_520.y);
+ let x_521 : vec3<f32> = vec3<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).y, vec3<f32>(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 @@
obj = x_930;
let x_522 : vec3<f32> = vec3<f32>(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 f168e2e..30df000 100644
--- a/test/tint/bug/tint/943.spvasm.expected.wgsl
+++ b/test/tint/bug/tint/943.spvasm.expected.wgsl
@@ -99,7 +99,7 @@
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 @@
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 @@
}
let x_177 : i32 = innerRow;
let x_178 : i32 = innerCol;
- acc[x_177][x_178] = 0.0;
+ acc[x_177][x_178] = 0.0f;
continuing {
let x_181 : i32 = innerCol;
diff --git a/test/tint/bug/tint/951.spvasm.expected.wgsl b/test/tint/bug/tint/951.spvasm.expected.wgsl
index b9c362e..8778a7b 100644
--- a/test/tint/bug/tint/951.spvasm.expected.wgsl
+++ b/test/tint/bug/tint/951.spvasm.expected.wgsl
@@ -34,8 +34,8 @@
fn unaryOperation_f1_(a : ptr<function, f32>) -> 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 57c9062..5b02dce 100644
--- a/test/tint/bug/tint/977.spvasm.expected.wgsl
+++ b/test/tint/bug/tint/977.spvasm.expected.wgsl
@@ -35,11 +35,11 @@
fn binaryOperation_f1_f1_(a : ptr<function, f32>, b : ptr<function, f32>) -> 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 @@
index = bitcast<i32>(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 823f9f4..d0d2ba5 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 82cb5fb..72b3e06 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 8f62208..f494c77 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<private> tint_symbol_1 : vec4<f32> = vec4<f32>();
fn textureLoad_6273b1() {
- var res : f32 = 0.0;
- let x_17 : vec4<f32> = vec4<f32>(textureLoad(arg_0, vec2<i32>(), 1i), 0.0, 0.0, 0.0);
+ var res : f32 = 0.0f;
+ let x_17 : vec4<f32> = vec4<f32>(textureLoad(arg_0, vec2<i32>(), 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 2588c6b..eb85662 100644
--- a/test/tint/expressions/literals/-inf.spvasm.expected.wgsl
+++ b/test/tint/expressions/literals/-inf.spvasm.expected.wgsl
@@ -1,7 +1,7 @@
var<private> out_var_SV_TARGET : vec4<f32>;
fn main_1() {
- out_var_SV_TARGET = vec4<f32>(-0x1p+128, -0x1p+128, -0x1p+128, -0x1p+128);
+ out_var_SV_TARGET = vec4<f32>(-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 c18af0d9..6f8467c 100644
--- a/test/tint/expressions/literals/inf.spvasm.expected.wgsl
+++ b/test/tint/expressions/literals/inf.spvasm.expected.wgsl
@@ -1,7 +1,7 @@
var<private> out_var_SV_TARGET : vec4<f32>;
fn main_1() {
- out_var_SV_TARGET = vec4<f32>(0x1p+128, 0x1p+128, 0x1p+128, 0x1p+128);
+ out_var_SV_TARGET = vec4<f32>(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 b1e7702..0909a0f 100644
--- a/test/tint/expressions/literals/nan.spvasm.expected.wgsl
+++ b/test/tint/expressions/literals/nan.spvasm.expected.wgsl
@@ -1,7 +1,7 @@
var<private> out_var_SV_TARGET : vec4<f32>;
fn main_1() {
- out_var_SV_TARGET = vec4<f32>(0x1.9p+128, 0x1.9p+128, 0x1.9p+128, 0x1.9p+128);
+ out_var_SV_TARGET = vec4<f32>(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 bbf4c71..d2f7f21 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<f32>(0.0, 1.0,
- 2.0, 3.0);
+let m = mat2x2<f32>(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 c9626bd..39cec79 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<f32>(0.0, 1.0, 2.0, 3.0);
+let m = mat2x2<f32>(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 b2ceabf..3841d4e 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<f32>(vec2<f32>(0.0, 1.0),
- vec2<f32>(2.0, 3.0));
+let m = mat2x2<f32>(vec2<f32>(0.0f, 1.0f),
+ vec2<f32>(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 5da680b..ff4e276 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<f32>(vec2<f32>(0.0, 1.0), vec2<f32>(2.0, 3.0));
+let m = mat2x2<f32>(vec2<f32>(0.0f, 1.0f), vec2<f32>(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 0000000..0195661
--- /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 0000000..f79600e
--- /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 0000000..c2e0d31
--- /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 0000000..b62a321
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat2x2/inferred/scalars/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..16c6345
--- /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 0000000..e4941d5
--- /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 0195661..802bd0b 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 e4941d5..1078c57 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 0000000..0698377
--- /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 0000000..f2eeed5
--- /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 0000000..c2e0d31
--- /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 0000000..b62a321
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat2x2/inferred/vectors/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..16c6345
--- /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 0000000..873422d
--- /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 9b605cc..4f73038 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<f32>(0.0, 1.0, 2.0,
- 3.0, 4.0, 5.0);
+let m = mat2x3<f32>(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 9af0993..6de0a5f 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<f32>(0.0, 1.0, 2.0, 3.0, 4.0, 5.0);
+let m = mat2x3<f32>(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 ffa6470..736b493 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<f32>(vec3<f32>(0.0, 1.0, 2.0),
- vec3<f32>(3.0, 4.0, 5.0));
+let m = mat2x3<f32>(vec3<f32>(0.0f, 1.0f, 2.0f),
+ vec3<f32>(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 2e36381..6bfd682 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<f32>(vec3<f32>(0.0, 1.0, 2.0), vec3<f32>(3.0, 4.0, 5.0));
+let m = mat2x3<f32>(vec3<f32>(0.0f, 1.0f, 2.0f), vec3<f32>(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 0000000..dc7f65f
--- /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 0000000..ea329c5
--- /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 0000000..fb12d01
--- /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 0000000..443c61f
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat2x3/inferred/scalars/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..d99921c
--- /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 0000000..0be516f
--- /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 dc7f65f..7107d4b 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 0be516f..c5a27d6 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 0000000..24f8a6c
--- /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 0000000..919400a
--- /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 0000000..fb12d01
--- /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 0000000..443c61f
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat2x3/inferred/vectors/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..d99921c
--- /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 0000000..a23b1e2
--- /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 6819a81..5b8ed92 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<f32>(0.0, 1.0, 2.0),
- vec3<f32>(3.0, 4.0, 5.0));
+let m = mat2x3(vec3<f32>(0.0f, 1.0f, 2.0f),
+ vec3<f32>(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 092445a..bbc2d2a 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<f32>(0.0, 1.0, 2.0), vec3<f32>(3.0, 4.0, 5.0));
+let m = mat2x3(vec3<f32>(0.0f, 1.0f, 2.0f), vec3<f32>(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 e258e63..56d25f5 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<f32>(0.0, 1.0, 2.0, 3.0,
- 4.0, 5.0, 6.0, 7.0);
+let m = mat2x4<f32>(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 9ceabf7..f342196 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<f32>(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0);
+let m = mat2x4<f32>(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 0a9b59a..5465c36 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<f32>(vec4<f32>(0.0, 1.0, 2.0, 3.0),
- vec4<f32>(4.0, 5.0, 6.0, 7.0));
+let m = mat2x4<f32>(vec4<f32>(0.0f, 1.0f, 2.0f, 3.0f),
+ vec4<f32>(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 a3a8fd3..be987bb 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<f32>(vec4<f32>(0.0, 1.0, 2.0, 3.0), vec4<f32>(4.0, 5.0, 6.0, 7.0));
+let m = mat2x4<f32>(vec4<f32>(0.0f, 1.0f, 2.0f, 3.0f), vec4<f32>(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 0000000..81abe9f
--- /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 0000000..6ee3601
--- /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 0000000..5ed2b1b
--- /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 0000000..b309bde
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat2x4/inferred/scalars/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..57110c5
--- /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 0000000..bcb4dfe
--- /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 81abe9f..394b079 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 bcb4dfe..dc53810 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 0000000..e391fbe
--- /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 0000000..461bebd
--- /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 0000000..5ed2b1b
--- /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 0000000..b309bde
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat2x4/inferred/vectors/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..57110c5
--- /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 0000000..80bb8ca
--- /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 c57c2ed..4a9db50 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<f32>(0.0, 1.0, 2.0, 3.0),
- vec4<f32>(4.0, 5.0, 6.0, 7.0));
+let m = mat2x4(vec4<f32>(0.0f, 1.0f, 2.0f, 3.0f),
+ vec4<f32>(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 f6335df5..99f104b 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<f32>(0.0, 1.0, 2.0, 3.0), vec4<f32>(4.0, 5.0, 6.0, 7.0));
+let m = mat2x4(vec4<f32>(0.0f, 1.0f, 2.0f, 3.0f), vec4<f32>(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 67b5b19..b6fb489 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<f32>(0.0, 1.0,
- 2.0, 3.0,
- 4.0, 5.0);
+let m = mat3x2<f32>(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 2be115e..c1034f7 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<f32>(0.0, 1.0, 2.0, 3.0, 4.0, 5.0);
+let m = mat3x2<f32>(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 2afe85b..6d080cb 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<f32>(vec2<f32>(0.0, 1.0),
- vec2<f32>(2.0, 3.0),
- vec2<f32>(4.0, 5.0));
+let m = mat3x2<f32>(vec2<f32>(0.0f, 1.0f),
+ vec2<f32>(2.0f, 3.0f),
+ vec2<f32>(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 23a270e..5ba17fb 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<f32>(vec2<f32>(0.0, 1.0), vec2<f32>(2.0, 3.0), vec2<f32>(4.0, 5.0));
+let m = mat3x2<f32>(vec2<f32>(0.0f, 1.0f), vec2<f32>(2.0f, 3.0f), vec2<f32>(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 0000000..6fbe3b8
--- /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 0000000..ee6b9c0
--- /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 0000000..27568ed
--- /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 0000000..ae7f33c
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat3x2/inferred/scalars/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..ffaa504
--- /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 0000000..4d48f59
--- /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 6fbe3b8..f64977f 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 4d48f59..f418892 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 0000000..990b243
--- /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 0000000..1447967
--- /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 0000000..27568ed
--- /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 0000000..ae7f33c
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat3x2/inferred/vectors/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..ffaa504
--- /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 0000000..b8ff25a
--- /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 d9950cad..287ee1b 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<f32>(0.0, 1.0),
- vec2<f32>(2.0, 3.0),
- vec2<f32>(4.0, 5.0));
+let m = mat3x2(vec2<f32>(0.0f, 1.0f),
+ vec2<f32>(2.0f, 3.0f),
+ vec2<f32>(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 70fc4e6..913dd6b 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<f32>(0.0, 1.0), vec2<f32>(2.0, 3.0), vec2<f32>(4.0, 5.0));
+let m = mat3x2(vec2<f32>(0.0f, 1.0f), vec2<f32>(2.0f, 3.0f), vec2<f32>(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 b6a5ce1..33d7b14 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<f32>(0.0, 1.0, 2.0,
- 3.0, 4.0, 5.0,
- 6.0, 7.0, 8.0);
+let m = mat3x3<f32>(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 acd785e..033c8f6 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<f32>(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0);
+let m = mat3x3<f32>(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 fd4d236..cb6ac10 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<f32>(vec3<f32>(0.0, 1.0, 2.0),
- vec3<f32>(3.0, 4.0, 5.0),
- vec3<f32>(6.0, 7.0, 8.0));
+let m = mat3x3<f32>(vec3<f32>(0.0f, 1.0f, 2.0f),
+ vec3<f32>(3.0f, 4.0f, 5.0f),
+ vec3<f32>(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 9a9a20f..9ac30b5 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<f32>(vec3<f32>(0.0, 1.0, 2.0), vec3<f32>(3.0, 4.0, 5.0), vec3<f32>(6.0, 7.0, 8.0));
+let m = mat3x3<f32>(vec3<f32>(0.0f, 1.0f, 2.0f), vec3<f32>(3.0f, 4.0f, 5.0f), vec3<f32>(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 0000000..ecdafe7
--- /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 0000000..0006430
--- /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 0000000..c35ca2a
--- /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 0000000..2635df5
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat3x3/inferred/scalars/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..8ec1da4
--- /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 0000000..18ca6e3
--- /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 ecdafe7..de0b7c5 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 18ca6e3..c4f87ec 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 0000000..7b5f129
--- /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 0000000..f4631cb
--- /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 0000000..c35ca2a
--- /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 0000000..2635df5
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat3x3/inferred/vectors/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..8ec1da4
--- /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 0000000..21c62e8
--- /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 5c2b614..ab6a8dd 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<f32>(0.0, 1.0, 2.0),
- vec3<f32>(3.0, 4.0, 5.0),
- vec3<f32>(6.0, 7.0, 8.0));
+let m = mat3x3(vec3<f32>(0.0f, 1.0f, 2.0f),
+ vec3<f32>(3.0f, 4.0f, 5.0f),
+ vec3<f32>(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 9fdc4c9..9117012 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<f32>(0.0, 1.0, 2.0), vec3<f32>(3.0, 4.0, 5.0), vec3<f32>(6.0, 7.0, 8.0));
+let m = mat3x3(vec3<f32>(0.0f, 1.0f, 2.0f), vec3<f32>(3.0f, 4.0f, 5.0f), vec3<f32>(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 8b1a949..0a2e8e0 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<f32>(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<f32>(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 84d2e1f..205baa2 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<f32>(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<f32>(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 0551705..a3fc9c6 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<f32>(vec4<f32>(0.0, 1.0, 2.0, 3.0),
- vec4<f32>(4.0, 5.0, 6.0, 7.0),
- vec4<f32>(8.0, 9.0, 10.0, 11.0));
+let m = mat3x4<f32>(vec4<f32>(0.0f, 1.0f, 2.0f, 3.0f),
+ vec4<f32>(4.0f, 5.0f, 6.0f, 7.0f),
+ vec4<f32>(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 9c51aa6..05bc2e6 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<f32>(vec4<f32>(0.0, 1.0, 2.0, 3.0), vec4<f32>(4.0, 5.0, 6.0, 7.0), vec4<f32>(8.0, 9.0, 10.0, 11.0));
+let m = mat3x4<f32>(vec4<f32>(0.0f, 1.0f, 2.0f, 3.0f), vec4<f32>(4.0f, 5.0f, 6.0f, 7.0f), vec4<f32>(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 0000000..cce8161
--- /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 0000000..824c533
--- /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 0000000..fae68df
--- /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 0000000..3608220
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat3x4/inferred/scalars/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..b6ff57d
--- /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 0000000..5fce07f
--- /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 cce8161..9af3d0e 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 5fce07f..8843467 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 0000000..cf638c2
--- /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 0000000..2b8f578
--- /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 0000000..fae68df
--- /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 0000000..3608220
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat3x4/inferred/vectors/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..b6ff57d
--- /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 0000000..4b5d529
--- /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 eb6fad2..32169b8 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<f32>(0.0, 1.0, 2.0, 3.0),
- vec4<f32>(4.0, 5.0, 6.0, 7.0),
- vec4<f32>(8.0, 9.0, 10.0, 11.0));
+let m = mat3x4(vec4<f32>(0.0f, 1.0f, 2.0f, 3.0f),
+ vec4<f32>(4.0f, 5.0f, 6.0f, 7.0f),
+ vec4<f32>(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 6d3960e..7ce7445 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<f32>(0.0, 1.0, 2.0, 3.0), vec4<f32>(4.0, 5.0, 6.0, 7.0), vec4<f32>(8.0, 9.0, 10.0, 11.0));
+let m = mat3x4(vec4<f32>(0.0f, 1.0f, 2.0f, 3.0f), vec4<f32>(4.0f, 5.0f, 6.0f, 7.0f), vec4<f32>(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 0148e38..51b6839 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<f32>(0.0, 1.0,
- 2.0, 3.0,
- 4.0, 5.0,
- 6.0, 7.0);
+let m = mat4x2<f32>(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 5cb1e08..f8b02e2 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<f32>(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0);
+let m = mat4x2<f32>(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 a1a32f8..80b3345 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<f32>(vec2<f32>(0.0, 1.0),
- vec2<f32>(2.0, 3.0),
- vec2<f32>(4.0, 5.0),
- vec2<f32>(6.0, 7.0));
+let m = mat4x2<f32>(vec2<f32>(0.0f, 1.0f),
+ vec2<f32>(2.0f, 3.0f),
+ vec2<f32>(4.0f, 5.0f),
+ vec2<f32>(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 dea4919..2d10da9 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<f32>(vec2<f32>(0.0, 1.0), vec2<f32>(2.0, 3.0), vec2<f32>(4.0, 5.0), vec2<f32>(6.0, 7.0));
+let m = mat4x2<f32>(vec2<f32>(0.0f, 1.0f), vec2<f32>(2.0f, 3.0f), vec2<f32>(4.0f, 5.0f), vec2<f32>(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 0000000..f0946b9
--- /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 0000000..864c631
--- /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 0000000..2acab36
--- /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 0000000..0597230
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat4x2/inferred/scalars/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..c6a6c63
--- /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 0000000..8f69508
--- /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 f0946b9..f5a544c 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 8f69508..5c582f0 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 0000000..2d90c35
--- /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 0000000..93ae98c
--- /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 0000000..2acab36
--- /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 0000000..0597230
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat4x2/inferred/vectors/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..c6a6c63
--- /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 0000000..1786649
--- /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 c1bd5ee..952511e 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<f32>(0.0, 1.0),
- vec2<f32>(2.0, 3.0),
- vec2<f32>(4.0, 5.0),
- vec2<f32>(6.0, 7.0));
+let m = mat4x2(vec2<f32>(0.0f, 1.0f),
+ vec2<f32>(2.0f, 3.0f),
+ vec2<f32>(4.0f, 5.0f),
+ vec2<f32>(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 ca404bf..e585e38 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<f32>(0.0, 1.0), vec2<f32>(2.0, 3.0), vec2<f32>(4.0, 5.0), vec2<f32>(6.0, 7.0));
+let m = mat4x2(vec2<f32>(0.0f, 1.0f), vec2<f32>(2.0f, 3.0f), vec2<f32>(4.0f, 5.0f), vec2<f32>(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 d29dcf7..4dcaf4c 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<f32>(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<f32>(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 2172728..dbe4773 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<f32>(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<f32>(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 7f218e1..74b3e9c 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<f32>(vec3<f32>(0.0, 1.0, 2.0),
- vec3<f32>(3.0, 4.0, 5.0),
- vec3<f32>(6.0, 7.0, 8.0),
- vec3<f32>(9.0, 10.0, 11.0));
+let m = mat4x3<f32>(vec3<f32>(0.0f, 1.0f, 2.0f),
+ vec3<f32>(3.0f, 4.0f, 5.0f),
+ vec3<f32>(6.0f, 7.0f, 8.0f),
+ vec3<f32>(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 ae27122..2196b1e 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<f32>(vec3<f32>(0.0, 1.0, 2.0), vec3<f32>(3.0, 4.0, 5.0), vec3<f32>(6.0, 7.0, 8.0), vec3<f32>(9.0, 10.0, 11.0));
+let m = mat4x3<f32>(vec3<f32>(0.0f, 1.0f, 2.0f), vec3<f32>(3.0f, 4.0f, 5.0f), vec3<f32>(6.0f, 7.0f, 8.0f), vec3<f32>(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 0000000..32326a9
--- /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 0000000..d18bd37
--- /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 0000000..254cc40
--- /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 0000000..d935650
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat4x3/inferred/scalars/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..d99b492f
--- /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 0000000..209a376
--- /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 32326a9..f9dd146 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 209a376..424df3d 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 0000000..8a80c15
--- /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 0000000..532369f
--- /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 0000000..254cc40
--- /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 0000000..d935650
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat4x3/inferred/vectors/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..d99b492f
--- /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 0000000..6e9e96b
--- /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 a3ae9f2..d6c8650 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<f32>(0.0, 1.0, 2.0),
- vec3<f32>(3.0, 4.0, 5.0),
- vec3<f32>(6.0, 7.0, 8.0),
- vec3<f32>(9.0, 10.0, 11.0));
+let m = mat4x3(vec3<f32>(0.0f, 1.0f, 2.0f),
+ vec3<f32>(3.0f, 4.0f, 5.0f),
+ vec3<f32>(6.0f, 7.0f, 8.0f),
+ vec3<f32>(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 ca7b45f..eddcb09 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<f32>(0.0, 1.0, 2.0), vec3<f32>(3.0, 4.0, 5.0), vec3<f32>(6.0, 7.0, 8.0), vec3<f32>(9.0, 10.0, 11.0));
+let m = mat4x3(vec3<f32>(0.0f, 1.0f, 2.0f), vec3<f32>(3.0f, 4.0f, 5.0f), vec3<f32>(6.0f, 7.0f, 8.0f), vec3<f32>(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 b89957b..8ab5b16 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<f32>(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<f32>(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 5916e6a..36fe95d 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<f32>(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<f32>(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 02b4118..be1d342 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<f32>(vec4<f32>(0.0, 1.0, 2.0, 3.0),
- vec4<f32>(4.0, 5.0, 6.0, 7.0),
- vec4<f32>(8.0, 9.0, 10.0, 11.0),
- vec4<f32>(12.0, 13.0, 14.0, 15.0));
+let m = mat4x4<f32>(vec4<f32>(0.0f, 1.0f, 2.0f, 3.0f),
+ vec4<f32>(4.0f, 5.0f, 6.0f, 7.0f),
+ vec4<f32>(8.0f, 9.0f, 10.0f, 11.0f),
+ vec4<f32>(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 6bdb257..a09649c 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<f32>(vec4<f32>(0.0, 1.0, 2.0, 3.0), vec4<f32>(4.0, 5.0, 6.0, 7.0), vec4<f32>(8.0, 9.0, 10.0, 11.0), vec4<f32>(12.0, 13.0, 14.0, 15.0));
+let m = mat4x4<f32>(vec4<f32>(0.0f, 1.0f, 2.0f, 3.0f), vec4<f32>(4.0f, 5.0f, 6.0f, 7.0f), vec4<f32>(8.0f, 9.0f, 10.0f, 11.0f), vec4<f32>(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 0000000..571610f
--- /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 0000000..c1bb385
--- /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 0000000..2707999
--- /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 0000000..053e23d
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat4x4/inferred/scalars/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..84a8f89
--- /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 0000000..33b0598
--- /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 571610f..a47089b 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 33b0598..2374280 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 0000000..a11a785
--- /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 0000000..b86a544
--- /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 0000000..2707999
--- /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 0000000..053e23d
--- /dev/null
+++ b/test/tint/expressions/type_ctor/mat4x4/inferred/vectors/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..84a8f89
--- /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 0000000..faf14ff
--- /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 1e2c0d7..77740a2 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<f32>(0.0, 1.0, 2.0, 3.0),
- vec4<f32>(4.0, 5.0, 6.0, 7.0),
- vec4<f32>(8.0, 9.0, 10.0, 11.0),
- vec4<f32>(12.0, 13.0, 14.0, 15.0));
+let m = mat4x4(vec4<f32>(0.0f, 1.0f, 2.0f, 3.0f),
+ vec4<f32>(4.0f, 5.0f, 6.0f, 7.0f),
+ vec4<f32>(8.0f, 9.0f, 10.0f, 11.0f),
+ vec4<f32>(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 b022afe..7bbde6b 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<f32>(0.0, 1.0, 2.0, 3.0), vec4<f32>(4.0, 5.0, 6.0, 7.0), vec4<f32>(8.0, 9.0, 10.0, 11.0), vec4<f32>(12.0, 13.0, 14.0, 15.0));
+let m = mat4x4(vec4<f32>(0.0f, 1.0f, 2.0f, 3.0f), vec4<f32>(4.0f, 5.0f, 6.0f, 7.0f), vec4<f32>(8.0f, 9.0f, 10.0f, 11.0f), vec4<f32>(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 87b1055..074655c 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<f32>(0.0, 1.0);
+let v = vec2<f32>(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 87b1055..074655c 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<f32>(0.0, 1.0);
+let v = vec2<f32>(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 0000000..e0e5dc9
--- /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 0000000..af91949
--- /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 0000000..8802bbb
--- /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 0000000..f343a25
--- /dev/null
+++ b/test/tint/expressions/type_ctor/vec2/inferred/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..d12bbf2
--- /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 0000000..e0e5dc9
--- /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 0000000..de5642e
--- /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 0000000..ebef7ff
--- /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 0000000..afa632e
--- /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 0000000..af85d23
--- /dev/null
+++ b/test/tint/expressions/type_ctor/vec2/inferred/abstract-int.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..2e021f9
--- /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 0000000..de5642e
--- /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 e0e5dc9..3ca3308 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 e0e5dc9..3ca3308 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 de5642e..7207f34 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 de5642e..7207f34 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 9f3a1f3..0acf3bf 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<bool>(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 9f3a1f3..0acf3bf 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<bool>(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 376f901c..0978438 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<f32>(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 376f901c..0978438 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<f32>(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 7b9ebcb..605fa30 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<i32>(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 7b9ebcb..605fa30 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<i32>(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 0040d27..111a1d3 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<u32>(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 0040d27..111a1d3 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<u32>(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 0000000..376f901c
--- /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 0000000..9f73b75
--- /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 0000000..daa5a1c
--- /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 0000000..b0b245a
--- /dev/null
+++ b/test/tint/expressions/type_ctor/vec3/inferred/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..62e8bc3
--- /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 0000000..376f901c
--- /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 0000000..7b9ebcb
--- /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 0000000..0392e70
--- /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 0000000..9bc1dc4
--- /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 0000000..63fbce8
--- /dev/null
+++ b/test/tint/expressions/type_ctor/vec3/inferred/abstract-int.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..fe0276e
--- /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 0000000..7b9ebcb
--- /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 0000000..9f3a1f3
--- /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 0000000..e7d7818
--- /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 0000000..d5acfa0
--- /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 0000000..0cd9b5b
--- /dev/null
+++ b/test/tint/expressions/type_ctor/vec3/inferred/bool.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..b712760
--- /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 0000000..9f3a1f3
--- /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 0000000..e09c928
--- /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 0000000..9f73b75
--- /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 0000000..daa5a1c
--- /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 0000000..b0b245a
--- /dev/null
+++ b/test/tint/expressions/type_ctor/vec3/inferred/f32.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..62e8bc3
--- /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 0000000..e09c928
--- /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 0000000..73cd973
--- /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 0000000..0392e70
--- /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 0000000..9bc1dc4
--- /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 0000000..63fbce8
--- /dev/null
+++ b/test/tint/expressions/type_ctor/vec3/inferred/i32.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..fe0276e
--- /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 0000000..73cd973
--- /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 0000000..0040d27
--- /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 0000000..1aabf2d
--- /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 0000000..18899ea
--- /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 0000000..6090ecf
--- /dev/null
+++ b/test/tint/expressions/type_ctor/vec3/inferred/u32.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..e4b4797
--- /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 0000000..0040d27
--- /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 bb1280e..5a04e5b 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 bb1280e..89c6254 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 ab60e6e..38a4ff8 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 ab60e6e..38a4ff8 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 0000000..bb1280e
--- /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 0000000..254bda9
--- /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 0000000..bd679f3
--- /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 0000000..568e746
--- /dev/null
+++ b/test/tint/expressions/type_ctor/vec4/inferred/abstract-float.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..783aa84
--- /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 0000000..bb1280e
--- /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 0000000..ab60e6e
--- /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 0000000..77c907b
--- /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 0000000..58b86ce
--- /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 0000000..f00d2eb
--- /dev/null
+++ b/test/tint/expressions/type_ctor/vec4/inferred/abstract-int.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..88201cc
--- /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 0000000..ab60e6e
--- /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 0000000..baeff0f
--- /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 0000000..11236db
--- /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 0000000..af7e30f
--- /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 0000000..840b113
--- /dev/null
+++ b/test/tint/expressions/type_ctor/vec4/inferred/bool.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..1ecbff1
--- /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 0000000..baeff0f
--- /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 0000000..89c6254
--- /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 0000000..254bda9
--- /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 0000000..bd679f3
--- /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 0000000..568e746
--- /dev/null
+++ b/test/tint/expressions/type_ctor/vec4/inferred/f32.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..783aa84
--- /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 0000000..89c6254
--- /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 0000000..38a4ff8
--- /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 0000000..77c907b
--- /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 0000000..58b86ce
--- /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 0000000..f00d2eb
--- /dev/null
+++ b/test/tint/expressions/type_ctor/vec4/inferred/i32.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..88201cc
--- /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 0000000..38a4ff8
--- /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 0000000..ef7c766
--- /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 0000000..a6bfcae
--- /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 0000000..014390a
--- /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 0000000..83695b8
--- /dev/null
+++ b/test/tint/expressions/type_ctor/vec4/inferred/u32.wgsl.expected.msl
@@ -0,0 +1,5 @@
+#include <metal_stdlib>
+
+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 0000000..23b7d44
--- /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 0000000..ef7c766
--- /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 1df5dca..c5e748e 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<f32> = mat3x3<f32>();
- m = mat3x3<f32>(vec3<f32>(1.0, 2.0, 3.0), vec3<f32>(4.0, 5.0, 6.0), vec3<f32>(7.0, 8.0, 9.0));
- m[1i] = vec3<f32>(5.0, 5.0, 5.0);
+ m = mat3x3<f32>(vec3<f32>(1.0f, 2.0f, 3.0f), vec3<f32>(4.0f, 5.0f, 6.0f), vec3<f32>(7.0f, 8.0f, 9.0f));
+ m[1i] = vec3<f32>(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 3aaf1ef..ece4672 100644
--- a/test/tint/samples/simple_vertex.spvasm.expected.wgsl
+++ b/test/tint/samples/simple_vertex.spvasm.expected.wgsl
@@ -1,7 +1,7 @@
var<private> gl_Position : vec4<f32>;
fn main_1() {
- gl_Position = vec4<f32>(0.0, 0.0, 0.0, 0.0);
+ gl_Position = vec4<f32>(0.0f, 0.0f, 0.0f, 0.0f);
return;
}