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>
This commit is contained in:
Ben Clayton 2022-05-31 20:45:59 +00:00 committed by Dawn LUCI CQ
parent 22bd004409
commit 8bd5fec482
326 changed files with 2293 additions and 635 deletions

View File

@ -36,4 +36,15 @@ const FloatLiteralExpression* FloatLiteralExpression::Clone(CloneContext* ctx) c
return ctx->dst->create<FloatLiteralExpression>(src, value, suffix); 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 } // namespace tint::ast

View File

@ -55,6 +55,12 @@ class FloatLiteralExpression final : public Castable<FloatLiteralExpression, Lit
const Suffix suffix; 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 } // namespace tint::ast
#endif // SRC_TINT_AST_FLOAT_LITERAL_EXPRESSION_H_ #endif // SRC_TINT_AST_FLOAT_LITERAL_EXPRESSION_H_

View File

@ -33,5 +33,24 @@ TEST_F(FloatLiteralExpressionTest, SuffixF) {
EXPECT_EQ(i->suffix, FloatLiteralExpression::Suffix::kF); 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
} // namespace tint::ast } // namespace tint::ast

View File

@ -40,5 +40,17 @@ TEST_F(IntLiteralExpressionTest, SuffixU) {
EXPECT_EQ(i->suffix, IntLiteralExpression::Suffix::kU); 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
} // namespace tint::ast } // namespace tint::ast

View File

@ -93,10 +93,10 @@ std::string AstFor(std::string assembly) {
return "bitcast<vec2<u32>>(vec2<i32>(40i, 30i))"; return "bitcast<vec2<u32>>(vec2<i32>(40i, 30i))";
} }
if (assembly == "v2float_50_60") { if (assembly == "v2float_50_60") {
return "vec2<f32>(50.0, 60.0)"; return "vec2<f32>(50.0f, 60.0f)";
} }
if (assembly == "v2float_60_50") { if (assembly == "v2float_60_50") {
return "vec2<f32>(60.0, 50.0)"; return "vec2<f32>(60.0f, 50.0f)";
} }
return "bad case"; return "bad case";
} }
@ -253,7 +253,7 @@ TEST_F(SpvUnaryArithTest, FNegate_Scalar) {
auto fe = p->function_emitter(100); auto fe = p->function_emitter(100);
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); 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) { TEST_F(SpvUnaryArithTest, FNegate_Vector) {
@ -270,7 +270,7 @@ TEST_F(SpvUnaryArithTest, FNegate_Vector) {
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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 { struct BinaryData {
@ -394,8 +394,8 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FAdd,
SpvBinaryArithTest, SpvBinaryArithTest,
::testing::Values( ::testing::Values(
// Scalar float // Scalar float
BinaryData{"float", "float_50", "OpFAdd", "float_60", "f32", "50.0", BinaryData{"float", "float_50", "OpFAdd", "float_60", "f32", "50.0f",
"+", "60.0"}, // Vector float "+", "60.0f"}, // Vector float
BinaryData{"v2float", "v2float_50_60", "OpFAdd", "v2float_60_50", BinaryData{"v2float", "v2float_50_60", "OpFAdd", "v2float_60_50",
"vec2<f32>", AstFor("v2float_50_60"), "+", "vec2<f32>", AstFor("v2float_50_60"), "+",
AstFor("v2float_60_50")})); AstFor("v2float_60_50")}));
@ -441,8 +441,8 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FSub,
SpvBinaryArithTest, SpvBinaryArithTest,
::testing::Values( ::testing::Values(
// Scalar float // Scalar float
BinaryData{"float", "float_50", "OpFSub", "float_60", "f32", "50.0", BinaryData{"float", "float_50", "OpFSub", "float_60", "f32", "50.0f",
"-", "60.0"}, // Vector float "-", "60.0f"}, // Vector float
BinaryData{"v2float", "v2float_50_60", "OpFSub", "v2float_60_50", BinaryData{"v2float", "v2float_50_60", "OpFSub", "v2float_60_50",
"vec2<f32>", AstFor("v2float_50_60"), "-", "vec2<f32>", AstFor("v2float_50_60"), "-",
AstFor("v2float_60_50")})); AstFor("v2float_60_50")}));
@ -488,8 +488,8 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FMul,
SpvBinaryArithTest, SpvBinaryArithTest,
::testing::Values( ::testing::Values(
// Scalar float // Scalar float
BinaryData{"float", "float_50", "OpFMul", "float_60", "f32", "50.0", BinaryData{"float", "float_50", "OpFMul", "float_60", "f32", "50.0f",
"*", "60.0"}, // Vector float "*", "60.0f"}, // Vector float
BinaryData{"v2float", "v2float_50_60", "OpFMul", "v2float_60_50", BinaryData{"v2float", "v2float_50_60", "OpFMul", "v2float_60_50",
"vec2<f32>", AstFor("v2float_50_60"), "*", "vec2<f32>", AstFor("v2float_50_60"), "*",
AstFor("v2float_60_50")})); AstFor("v2float_60_50")}));
@ -576,8 +576,8 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FDiv,
SpvBinaryArithTest, SpvBinaryArithTest,
::testing::Values( ::testing::Values(
// Scalar float // Scalar float
BinaryData{"float", "float_50", "OpFDiv", "float_60", "f32", "50.0", BinaryData{"float", "float_50", "OpFDiv", "float_60", "f32", "50.0f",
"/", "60.0"}, // Vector float "/", "60.0f"}, // Vector float
BinaryData{"v2float", "v2float_50_60", "OpFDiv", "v2float_60_50", BinaryData{"v2float", "v2float_50_60", "OpFDiv", "v2float_60_50",
"vec2<f32>", AstFor("v2float_50_60"), "/", "vec2<f32>", AstFor("v2float_50_60"), "/",
AstFor("v2float_60_50")})); AstFor("v2float_60_50")}));
@ -667,8 +667,8 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FRem,
SpvBinaryArithTest, SpvBinaryArithTest,
::testing::Values( ::testing::Values(
// Scalar float // Scalar float
BinaryData{"float", "float_50", "OpFRem", "float_60", "f32", "50.0", BinaryData{"float", "float_50", "OpFRem", "float_60", "f32", "50.0f",
"%", "60.0"}, // Vector float "%", "60.0f"}, // Vector float
BinaryData{"v2float", "v2float_50_60", "OpFRem", "v2float_60_50", BinaryData{"v2float", "v2float_50_60", "OpFRem", "v2float_60_50",
"vec2<f32>", AstFor("v2float_50_60"), "%", "vec2<f32>", AstFor("v2float_50_60"), "%",
AstFor("v2float_60_50")})); AstFor("v2float_60_50")}));
@ -687,7 +687,7 @@ TEST_F(SpvBinaryArithTestBasic, FMod_Scalar) {
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvBinaryArithTestBasic, FMod_Vector) {
@ -706,7 +706,7 @@ TEST_F(SpvBinaryArithTestBasic, FMod_Vector) {
EXPECT_THAT( EXPECT_THAT(
test::ToString(p->program(), ast_body), test::ToString(p->program(), ast_body),
HasSubstr( 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) { TEST_F(SpvBinaryArithTestBasic, VectorTimesScalar) {

View File

@ -98,7 +98,7 @@ TEST_F(SpvParserTest_Composite_Construct, Vector) {
EXPECT_THAT(test::ToString(p->program(), ast_body), EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr(R"(let x_1 : vec2<u32> = vec2<u32>(10u, 20u); HasSubstr(R"(let x_1 : vec2<u32> = vec2<u32>(10u, 20u);
let x_2 : vec2<i32> = vec2<i32>(30i, 40i); 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 @@ TEST_F(SpvParserTest_Composite_Construct, Matrix) {
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body), EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr("let x_1 : mat3x2<f32> = mat3x2<f32>(" HasSubstr("let x_1 : mat3x2<f32> = mat3x2<f32>("
"vec2<f32>(50.0, 60.0), " "vec2<f32>(50.0f, 60.0f), "
"vec2<f32>(60.0, 50.0), " "vec2<f32>(60.0f, 50.0f), "
"vec2<f32>(70.0, 70.0));")); "vec2<f32>(70.0f, 70.0f));"));
} }
TEST_F(SpvParserTest_Composite_Construct, Array) { TEST_F(SpvParserTest_Composite_Construct, Array) {
@ -153,7 +153,7 @@ TEST_F(SpvParserTest_Composite_Construct, Struct) {
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvParserTest_Composite_Construct, ConstantComposite_Struct_NoDeduplication) {
@ -201,7 +201,7 @@ TEST_F(SpvParserTest_CompositeExtract, Vector) {
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvParserTest_CompositeExtract, Vector_IndexTooBigError) {
@ -448,8 +448,8 @@ TEST_F(SpvParserTest_CompositeInsert, Vector) {
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
auto got = test::ToString(p->program(), ast_body); auto got = test::ToString(p->program(), ast_body);
const auto* expected = const auto* expected =
R"(var x_1_1 : vec2<f32> = vec2<f32>(50.0, 60.0); R"(var x_1_1 : vec2<f32> = vec2<f32>(50.0f, 60.0f);
x_1_1.y = 70.0; x_1_1.y = 70.0f;
let x_1 : vec2<f32> = x_1_1; let x_1 : vec2<f32> = x_1_1;
return; return;
)"; )";
@ -492,7 +492,7 @@ TEST_F(SpvParserTest_CompositeInsert, Matrix) {
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
auto body_str = test::ToString(p->program(), 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; 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; let x_2 : mat3x2<f32> = x_2_1;
)")) << body_str; )")) << body_str;
} }
@ -537,7 +537,7 @@ TEST_F(SpvParserTest_CompositeInsert, Matrix_Vector) {
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
auto body_str = test::ToString(p->program(), 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; 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; let x_2 : mat3x2<f32> = x_2_1;
return; return;
)")) << body_str; )")) << body_str;
@ -713,7 +713,7 @@ TEST_F(SpvParserTest_CompositeInsert, Struct_Array_Matrix_Vector) {
EXPECT_THAT(body_str, HasSubstr(R"(var x_38 : S_1; EXPECT_THAT(body_str, HasSubstr(R"(var x_38 : S_1;
let x_1 : S_1 = x_38; let x_1 : S_1 = x_38;
var x_2_1 : S_1 = x_1; 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; let x_2 : S_1 = x_2_1;
)")) << body_str; )")) << body_str;
} }

View File

@ -83,7 +83,7 @@ TEST_F(SpvUnaryConversionTest, Bitcast_Scalar) {
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvUnaryConversionTest, Bitcast_Vector) {

View File

@ -93,7 +93,7 @@ TEST_F(SpvParserTest, Emit_NonVoidResultType) {
auto got = test::ToString(p->program()); auto got = test::ToString(p->program());
std::string expect = R"(fn x_200() -> f32 { std::string expect = R"(fn x_200() -> f32 {
return 0.0; return 0.0f;
} }
)"; )";
EXPECT_THAT(got, HasSubstr(expect)); EXPECT_THAT(got, HasSubstr(expect));

View File

@ -673,7 +673,7 @@ TEST_F(SpvParserTest, Normalize_Scalar) {
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
const auto body = test::ToString(p->program(), 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) { TEST_F(SpvParserTest, Normalize_Vector2) {
@ -981,7 +981,7 @@ TEST_F(SpvParserTest, GlslStd450_Refract_Scalar) {
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
const auto body = test::ToString(p->program(), ast_body); const auto body = test::ToString(p->program(), ast_body);
const auto* expected = 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; EXPECT_THAT(body, HasSubstr(expected)) << body;
} }
@ -1019,7 +1019,7 @@ TEST_F(SpvParserTest, GlslStd450_FaceForward_Scalar) {
// The %99 sum only has one use. Ensure it is evaluated only once by // 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 // making a let-declaration for it, since it is the normal operand to
// the builtin function, and code generation uses it twice. // 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; EXPECT_THAT(body, HasSubstr(expected)) << body;
} }
@ -1059,7 +1059,7 @@ TEST_F(SpvParserTest, GlslStd450_Reflect_Scalar) {
// The %99 sum only has one use. Ensure it is evaluated only once by // 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 // making a let-declaration for it, since it is the normal operand to
// the builtin function, and code generation uses it twice. // 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; EXPECT_THAT(body, HasSubstr(expected)) << body;
} }

View File

@ -112,10 +112,10 @@ std::string AstFor(std::string assembly) {
return "bitcast<vec2<u32>>(vec2<i32>(40i, 30i))"; return "bitcast<vec2<u32>>(vec2<i32>(40i, 30i))";
} }
if (assembly == "v2float_50_60") { if (assembly == "v2float_50_60") {
return "vec2<f32>(50.0, 60.0)"; return "vec2<f32>(50.0f, 60.0f)";
} }
if (assembly == "v2float_60_50") { if (assembly == "v2float_60_50") {
return "vec2<f32>(60.0, 50.0)"; return "vec2<f32>(60.0f, 50.0f)";
} }
return "bad case"; return "bad case";
} }
@ -219,7 +219,7 @@ INSTANTIATE_TEST_SUITE_P(
INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdEqual, INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdEqual,
SpvBinaryLogicalTest, SpvBinaryLogicalTest,
::testing::Values(BinaryData{"bool", "float_50", "OpFOrdEqual", "float_60", ::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", BinaryData{"v2bool", "v2float_50_60", "OpFOrdEqual",
"v2float_60_50", "vec2<bool>", "v2float_60_50", "vec2<bool>",
AstFor("v2float_50_60"), AstFor("v2float_50_60"),
@ -249,7 +249,7 @@ INSTANTIATE_TEST_SUITE_P(
INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdNotEqual, INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdNotEqual,
SpvBinaryLogicalTest, SpvBinaryLogicalTest,
::testing::Values(BinaryData{"bool", "float_50", "OpFOrdNotEqual", ::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", BinaryData{"v2bool", "v2float_50_60", "OpFOrdNotEqual",
"v2float_60_50", "vec2<bool>", "v2float_60_50", "vec2<bool>",
AstFor("v2float_50_60"), AstFor("v2float_50_60"),
@ -258,7 +258,7 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdNotEqual,
INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdLessThan, INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdLessThan,
SpvBinaryLogicalTest, SpvBinaryLogicalTest,
::testing::Values(BinaryData{"bool", "float_50", "OpFOrdLessThan", ::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", BinaryData{"v2bool", "v2float_50_60", "OpFOrdLessThan",
"v2float_60_50", "vec2<bool>", "v2float_60_50", "vec2<bool>",
AstFor("v2float_50_60"), "<", AstFor("v2float_50_60"), "<",
@ -267,7 +267,7 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdLessThan,
INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdLessThanEqual, INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdLessThanEqual,
SpvBinaryLogicalTest, SpvBinaryLogicalTest,
::testing::Values(BinaryData{"bool", "float_50", "OpFOrdLessThanEqual", ::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", BinaryData{"v2bool", "v2float_50_60",
"OpFOrdLessThanEqual", "v2float_60_50", "OpFOrdLessThanEqual", "v2float_60_50",
"vec2<bool>", AstFor("v2float_50_60"), "vec2<bool>", AstFor("v2float_50_60"),
@ -276,7 +276,7 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdLessThanEqual,
INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdGreaterThan, INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdGreaterThan,
SpvBinaryLogicalTest, SpvBinaryLogicalTest,
::testing::Values(BinaryData{"bool", "float_50", "OpFOrdGreaterThan", ::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", BinaryData{"v2bool", "v2float_50_60",
"OpFOrdGreaterThan", "v2float_60_50", "OpFOrdGreaterThan", "v2float_60_50",
"vec2<bool>", AstFor("v2float_50_60"), ">", "vec2<bool>", AstFor("v2float_50_60"), ">",
@ -285,7 +285,7 @@ INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdGreaterThan,
INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdGreaterThanEqual, INSTANTIATE_TEST_SUITE_P(SpvParserTest_FOrdGreaterThanEqual,
SpvBinaryLogicalTest, SpvBinaryLogicalTest,
::testing::Values(BinaryData{"bool", "float_50", "OpFOrdGreaterThanEqual", ::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", BinaryData{"v2bool", "v2float_50_60",
"OpFOrdGreaterThanEqual", "v2float_60_50", "OpFOrdGreaterThanEqual", "v2float_60_50",
"vec2<bool>", AstFor("v2float_50_60"), "vec2<bool>", AstFor("v2float_50_60"),
@ -515,7 +515,7 @@ TEST_F(SpvFUnordTest, FUnordEqual_Scalar) {
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvFUnordTest, FUnordEqual_Vector) {
@ -533,7 +533,7 @@ TEST_F(SpvFUnordTest, FUnordEqual_Vector) {
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body), EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr("let x_1 : vec2<bool> = " 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) { TEST_F(SpvFUnordTest, FUnordNotEqual_Scalar) {
@ -550,7 +550,7 @@ TEST_F(SpvFUnordTest, FUnordNotEqual_Scalar) {
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvFUnordTest, FUnordNotEqual_Vector) {
@ -568,7 +568,7 @@ TEST_F(SpvFUnordTest, FUnordNotEqual_Vector) {
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body), EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr("let x_1 : vec2<bool> = " 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) { TEST_F(SpvFUnordTest, FUnordLessThan_Scalar) {
@ -585,7 +585,7 @@ TEST_F(SpvFUnordTest, FUnordLessThan_Scalar) {
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvFUnordTest, FUnordLessThan_Vector) {
@ -603,7 +603,7 @@ TEST_F(SpvFUnordTest, FUnordLessThan_Vector) {
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body), EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr("let x_1 : vec2<bool> = " 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) { TEST_F(SpvFUnordTest, FUnordLessThanEqual_Scalar) {
@ -620,7 +620,7 @@ TEST_F(SpvFUnordTest, FUnordLessThanEqual_Scalar) {
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvFUnordTest, FUnordLessThanEqual_Vector) {
@ -638,7 +638,7 @@ TEST_F(SpvFUnordTest, FUnordLessThanEqual_Vector) {
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body), EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr("let x_1 : vec2<bool> = " 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) { TEST_F(SpvFUnordTest, FUnordGreaterThan_Scalar) {
@ -655,7 +655,7 @@ TEST_F(SpvFUnordTest, FUnordGreaterThan_Scalar) {
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvFUnordTest, FUnordGreaterThan_Vector) {
@ -673,7 +673,7 @@ TEST_F(SpvFUnordTest, FUnordGreaterThan_Vector) {
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body), EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr("let x_1 : vec2<bool> = " 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) { TEST_F(SpvFUnordTest, FUnordGreaterThanEqual_Scalar) {
@ -690,7 +690,7 @@ TEST_F(SpvFUnordTest, FUnordGreaterThanEqual_Scalar) {
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvFUnordTest, FUnordGreaterThanEqual_Vector) {
@ -708,7 +708,7 @@ TEST_F(SpvFUnordTest, FUnordGreaterThanEqual_Vector) {
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body), EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr("let x_1 : vec2<bool> = !((" 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 @@ TEST_F(SpvLogicalTest, Select_BoolCond_FloatScalarParams) {
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvLogicalTest, Select_BoolCond_VectorParams) {
@ -859,7 +859,8 @@ TEST_F(SpvLogicalTest, IsNan_Scalar) {
auto fe = p->function_emitter(100); auto fe = p->function_emitter(100);
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); 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) { TEST_F(SpvLogicalTest, IsNan_Vector) {
@ -876,7 +877,7 @@ TEST_F(SpvLogicalTest, IsNan_Vector) {
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvLogicalTest, IsInf_Scalar) {
@ -892,7 +893,8 @@ TEST_F(SpvLogicalTest, IsInf_Scalar) {
auto fe = p->function_emitter(100); auto fe = p->function_emitter(100);
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); 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) { TEST_F(SpvLogicalTest, IsInf_Vector) {
@ -909,7 +911,7 @@ TEST_F(SpvLogicalTest, IsInf_Vector) {
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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. // TODO(dneto): Kernel-guarded instructions.

View File

@ -133,8 +133,9 @@ TEST_F(SpvParserMemoryTest, EmitStatement_StoreFloatConst) {
auto fe = p->function_emitter(100); auto fe = p->function_emitter(100);
EXPECT_TRUE(fe.EmitBody()); EXPECT_TRUE(fe.EmitBody());
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(x_1 = 42.0; EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(x_1 = 42.0f;
x_1 = 0.0; x_1 = 0.0f;
return;
)")); )"));
} }
@ -497,7 +498,7 @@ TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Matrix) {
EXPECT_TRUE(fe.EmitBody()); EXPECT_TRUE(fe.EmitBody());
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Array) {
@ -529,7 +530,7 @@ TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Array) {
EXPECT_TRUE(fe.EmitBody()); EXPECT_TRUE(fe.EmitBody());
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Struct) {
@ -559,7 +560,7 @@ TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Struct) {
auto fe = p->function_emitter(100); auto fe = p->function_emitter(100);
EXPECT_TRUE(fe.EmitBody()); EXPECT_TRUE(fe.EmitBody());
auto ast_body = fe.ast_body(); 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) { TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Struct_DifferOnlyMemberName) {
@ -601,8 +602,9 @@ TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Struct_DifferOnlyMemberNam
auto fe = p->function_emitter(100); auto fe = p->function_emitter(100);
EXPECT_TRUE(fe.EmitBody()); EXPECT_TRUE(fe.EmitBody());
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(myvar.age = 42.0; EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(myvar.age = 42.0f;
myvar2.ancientness = 420.0; myvar2.ancientness = 420.0f;
return;
)")); )"));
} }
@ -706,7 +708,7 @@ TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Struct_RuntimeArray) {
auto fe = p->function_emitter(100); auto fe = p->function_emitter(100);
EXPECT_TRUE(fe.EmitBody()); EXPECT_TRUE(fe.EmitBody());
auto ast_body = fe.ast_body(); 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) { TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Compound_Matrix_Vector) {
@ -737,7 +739,7 @@ TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_Compound_Matrix_Vector) {
auto fe = p->function_emitter(100); auto fe = p->function_emitter(100);
EXPECT_TRUE(fe.EmitBody()); EXPECT_TRUE(fe.EmitBody());
auto ast_body = fe.ast_body(); 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) { TEST_F(SpvParserMemoryTest, EmitStatement_AccessChain_InvalidPointeeType) {

View File

@ -75,7 +75,8 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_BeforeFunction_Scalar) {
EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_11 : bool = false; EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_11 : bool = false;
let x_12 : u32 = 0u; let x_12 : u32 = 0u;
let x_13 : i32 = 0i; let x_13 : i32 = 0i;
let x_14 : f32 = 0.0; let x_14 : f32 = 0.0f;
return;
)")); )"));
} }
@ -133,7 +134,8 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Scalar) {
EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_11 : bool = false; EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(let x_11 : bool = false;
let x_12 : u32 = 0u; let x_12 : u32 = 0u;
let x_13 : i32 = 0i; let x_13 : i32 = 0i;
let x_14 : f32 = 0.0; let x_14 : f32 = 0.0f;
return;
)")); )"));
} }
@ -224,7 +226,7 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Struct) {
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvParserTestMiscInstruction, OpNop) {
@ -330,7 +332,7 @@ TEST_F(SpvParserTest, ValueFromBlockNotInBlockOrder) {
EXPECT_TRUE(fe.EmitBody()) << p->error(); EXPECT_TRUE(fe.EmitBody()) << p->error();
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
const auto got = test::ToString(p->program(), 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) // TODO(dneto): OpSizeof : requires Kernel (OpenCL)

View File

@ -184,7 +184,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ScalarInitializers) {
var b : bool = false; var b : bool = false;
var c : i32 = -1i; var c : i32 = -1i;
var d : u32 = 1u; var d : u32 = 1u;
var e : f32 = 1.5; var e : f32 = 1.5f;
)")); )"));
} }
@ -212,7 +212,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ScalarNullInitializers) {
EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(var a : bool = false; EXPECT_THAT(test::ToString(p->program(), ast_body), HasSubstr(R"(var a : bool = false;
var b : i32 = 0i; var b : i32 = 0i;
var c : u32 = 0u; var c : u32 = 0u;
var d : f32 = 0.0; var d : f32 = 0.0f;
)")); )"));
} }
@ -234,7 +234,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_VectorInitializer) {
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_MatrixInitializer) {
@ -261,9 +261,9 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_MatrixInitializer) {
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), ast_body), EXPECT_THAT(test::ToString(p->program(), ast_body),
HasSubstr("var x_200 : mat3x2<f32> = mat3x2<f32>(" HasSubstr("var x_200 : mat3x2<f32> = mat3x2<f32>("
"vec2<f32>(1.5, 2.0), " "vec2<f32>(1.5f, 2.0f), "
"vec2<f32>(2.0, 3.0), " "vec2<f32>(2.0f, 3.0f), "
"vec2<f32>(3.0, 4.0));")); "vec2<f32>(3.0f, 4.0f));"));
} }
TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ArrayInitializer) { TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_ArrayInitializer) {
@ -382,7 +382,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_StructInitializer) {
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_StructInitializer_Null) {
@ -404,7 +404,7 @@ TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_StructInitializer_Null) {
auto ast_body = fe.ast_body(); auto ast_body = fe.ast_body();
EXPECT_THAT(test::ToString(p->program(), 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) { TEST_F(SpvParserFunctionVarTest, EmitFunctionVariables_Decorate_RelaxedPrecision) {

View File

@ -402,7 +402,16 @@ TEST_F(SpvParserTest, EmitFunctions_NonVoidResultType) {
Program program = p->program(); Program program = p->program();
const auto program_ast = test::ToString(program); const auto program_ast = test::ToString(program);
EXPECT_THAT(program_ast, HasSubstr(R"(fn ret_float() -> f32 { 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; )")) << program_ast;
} }

View File

@ -1648,7 +1648,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler_comparison; R"(@group(0) @binding(0) var x_10 : sampler_comparison;
@group(2) @binding(1) var x_20 : texture_depth_2d;)", @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 // OpImageDrefGather 2DDepth ConstOffset signed
ImageAccessCase{"%float 2D 1 0 0 1 Unknown", ImageAccessCase{"%float 2D 1 0 0 1 Unknown",
"%result = OpImageDrefGather " "%result = OpImageDrefGather "
@ -1656,7 +1656,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler_comparison; R"(@group(0) @binding(0) var x_10 : sampler_comparison;
@group(2) @binding(1) var x_20 : texture_depth_2d;)", @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))"}, "vec2<i32>(3i, 4i))"},
// OpImageDrefGather 2DDepth ConstOffset unsigned // OpImageDrefGather 2DDepth ConstOffset unsigned
ImageAccessCase{"%float 2D 1 0 0 1 Unknown", ImageAccessCase{"%float 2D 1 0 0 1 Unknown",
@ -1666,7 +1666,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler_comparison; R"(@group(0) @binding(0) var x_10 : sampler_comparison;
@group(2) @binding(1) var x_20 : texture_depth_2d;)", @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)))"}, "vec2<i32>(vec2<u32>(3u, 4u)))"},
// OpImageDrefGather 2DDepth Array // OpImageDrefGather 2DDepth Array
ImageAccessCase{"%float 2D 1 1 0 1 Unknown", ImageAccessCase{"%float 2D 1 1 0 1 Unknown",
@ -1676,7 +1676,7 @@ INSTANTIATE_TEST_SUITE_P(
@group(2) @binding(1) var x_20 : texture_depth_2d_array;)", @group(2) @binding(1) var x_20 : texture_depth_2d_array;)",
"textureGatherCompare(x_20, x_10, coords123.xy, " "textureGatherCompare(x_20, x_10, coords123.xy, "
"i32(round(coords123.z)), 0.200000003)"}, "i32(round(coords123.z)), 0.200000003f)"},
// OpImageDrefGather 2DDepth Array ConstOffset signed // OpImageDrefGather 2DDepth Array ConstOffset signed
ImageAccessCase{"%float 2D 1 1 0 1 Unknown", ImageAccessCase{"%float 2D 1 1 0 1 Unknown",
"%result = OpImageDrefGather " "%result = OpImageDrefGather "
@ -1685,7 +1685,7 @@ INSTANTIATE_TEST_SUITE_P(
@group(2) @binding(1) var x_20 : texture_depth_2d_array;)", @group(2) @binding(1) var x_20 : texture_depth_2d_array;)",
"textureGatherCompare(x_20, x_10, coords123.xy, " "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 // OpImageDrefGather 2DDepth Array ConstOffset unsigned
ImageAccessCase{"%float 2D 1 1 0 1 Unknown", ImageAccessCase{"%float 2D 1 1 0 1 Unknown",
"%result = OpImageDrefGather " "%result = OpImageDrefGather "
@ -1695,7 +1695,7 @@ INSTANTIATE_TEST_SUITE_P(
@group(2) @binding(1) var x_20 : texture_depth_2d_array;)", @group(2) @binding(1) var x_20 : texture_depth_2d_array;)",
"textureGatherCompare(x_20, x_10, coords123.xy, " "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)))"}, "vec2<i32>(vec2<u32>(3u, 4u)))"},
// OpImageDrefGather DepthCube // OpImageDrefGather DepthCube
ImageAccessCase{"%float Cube 1 0 0 1 Unknown", ImageAccessCase{"%float Cube 1 0 0 1 Unknown",
@ -1704,7 +1704,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler_comparison; R"(@group(0) @binding(0) var x_10 : sampler_comparison;
@group(2) @binding(1) var x_20 : texture_depth_cube;)", @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 // OpImageDrefGather DepthCube Array
ImageAccessCase{"%float Cube 1 1 0 1 Unknown", ImageAccessCase{"%float Cube 1 1 0 1 Unknown",
"%result = OpImageDrefGather " "%result = OpImageDrefGather "
@ -1713,7 +1713,7 @@ INSTANTIATE_TEST_SUITE_P(
@group(2) @binding(1) var x_20 : texture_depth_cube_array;)", @group(2) @binding(1) var x_20 : texture_depth_cube_array;)",
"textureGatherCompare(x_20, x_10, coords1234.xyz, " "textureGatherCompare(x_20, x_10, coords1234.xyz, "
"i32(round(coords1234.w)), 0.200000003)"}})); "i32(round(coords1234.w)), 0.200000003f)"}}));
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_TEST_SUITE_P(
ImageSampleImplicitLod, ImageSampleImplicitLod,
@ -1764,7 +1764,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler; R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)", @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 // OpImageSampleImplicitLod arrayed with Bias
ImageAccessCase{ ImageAccessCase{
@ -1774,7 +1774,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler; R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d_array<f32>;)", @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 // OpImageSampleImplicitLod with Bias and signed ConstOffset
ImageAccessCase{"%float 2D 0 0 0 1 Unknown", ImageAccessCase{"%float 2D 0 0 0 1 Unknown",
@ -1784,7 +1784,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler; R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)", @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 // OpImageSampleImplicitLod with Bias and unsigned ConstOffset
// Convert ConstOffset to signed // Convert ConstOffset to signed
@ -1796,7 +1796,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler; R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)", @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 // OpImageSampleImplicitLod arrayed with Bias
ImageAccessCase{ ImageAccessCase{
"%float 2D 0 1 0 1 Unknown", "%float 2D 0 1 0 1 Unknown",
@ -1806,7 +1806,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler; R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d_array<f32>;)", @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( INSTANTIATE_TEST_SUITE_P(
// This test shows the use of a sampled image used with both regular // This test shows the use of a sampled image used with both regular
@ -1831,8 +1831,8 @@ INSTANTIATE_TEST_SUITE_P(
@group(0) @binding(1) var x_30 : sampler_comparison; @group(0) @binding(1) var x_30 : sampler_comparison;
)", )",
R"( R"(
let x_200 : vec4<f32> = vec4<f32>(textureSample(x_20, x_10, coords12), 0.0, 0.0, 0.0); 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.200000003); let x_210 : f32 = textureSampleCompare(x_20, x_30, coords12, 0.200000003f);
)"})); )"}));
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_TEST_SUITE_P(
@ -1847,7 +1847,7 @@ INSTANTIATE_TEST_SUITE_P(
@group(2) @binding(1) var x_20 : texture_depth_2d; @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 // ImageSampleDrefImplicitLod - arrayed
ImageAccessCase{ ImageAccessCase{
"%float 2D 0 1 0 1 Unknown", "%float 2D 0 1 0 1 Unknown",
@ -1856,7 +1856,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler_comparison; R"(@group(0) @binding(0) var x_10 : sampler_comparison;
@group(2) @binding(1) var x_20 : texture_depth_2d_array;)", @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 // ImageSampleDrefImplicitLod with ConstOffset
ImageAccessCase{ ImageAccessCase{
"%float 2D 0 0 0 1 Unknown", "%float 2D 0 0 0 1 Unknown",
@ -1866,7 +1866,7 @@ INSTANTIATE_TEST_SUITE_P(
@group(2) @binding(1) var x_20 : texture_depth_2d; @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 // ImageSampleDrefImplicitLod arrayed with ConstOffset
ImageAccessCase{ ImageAccessCase{
"%float 2D 0 1 0 1 Unknown", "%float 2D 0 1 0 1 Unknown",
@ -1875,7 +1875,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler_comparison; R"(@group(0) @binding(0) var x_10 : sampler_comparison;
@group(2) @binding(1) var x_20 : texture_depth_2d_array;)", @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( INSTANTIATE_TEST_SUITE_P(
ImageSampleDrefExplicitLod, ImageSampleDrefExplicitLod,
@ -1891,7 +1891,7 @@ INSTANTIATE_TEST_SUITE_P(
@group(2) @binding(1) var x_20 : texture_depth_2d; @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 // 2D array
ImageAccessCase{ ImageAccessCase{
"%float 2D 1 1 0 1 Unknown", "%float 2D 1 1 0 1 Unknown",
@ -1900,7 +1900,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler_comparison; R"(@group(0) @binding(0) var x_10 : sampler_comparison;
@group(2) @binding(1) var x_20 : texture_depth_2d_array;)", @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 // 2D, ConstOffset
ImageAccessCase{ ImageAccessCase{
"%float 2D 1 0 0 1 Unknown", "%float 2D 1 0 0 1 Unknown",
@ -1911,7 +1911,7 @@ INSTANTIATE_TEST_SUITE_P(
@group(2) @binding(1) var x_20 : texture_depth_2d; @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 // 2D array, ConstOffset
ImageAccessCase{ ImageAccessCase{
"%float 2D 1 1 0 1 Unknown", "%float 2D 1 1 0 1 Unknown",
@ -1921,7 +1921,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler_comparison; R"(@group(0) @binding(0) var x_10 : sampler_comparison;
@group(2) @binding(1) var x_20 : texture_depth_2d_array;)", @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 // Cube
ImageAccessCase{"%float Cube 1 0 0 1 Unknown", ImageAccessCase{"%float Cube 1 0 0 1 Unknown",
"%result = OpImageSampleDrefExplicitLod " "%result = OpImageSampleDrefExplicitLod "
@ -1929,7 +1929,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler_comparison; R"(@group(0) @binding(0) var x_10 : sampler_comparison;
@group(2) @binding(1) var x_20 : texture_depth_cube;)", @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 // Cube array
ImageAccessCase{ ImageAccessCase{
"%float Cube 1 1 0 1 Unknown", "%float Cube 1 1 0 1 Unknown",
@ -1938,7 +1938,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler_comparison; R"(@group(0) @binding(0) var x_10 : sampler_comparison;
@group(2) @binding(1) var x_20 : texture_depth_cube_array;)", @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( INSTANTIATE_TEST_SUITE_P(
ImageSampleExplicitLod_UsingLod, ImageSampleExplicitLod_UsingLod,
@ -1952,7 +1952,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler; R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)", @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 // OpImageSampleExplicitLod arrayed - using Lod
ImageAccessCase{ ImageAccessCase{
@ -1962,7 +1962,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler; R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d_array<f32>;)", @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 // OpImageSampleExplicitLod - using Lod and ConstOffset
ImageAccessCase{"%float 2D 0 0 0 1 Unknown", ImageAccessCase{"%float 2D 0 0 0 1 Unknown",
@ -1972,7 +1972,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler; R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)", @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 // OpImageSampleExplicitLod - using Lod and unsigned ConstOffset
// Convert the ConstOffset operand to signed // Convert the ConstOffset operand to signed
@ -1984,7 +1984,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler; R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)", @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 // OpImageSampleExplicitLod arrayed - using Lod and ConstOffset
ImageAccessCase{ ImageAccessCase{
@ -1995,7 +1995,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler; R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d_array<f32>;)", @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( INSTANTIATE_TEST_SUITE_P(
ImageSampleExplicitLod_UsingGrad, ImageSampleExplicitLod_UsingGrad,
@ -2092,7 +2092,7 @@ INSTANTIATE_TEST_SUITE_P(
@group(2) @binding(1) var x_20 : texture_depth_2d; @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 // Projection sampling
@ -2176,7 +2176,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler; R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)", @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 // OpImageSampleProjImplicitLod with Bias and signed ConstOffset
ImageAccessCase{ ImageAccessCase{
@ -2187,7 +2187,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler; R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)", @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 // OpImageSampleProjImplicitLod with Bias and unsigned ConstOffset
// Convert ConstOffset to signed // Convert ConstOffset to signed
@ -2199,7 +2199,7 @@ INSTANTIATE_TEST_SUITE_P(
R"(@group(0) @binding(0) var x_10 : sampler; R"(@group(0) @binding(0) var x_10 : sampler;
@group(2) @binding(1) var x_20 : texture_2d<f32>;)", @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( INSTANTIATE_TEST_SUITE_P(
ImageSampleProjExplicitLod_Lod, ImageSampleProjExplicitLod_Lod,
@ -2266,7 +2266,7 @@ INSTANTIATE_TEST_SUITE_P(
// Sampling the depth texture yields an f32, but the // Sampling the depth texture yields an f32, but the
// SPIR-V operation yiedls vec4<f32>, so fill out the // SPIR-V operation yiedls vec4<f32>, so fill out the
// remaining components with 0. // 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( INSTANTIATE_TEST_SUITE_P(
ImageSampleProjDrefImplicitLod, ImageSampleProjDrefImplicitLod,
@ -2311,7 +2311,7 @@ INSTANTIATE_TEST_SUITE_P(
@group(2) @binding(1) var x_20 : texture_depth_2d; @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 // OpImageSampleProjDrefImplicitLod 2D depth-texture, Lod ConstOffset
ImageAccessCase{ ImageAccessCase{
@ -2323,7 +2323,7 @@ INSTANTIATE_TEST_SUITE_P(
@group(2) @binding(1) var x_20 : texture_depth_2d; @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 // End projection sampling
@ -2416,15 +2416,15 @@ INSTANTIATE_TEST_SUITE_P(
// Source 1 component // Source 1 component
{"%float 2D 0 0 0 2 R32f", "OpImageWrite %im %vi12 %f1", {"%float 2D 0 0 0 2 R32f", "OpImageWrite %im %vi12 %f1",
R"(@group(2) @binding(1) var x_20 : texture_storage_2d<r32float, write>;)", 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 // Source 2 component, dest 1 component
{"%float 2D 0 0 0 2 R32f", "OpImageWrite %im %vi12 %vf12", {"%float 2D 0 0 0 2 R32f", "OpImageWrite %im %vi12 %vf12",
R"(@group(2) @binding(1) var x_20 : texture_storage_2d<r32float, write>;)", 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 // Source 3 component, dest 1 component
{"%float 2D 0 0 0 2 R32f", "OpImageWrite %im %vi12 %vf123", {"%float 2D 0 0 0 2 R32f", "OpImageWrite %im %vi12 %vf123",
R"(@group(2) @binding(1) var x_20 : texture_storage_2d<r32float, write>;)", 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 // Source 4 component, dest 1 component
{"%float 2D 0 0 0 2 R32f", "OpImageWrite %im %vi12 %vf1234", {"%float 2D 0 0 0 2 R32f", "OpImageWrite %im %vi12 %vf1234",
R"(@group(2) @binding(1) var x_20 : texture_storage_2d<r32float, write>;)", R"(@group(2) @binding(1) var x_20 : texture_storage_2d<r32float, write>;)",
@ -2432,11 +2432,11 @@ INSTANTIATE_TEST_SUITE_P(
// Source 2 component, dest 2 component // Source 2 component, dest 2 component
{"%float 2D 0 0 0 2 Rg32f", "OpImageWrite %im %vi12 %vf12", {"%float 2D 0 0 0 2 Rg32f", "OpImageWrite %im %vi12 %vf12",
R"(@group(2) @binding(1) var x_20 : texture_storage_2d<rg32float, write>;)", 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 // Source 3 component, dest 2 component
{"%float 2D 0 0 0 2 Rg32f", "OpImageWrite %im %vi12 %vf123", {"%float 2D 0 0 0 2 Rg32f", "OpImageWrite %im %vi12 %vf123",
R"(@group(2) @binding(1) var x_20 : texture_storage_2d<rg32float, write>;)", 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 // Source 4 component, dest 2 component
{"%float 2D 0 0 0 2 Rg32f", "OpImageWrite %im %vi12 %vf1234", {"%float 2D 0 0 0 2 Rg32f", "OpImageWrite %im %vi12 %vf1234",
R"(@group(2) @binding(1) var x_20 : texture_storage_2d<rg32float, write>;)", R"(@group(2) @binding(1) var x_20 : texture_storage_2d<rg32float, write>;)",
@ -2583,11 +2583,11 @@ INSTANTIATE_TEST_SUITE_P(
// Level of detail is injected for depth texture // Level of detail is injected for depth texture
{"%float 2D 1 0 0 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12", {"%float 2D 1 0 0 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12",
R"(@group(2) @binding(1) var x_20 : texture_depth_2d;)", 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 // OpImageFetch with extra params, on depth texture
{"%float 2D 1 0 0 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12 Lod %int_3", {"%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"(@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( INSTANTIATE_TEST_SUITE_P(
ImageFetch_Depth, ImageFetch_Depth,
@ -2600,7 +2600,7 @@ INSTANTIATE_TEST_SUITE_P(
// ImageFetch on depth image. // ImageFetch on depth image.
{"%float 2D 1 0 0 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12 ", {"%float 2D 1 0 0 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12 ",
R"(@group(2) @binding(1) var x_20 : texture_depth_2d;)", 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( INSTANTIATE_TEST_SUITE_P(
ImageFetch_DepthMultisampled, ImageFetch_DepthMultisampled,
@ -2613,7 +2613,7 @@ INSTANTIATE_TEST_SUITE_P(
// ImageFetch on multisampled depth image. // ImageFetch on multisampled depth image.
{"%float 2D 1 0 1 1 Unknown", "%99 = OpImageFetch %v4float %im %vi12 Sample %i1", {"%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"(@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, INSTANTIATE_TEST_SUITE_P(ImageFetch_Multisampled,
SpvParserHandleTest_ImageAccessTest, SpvParserHandleTest_ImageAccessTest,

View File

@ -408,7 +408,7 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPosition_StorePositionMember_OneAcces
EXPECT_TRUE(p->BuildAndParseInternalModule()); EXPECT_TRUE(p->BuildAndParseInternalModule());
EXPECT_TRUE(p->error().empty()); EXPECT_TRUE(p->error().empty());
const auto module_str = test::ToString(p->program()); 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) { TEST_F(SpvModuleScopeVarParserTest, BuiltinPosition_StorePositionMember_TwoAccessChain) {
@ -430,7 +430,7 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPosition_StorePositionMember_TwoAcces
EXPECT_TRUE(p->BuildAndParseInternalModule()); EXPECT_TRUE(p->BuildAndParseInternalModule());
EXPECT_TRUE(p->error().empty()); EXPECT_TRUE(p->error().empty());
const auto module_str = test::ToString(p->program()); 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) { TEST_F(SpvModuleScopeVarParserTest, BuiltinPointSize_Write1_IsErased) {
@ -510,7 +510,7 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPointSize_ReadReplaced) {
var<private> gl_Position : vec4<f32>; var<private> gl_Position : vec4<f32>;
fn main_1() { fn main_1() {
x_900 = 1.0; x_900 = 1.0f;
return; return;
} }
@ -681,7 +681,7 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPointSize_Loose_ReadReplaced_Vertex)
var<private> x_900 : f32; var<private> x_900 : f32;
fn main_1() { fn main_1() {
x_900 = 1.0; x_900 = 1.0f;
return; return;
} }
@ -889,7 +889,7 @@ var<private> x_3 : i32 = -1i;
var<private> x_4 : u32 = 1u; 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_2 : i32 = 0i;
var<private> x_3 : u32 = 0u; 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_2 : i32 = 0i;
var<private> x_3 : u32 = 0u; 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. // This example module emits ok, but is not valid SPIR-V in the first place.
@ -956,7 +956,7 @@ TEST_F(SpvModuleScopeVarParserTest, VectorInitializer) {
ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()); ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions());
EXPECT_TRUE(p->error().empty()); EXPECT_TRUE(p->error().empty());
const auto module_str = test::ToString(p->program()); 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) { TEST_F(SpvModuleScopeVarParserTest, VectorBoolNullInitializer) {
@ -1083,9 +1083,9 @@ TEST_F(SpvModuleScopeVarParserTest, MatrixInitializer) {
EXPECT_TRUE(p->error().empty()); EXPECT_TRUE(p->error().empty());
const auto module_str = test::ToString(p->program()); const auto module_str = test::ToString(p->program());
EXPECT_THAT(module_str, HasSubstr("var<private> x_200 : mat3x2<f32> = mat3x2<f32>(" EXPECT_THAT(module_str, HasSubstr("var<private> x_200 : mat3x2<f32> = mat3x2<f32>("
"vec2<f32>(1.5, 2.0), " "vec2<f32>(1.5f, 2.0f), "
"vec2<f32>(2.0, 3.0), " "vec2<f32>(2.0f, 3.0f), "
"vec2<f32>(3.0, 4.0));")); "vec2<f32>(3.0f, 4.0f));"));
} }
TEST_F(SpvModuleScopeVarParserTest, MatrixNullInitializer) { TEST_F(SpvModuleScopeVarParserTest, MatrixNullInitializer) {
@ -1168,7 +1168,7 @@ TEST_F(SpvModuleScopeVarParserTest, StructInitializer) {
EXPECT_TRUE(p->error().empty()); EXPECT_TRUE(p->error().empty());
const auto module_str = test::ToString(p->program()); const auto module_str = test::ToString(p->program());
EXPECT_THAT(module_str, 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; << module_str;
} }
@ -1181,7 +1181,7 @@ TEST_F(SpvModuleScopeVarParserTest, StructNullInitializer) {
ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << p->error(); ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << p->error();
EXPECT_TRUE(p->error().empty()); EXPECT_TRUE(p->error().empty());
const auto module_str = test::ToString(p->program()); 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; << module_str;
} }
@ -1195,7 +1195,7 @@ TEST_F(SpvModuleScopeVarParserTest, StructUndefInitializer) {
EXPECT_TRUE(p->error().empty()); EXPECT_TRUE(p->error().empty());
const auto module_str = test::ToString(p->program()); 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; << module_str;
// This example module emits ok, but is not valid SPIR-V in the first place. // This example module emits ok, but is not valid SPIR-V in the first place.
@ -1565,7 +1565,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarSpecConstant_DeclareConst_F32) {
ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << p->error(); ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << p->error();
EXPECT_TRUE(p->error().empty()); EXPECT_TRUE(p->error().empty());
const auto module_str = test::ToString(p->program()); 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) { TEST_F(SpvModuleScopeVarParserTest, ScalarSpecConstant_DeclareConst_F32_WithoutSpecId) {
@ -1580,7 +1580,7 @@ TEST_F(SpvModuleScopeVarParserTest, ScalarSpecConstant_DeclareConst_F32_WithoutS
ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << p->error(); ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << p->error();
EXPECT_TRUE(p->error().empty()); EXPECT_TRUE(p->error().empty());
const auto module_str = test::ToString(p->program()); 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) { TEST_F(SpvModuleScopeVarParserTest, ScalarSpecConstant_UsedInFunction) {
@ -3854,7 +3854,7 @@ TEST_F(SpvModuleScopeVarParserTest, EntryPointWrapping_BuiltinVar_FragDepth_Out_
ASSERT_TRUE(p->Parse()) << p->error() << assembly; ASSERT_TRUE(p->Parse()) << p->error() << assembly;
EXPECT_TRUE(p->error().empty()); EXPECT_TRUE(p->error().empty());
const auto got = test::ToString(p->program()); 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() { fn main_1() {
return; return;
@ -3957,7 +3957,7 @@ TEST_F(SpvModuleScopeVarParserTest, BuiltinPosition_BuiltIn_Position_Initializer
const auto got = test::ToString(p->program()); const auto got = test::ToString(p->program());
const std::string expected = 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() { fn main_1() {
return; return;

View File

@ -3173,7 +3173,7 @@ fn vert_main_inner() -> vec4<f32> {
fn vert_main() { fn vert_main() {
let inner_result = vert_main_inner(); let inner_result = vert_main_inner();
value = inner_result; value = inner_result;
vertex_point_size = 1.0; vertex_point_size = 1.0f;
} }
)"; )";
@ -3210,7 +3210,7 @@ fn vert_main() -> tint_symbol {
let inner_result = vert_main_inner(); let inner_result = vert_main_inner();
var wrapper_result : tint_symbol; var wrapper_result : tint_symbol;
wrapper_result.value = inner_result; wrapper_result.value = inner_result;
wrapper_result.vertex_point_size = 1.0; wrapper_result.vertex_point_size = 1.0f;
return wrapper_result; return wrapper_result;
} }
)"; )";
@ -3252,7 +3252,7 @@ fn vert_main_inner() -> VertOut {
fn vert_main() { fn vert_main() {
let inner_result = vert_main_inner(); let inner_result = vert_main_inner();
pos_1 = inner_result.pos; pos_1 = inner_result.pos;
vertex_point_size = 1.0; vertex_point_size = 1.0f;
} }
)"; )";
@ -3289,7 +3289,7 @@ fn vert_main_inner() -> VertOut {
fn vert_main() { fn vert_main() {
let inner_result = vert_main_inner(); let inner_result = vert_main_inner();
pos_1 = inner_result.pos; pos_1 = inner_result.pos;
vertex_point_size = 1.0; vertex_point_size = 1.0f;
} }
struct VertOut { struct VertOut {
@ -3338,7 +3338,7 @@ fn vert_main() -> tint_symbol {
let inner_result = vert_main_inner(); let inner_result = vert_main_inner();
var wrapper_result : tint_symbol; var wrapper_result : tint_symbol;
wrapper_result.pos = inner_result.pos; wrapper_result.pos = inner_result.pos;
wrapper_result.vertex_point_size = 1.0; wrapper_result.vertex_point_size = 1.0f;
return wrapper_result; return wrapper_result;
} }
)"; )";
@ -3380,7 +3380,7 @@ fn vert_main() -> tint_symbol {
let inner_result = vert_main_inner(); let inner_result = vert_main_inner();
var wrapper_result : tint_symbol; var wrapper_result : tint_symbol;
wrapper_result.pos = inner_result.pos; wrapper_result.pos = inner_result.pos;
wrapper_result.vertex_point_size = 1.0; wrapper_result.vertex_point_size = 1.0f;
return wrapper_result; return wrapper_result;
} }
@ -3463,7 +3463,7 @@ fn vert_main() {
let inner_result = vert_main_inner(VertIn1(collide_2), VertIn2(collide_3)); let inner_result = vert_main_inner(VertIn1(collide_2), VertIn2(collide_3));
vertex_point_size_3 = inner_result.vertex_point_size; vertex_point_size_3 = inner_result.vertex_point_size;
vertex_point_size_1_1 = inner_result.vertex_point_size_1; vertex_point_size_1_1 = inner_result.vertex_point_size_1;
vertex_point_size_4 = 1.0; vertex_point_size_4 = 1.0f;
} }
)"; )";
@ -3522,7 +3522,7 @@ fn vert_main() {
let inner_result = vert_main_inner(VertIn1(collide_2), VertIn2(collide_3)); let inner_result = vert_main_inner(VertIn1(collide_2), VertIn2(collide_3));
vertex_point_size_3 = inner_result.vertex_point_size; vertex_point_size_3 = inner_result.vertex_point_size;
vertex_point_size_1_1 = inner_result.vertex_point_size_1; 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 { struct VertIn1 {
@ -3616,7 +3616,7 @@ fn vert_main(tint_symbol : tint_symbol_1) -> tint_symbol_2 {
var wrapper_result : tint_symbol_2; var wrapper_result : tint_symbol_2;
wrapper_result.vertex_point_size = inner_result.vertex_point_size; 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_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; return wrapper_result;
} }
)"; )";
@ -3679,7 +3679,7 @@ fn vert_main(tint_symbol : tint_symbol_1) -> tint_symbol_2 {
var wrapper_result : tint_symbol_2; var wrapper_result : tint_symbol_2;
wrapper_result.vertex_point_size = inner_result.vertex_point_size; 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_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; return wrapper_result;
} }
@ -3768,7 +3768,7 @@ fn vert_main(tint_symbol : tint_symbol_1) -> tint_symbol_2 {
var wrapper_result : tint_symbol_2; var wrapper_result : tint_symbol_2;
wrapper_result.vertex_point_size = inner_result.vertex_point_size; 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_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; return wrapper_result;
} }
)"; )";
@ -3831,7 +3831,7 @@ fn vert_main(tint_symbol : tint_symbol_1) -> tint_symbol_2 {
var wrapper_result : tint_symbol_2; var wrapper_result : tint_symbol_2;
wrapper_result.vertex_point_size = inner_result.vertex_point_size; 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_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; return wrapper_result;
} }
@ -3953,7 +3953,7 @@ fn main() {
let inner_result = vertex_main(bitcast<u32>(gl_VertexID), bitcast<u32>(gl_InstanceID)); let inner_result = vertex_main(bitcast<u32>(gl_VertexID), bitcast<u32>(gl_InstanceID));
gl_Position = inner_result; gl_Position = inner_result;
gl_Position.y = -(gl_Position.y); 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);
} }
)"; )";

View File

@ -872,7 +872,7 @@ fn main() -> vec4<f32> {
@group(0) @binding(0) @internal(disable_validation__binding_point_collision) var placeholder_comparison_sampler : sampler_comparison; @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 { 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; @group(0) @binding(0) @internal(disable_validation__binding_point_collision) var tex_samp : texture_depth_2d;
@ -912,7 +912,7 @@ fn main() -> vec4<f32> {
@group(0) @binding(0) @internal(disable_validation__binding_point_collision) var placeholder_comparison_sampler : sampler_comparison; @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 { 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);
} }
)"; )";

View File

@ -374,8 +374,8 @@ struct S {
@stage(compute) @workgroup_size(1i) @stage(compute) @workgroup_size(1i)
fn f() { fn f() {
s.a = array<strided_arr, 4u>(); 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 = 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.0; s.a[1i].el = 5.0f;
} }
)"; )";
@ -423,8 +423,8 @@ struct S {
@stage(compute) @workgroup_size(1i) @stage(compute) @workgroup_size(1i)
fn f() { fn f() {
s.a = array<f32, 4u>(); s.a = array<f32, 4u>();
s.a = array<f32, 4u>(1.0, 2.0, 3.0, 4.0); s.a = array<f32, 4u>(1.0f, 2.0f, 3.0f, 4.0f);
s.a[1i] = 5.0; s.a[1i] = 5.0f;
} }
)"; )";
@ -483,8 +483,8 @@ struct S {
fn f() { fn f() {
let c = s.a; let c = s.a;
let d = s.a[1i].el; 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 = 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.0; s.a[1i].el = 5.0f;
} }
)"; )";
@ -546,8 +546,8 @@ fn f() {
let a : ARR = s.a; let a : ARR = s.a;
let b : f32 = s.a[1i].el; let b : f32 = s.a[1i].el;
s.a = ARR(); s.a = ARR();
s.a = ARR(strided_arr(1.0), strided_arr(2.0), strided_arr(3.0), strided_arr(4.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.0; s.a[1i].el = 5.0f;
} }
)"; )";
@ -648,7 +648,7 @@ fn f() {
let c : ARR_A = s.a[3i].el[2i]; let c : ARR_A = s.a[3i].el[2i];
let d : f32 = s.a[3i].el[2i][1i].el; let d : f32 = s.a[3i].el[2i][1i].el;
s.a = ARR_B(); s.a = ARR_B();
s.a[3i].el[2i][1i].el = 5.0; s.a[3i].el[2i][1i].el = 5.0f;
} }
)"; )";

View File

@ -376,7 +376,7 @@ fn mat2x2_stride_32_to_arr(m : mat2x2<f32>) -> @stride(32) array<vec2<f32>, 2u>
@stage(compute) @workgroup_size(1i) @stage(compute) @workgroup_size(1i)
fn f() { 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 @@ struct S {
@stage(compute) @workgroup_size(1i) @stage(compute) @workgroup_size(1i)
fn f() { fn f() {
s.m[1i] = vec2<f32>(1.0, 2.0); s.m[1i] = vec2<f32>(1.0f, 2.0f);
} }
)"; )";
@ -505,8 +505,8 @@ fn f() {
let x = arr_to_mat2x2_stride_32(s.m); let x = arr_to_mat2x2_stride_32(s.m);
let y = s.m[1i]; let y = s.m[1i];
let z = x[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 = 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.0, 6.0); s.m[1i] = vec2<f32>(5.0f, 6.0f);
} }
)"; )";
@ -613,7 +613,7 @@ var<private> s : S;
@stage(compute) @workgroup_size(1i) @stage(compute) @workgroup_size(1i)
fn f() { 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));
} }
)"; )";

View File

@ -41,7 +41,7 @@ var<private> a : i32 = 123i;
var<private> b : u32 = 123u; var<private> b : u32 = 123u;
var<private> c : f32 = 123.0; var<private> c : f32 = 123.0f;
var<private> d : bool = true; var<private> d : bool = true;
@ -70,7 +70,7 @@ var<private> a : i32 = 123i;
var<private> b : u32 = 123u; var<private> b : u32 = 123u;
var<private> c : f32 = 123.0; var<private> c : f32 = 123.0f;
var<private> d : bool = true; var<private> d : bool = true;
@ -99,7 +99,7 @@ var<private> a : i32 = 123i;
var<private> b : u32 = 123u; var<private> b : u32 = 123u;
var<private> c : f32 = 123.0; var<private> c : f32 = 123.0f;
var<private> d : bool = true; var<private> d : bool = true;
@ -128,7 +128,7 @@ var<private> a : vec3<i32> = vec3<i32>(123i);
var<private> b : vec3<u32> = vec3<u32>(123u); 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); var<private> d : vec3<bool> = vec3<bool>(true);
@ -157,7 +157,7 @@ var<private> a : vec3<i32> = vec3<i32>(123i);
var<private> b : vec3<u32> = vec3<u32>(123u); 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); var<private> d : vec3<bool> = vec3<bool>(true);
@ -186,7 +186,7 @@ var<private> a : vec3<i32> = vec3<i32>(123i);
var<private> b : vec3<u32> = vec3<u32>(123u); 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); var<private> d : vec3<bool> = vec3<bool>(true);
@ -245,7 +245,7 @@ fn f() {
fn f() { fn f() {
var a : i32 = 123i; var a : i32 = 123i;
var b : u32 = 123u; var b : u32 = 123u;
var c : f32 = 123.0; var c : f32 = 123.0f;
var d : bool = true; var d : bool = true;
} }
)"; )";
@ -269,7 +269,7 @@ fn f() {
fn f() { fn f() {
var a : i32 = 123i; var a : i32 = 123i;
var b : u32 = 123u; var b : u32 = 123u;
var c : f32 = 123.0; var c : f32 = 123.0f;
var d : bool = true; var d : bool = true;
} }
)"; )";
@ -293,7 +293,7 @@ fn f() {
fn f() { fn f() {
var a : i32 = 123i; var a : i32 = 123i;
var b : u32 = 123u; var b : u32 = 123u;
var c : f32 = 123.0; var c : f32 = 123.0f;
var d : bool = true; var d : bool = true;
} }
)"; )";
@ -308,7 +308,7 @@ TEST_F(FoldConstantsTest, Function_Vector_NoConversion) {
fn f() { fn f() {
var a : vec3<i32> = vec3<i32>(123i); var a : vec3<i32> = vec3<i32>(123i);
var b : vec3<u32> = vec3<u32>(123u); 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); var d : vec3<bool> = vec3<bool>(true);
} }
)"; )";
@ -317,7 +317,7 @@ fn f() {
fn f() { fn f() {
var a : vec3<i32> = vec3<i32>(123i); var a : vec3<i32> = vec3<i32>(123i);
var b : vec3<u32> = vec3<u32>(123u); 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); var d : vec3<bool> = vec3<bool>(true);
} }
)"; )";
@ -341,7 +341,7 @@ fn f() {
fn f() { fn f() {
var a : vec3<i32> = vec3<i32>(123i); var a : vec3<i32> = vec3<i32>(123i);
var b : vec3<u32> = vec3<u32>(123u); 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); var d : vec3<bool> = vec3<bool>(true);
} }
)"; )";
@ -365,7 +365,7 @@ fn f() {
fn f() { fn f() {
var a : vec3<i32> = vec3<i32>(123i); var a : vec3<i32> = vec3<i32>(123i);
var b : vec3<u32> = vec3<u32>(123u); 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); var d : vec3<bool> = vec3<bool>(true);
} }
)"; )";
@ -412,7 +412,7 @@ fn f() {
auto* expect = R"( auto* expect = R"(
fn f() { fn f() {
var a : f32 = f32(); var a : f32 = f32();
var b : vec2<f32> = vec2<f32>(1.0, a); var b : vec2<f32> = vec2<f32>(1.0f, a);
} }
)"; )";

View File

@ -249,14 +249,14 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); color = gammaCorrection(color, params.gammaEncodeParams);
return vec4<f32>(color, 1.0); return vec4<f32>(color, 1.0f);
} }
@stage(fragment) @stage(fragment)
@ -318,14 +318,14 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); color = gammaCorrection(color, params.gammaEncodeParams);
return vec4<f32>(color, 1.0); return vec4<f32>(color, 1.0f);
} }
@stage(fragment) @stage(fragment)
@ -394,12 +394,12 @@ fn textureLoadExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, coord
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureLoad(plane0, coord, 0i).rgb; color = textureLoad(plane0, coord, 0i).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); color = gammaCorrection(color, params.gammaEncodeParams);
return vec4<f32>(color, 1.0); return vec4<f32>(color, 1.0f);
} }
@stage(fragment) @stage(fragment)
@ -462,12 +462,12 @@ fn textureLoadExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, coord
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureLoad(plane0, coord, 0i).rgb; color = textureLoad(plane0, coord, 0i).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); color = gammaCorrection(color, params.gammaEncodeParams);
return vec4<f32>(color, 1.0); return vec4<f32>(color, 1.0f);
} }
@stage(fragment) @stage(fragment)
@ -536,14 +536,14 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); 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> { fn textureLoadExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, coord : vec2<i32>, params : ExternalTextureParams) -> vec4<f32> {
@ -551,12 +551,12 @@ fn textureLoadExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, coord
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureLoad(plane0, coord, 0i).rgb; color = textureLoad(plane0, coord, 0i).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); color = gammaCorrection(color, params.gammaEncodeParams);
return vec4<f32>(color, 1.0); return vec4<f32>(color, 1.0f);
} }
@stage(fragment) @stage(fragment)
@ -619,14 +619,14 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); 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> { fn textureLoadExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, coord : vec2<i32>, params : ExternalTextureParams) -> vec4<f32> {
@ -634,12 +634,12 @@ fn textureLoadExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, coord
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureLoad(plane0, coord, 0i).rgb; color = textureLoad(plane0, coord, 0i).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); color = gammaCorrection(color, params.gammaEncodeParams);
return vec4<f32>(color, 1.0); return vec4<f32>(color, 1.0f);
} }
@stage(fragment) @stage(fragment)
@ -730,14 +730,14 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); color = gammaCorrection(color, params.gammaEncodeParams);
return vec4<f32>(color, 1.0); return vec4<f32>(color, 1.0f);
} }
@stage(fragment) @stage(fragment)
@ -808,14 +808,14 @@ fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); 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) { 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 gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); 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) { 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 gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); 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) { 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 gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); 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) { 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 gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); 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) { 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 gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); 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) { 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 gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); 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) { 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 gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); 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) { 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 gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> { fn textureSampleExternal(plane0 : texture_2d<f32>, plane1 : texture_2d<f32>, smp : sampler, coord : vec2<f32>, params : ExternalTextureParams) -> vec4<f32> {
var color : vec3<f32>; var color : vec3<f32>;
if ((params.numPlanes == 1u)) { if ((params.numPlanes == 1u)) {
color = textureSampleLevel(plane0, smp, coord, 0.0).rgb; color = textureSampleLevel(plane0, smp, coord, 0.0f).rgb;
} else { } 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 = gammaCorrection(color, params.gammaDecodeParams);
color = (params.gamutConversionMatrix * color); color = (params.gamutConversionMatrix * color);
color = gammaCorrection(color, params.gammaEncodeParams); 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) { fn f(t : texture_2d<f32>, ext_tex_plane_1_1 : texture_2d<f32>, ext_tex_params_1 : ExternalTextureParams, s : sampler) {

View File

@ -1172,22 +1172,22 @@ fn main(@builtin(vertex_index) tint_pulling_vertex_index : u32) -> @builtin(posi
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; 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; 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; 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; 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; 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); 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; 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); 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; 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; 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; 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; 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); 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.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.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; 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; 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); uint32 = vec3<u32>(tint_pulling_vertex_buffer_0.tint_vertex_data[(buffer_array_base_0 + 16u)], 0u, 0u);

View File

@ -258,7 +258,7 @@ bool GeneratorImpl::EmitLiteral(std::ostream& out, const ast::LiteralExpression*
return true; return true;
}, },
[&](const ast::FloatLiteralExpression* l) { // [&](const ast::FloatLiteralExpression* l) { //
out << FloatToBitPreservingString(static_cast<float>(l->value)); out << FloatToBitPreservingString(static_cast<float>(l->value)) << l->suffix;
return true; return true;
}, },
[&](const ast::IntLiteralExpression* l) { // [&](const ast::IntLiteralExpression* l) { //

View File

@ -58,7 +58,7 @@ TEST_F(WgslGeneratorImplTest, EmitConstructor_Float) {
GeneratorImpl& gen = Build(); GeneratorImpl& gen = Build();
ASSERT_TRUE(gen.Generate()) << gen.error(); 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) { TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Float) {
@ -67,7 +67,7 @@ TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Float) {
GeneratorImpl& gen = Build(); GeneratorImpl& gen = Build();
ASSERT_TRUE(gen.Generate()) << gen.error(); 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) { TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Bool) {
@ -103,7 +103,7 @@ TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Vec) {
GeneratorImpl& gen = Build(); GeneratorImpl& gen = Build();
ASSERT_TRUE(gen.Generate()) << gen.error(); 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) { TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Mat) {
@ -112,8 +112,8 @@ TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Mat) {
GeneratorImpl& gen = Build(); GeneratorImpl& gen = Build();
ASSERT_TRUE(gen.Generate()) << gen.error(); ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_THAT(gen.result(), HasSubstr("mat2x3<f32>(vec3<f32>(1.0, 2.0, 3.0), " EXPECT_THAT(gen.result(), HasSubstr("mat2x3<f32>(vec3<f32>(1.0f, 2.0f, 3.0f), "
"vec3<f32>(3.0, 4.0, 5.0))")); "vec3<f32>(3.0f, 4.0f, 5.0f))"));
} }
TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Array) { TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Array) {
@ -123,8 +123,9 @@ TEST_F(WgslGeneratorImplTest, EmitConstructor_Type_Array) {
GeneratorImpl& gen = Build(); GeneratorImpl& gen = Build();
ASSERT_TRUE(gen.Generate()) << gen.error(); ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_THAT(gen.result(), HasSubstr("array<vec3<f32>, 3u>(vec3<f32>(1.0, 2.0, 3.0), " EXPECT_THAT(gen.result(),
"vec3<f32>(4.0, 5.0, 6.0), vec3<f32>(7.0, 8.0, 9.0))")); 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 } // namespace

View File

@ -139,7 +139,7 @@ TEST_F(WgslGeneratorImplTest, Emit_Function_EntryPoint_ReturnValue) {
ASSERT_TRUE(gen.EmitFunction(func)); ASSERT_TRUE(gen.EmitFunction(func));
EXPECT_EQ(gen.result(), R"( @stage(fragment) EXPECT_EQ(gen.result(), R"( @stage(fragment)
fn frag_main() -> @location(1) f32 { fn frag_main() -> @location(1) f32 {
return 1.0; return 1.0f;
} }
)"); )");
} }

View File

@ -64,36 +64,37 @@ TEST_P(WgslGenerator_FloatLiteralTest, Emit) {
INSTANTIATE_TEST_SUITE_P(Zero, INSTANTIATE_TEST_SUITE_P(Zero,
WgslGenerator_FloatLiteralTest, WgslGenerator_FloatLiteralTest,
::testing::ValuesIn(std::vector<FloatData>{{0_f, "0.0"}, ::testing::ValuesIn(std::vector<FloatData>{
{MakeFloat(0, 0, 0), "0.0"}, {0_f, "0.0f"},
{MakeFloat(1, 0, 0), "-0.0"}})); {MakeFloat(0, 0, 0), "0.0f"},
{MakeFloat(1, 0, 0), "-0.0f"}}));
INSTANTIATE_TEST_SUITE_P(Normal, INSTANTIATE_TEST_SUITE_P(Normal,
WgslGenerator_FloatLiteralTest, WgslGenerator_FloatLiteralTest,
::testing::ValuesIn(std::vector<FloatData>{{1_f, "1.0"}, ::testing::ValuesIn(std::vector<FloatData>{{1_f, "1.0f"},
{-1_f, "-1.0"}, {-1_f, "-1.0f"},
{101.375_f, "101.375"}})); {101.375_f, "101.375f"}}));
INSTANTIATE_TEST_SUITE_P(Subnormal, INSTANTIATE_TEST_SUITE_P(Subnormal,
WgslGenerator_FloatLiteralTest, WgslGenerator_FloatLiteralTest,
::testing::ValuesIn(std::vector<FloatData>{ ::testing::ValuesIn(std::vector<FloatData>{
{MakeFloat(0, 0, 1), "0x1p-149"}, // Smallest {MakeFloat(0, 0, 1), "0x1p-149f"}, // Smallest
{MakeFloat(1, 0, 1), "-0x1p-149"}, {MakeFloat(1, 0, 1), "-0x1p-149f"},
{MakeFloat(0, 0, 2), "0x1p-148"}, {MakeFloat(0, 0, 2), "0x1p-148f"},
{MakeFloat(1, 0, 2), "-0x1p-148"}, {MakeFloat(1, 0, 2), "-0x1p-148f"},
{MakeFloat(0, 0, 0x7fffff), "0x1.fffffcp-127"}, // Largest {MakeFloat(0, 0, 0x7fffff), "0x1.fffffcp-127f"}, // Largest
{MakeFloat(1, 0, 0x7fffff), "-0x1.fffffcp-127"}, // Largest {MakeFloat(1, 0, 0x7fffff), "-0x1.fffffcp-127f"}, // Largest
{MakeFloat(0, 0, 0xcafebe), "0x1.2bfaf8p-127"}, // Scattered bits {MakeFloat(0, 0, 0xcafebe), "0x1.2bfaf8p-127f"}, // Scattered bits
{MakeFloat(1, 0, 0xcafebe), "-0x1.2bfaf8p-127"}, // Scattered bits {MakeFloat(1, 0, 0xcafebe), "-0x1.2bfaf8p-127f"}, // Scattered bits
{MakeFloat(0, 0, 0xaaaaa), "0x1.55554p-130"}, // Scattered bits {MakeFloat(0, 0, 0xaaaaa), "0x1.55554p-130f"}, // Scattered bits
{MakeFloat(1, 0, 0xaaaaa), "-0x1.55554p-130"}, // Scattered bits {MakeFloat(1, 0, 0xaaaaa), "-0x1.55554p-130f"}, // Scattered bits
})); }));
INSTANTIATE_TEST_SUITE_P(Infinity, INSTANTIATE_TEST_SUITE_P(Infinity,
WgslGenerator_FloatLiteralTest, WgslGenerator_FloatLiteralTest,
::testing::ValuesIn(std::vector<FloatData>{ ::testing::ValuesIn(std::vector<FloatData>{
{MakeFloat(0, 255, 0), "0x1p+128"}, {MakeFloat(0, 255, 0), "0x1p+128f"},
{MakeFloat(1, 255, 0), "-0x1p+128"}})); {MakeFloat(1, 255, 0), "-0x1p+128f"}}));
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_TEST_SUITE_P(
// TODO(dneto): It's unclear how Infinity and NaN should be handled. // TODO(dneto): It's unclear how Infinity and NaN should be handled.
@ -108,20 +109,20 @@ INSTANTIATE_TEST_SUITE_P(
WgslGenerator_FloatLiteralTest, WgslGenerator_FloatLiteralTest,
::testing::ValuesIn(std::vector<FloatData>{ ::testing::ValuesIn(std::vector<FloatData>{
// LSB only. Smallest mantissa. // LSB only. Smallest mantissa.
{MakeFloat(0, 255, 1), "0x1.000002p+128"}, // Smallest mantissa {MakeFloat(0, 255, 1), "0x1.000002p+128f"}, // Smallest mantissa
{MakeFloat(1, 255, 1), "-0x1.000002p+128"}, {MakeFloat(1, 255, 1), "-0x1.000002p+128f"},
// MSB only. // MSB only.
{MakeFloat(0, 255, 0x400000), "0x1.8p+128"}, {MakeFloat(0, 255, 0x400000), "0x1.8p+128f"},
{MakeFloat(1, 255, 0x400000), "-0x1.8p+128"}, {MakeFloat(1, 255, 0x400000), "-0x1.8p+128f"},
// All 1s in the mantissa. // All 1s in the mantissa.
{MakeFloat(0, 255, 0x7fffff), "0x1.fffffep+128"}, {MakeFloat(0, 255, 0x7fffff), "0x1.fffffep+128f"},
{MakeFloat(1, 255, 0x7fffff), "-0x1.fffffep+128"}, {MakeFloat(1, 255, 0x7fffff), "-0x1.fffffep+128f"},
// Scattered bits, with 0 in top mantissa bit. // Scattered bits, with 0 in top mantissa bit.
{MakeFloat(0, 255, 0x20101f), "0x1.40203ep+128"}, {MakeFloat(0, 255, 0x20101f), "0x1.40203ep+128f"},
{MakeFloat(1, 255, 0x20101f), "-0x1.40203ep+128"}, {MakeFloat(1, 255, 0x20101f), "-0x1.40203ep+128f"},
// Scattered bits, with 1 in top mantissa bit. // Scattered bits, with 1 in top mantissa bit.
{MakeFloat(0, 255, 0x40101f), "0x1.80203ep+128"}, {MakeFloat(0, 255, 0x40101f), "0x1.80203ep+128f"},
{MakeFloat(1, 255, 0x40101f), "-0x1.80203ep+128"}})); {MakeFloat(1, 255, 0x40101f), "-0x1.80203ep+128f"}}));
} // namespace } // namespace
} // namespace tint::writer::wgsl } // namespace tint::writer::wgsl

View File

@ -107,7 +107,7 @@ TEST_F(WgslGeneratorImplTest, EmitVariable_Constructor) {
std::stringstream out; std::stringstream out;
ASSERT_TRUE(gen.EmitVariable(out, v)) << gen.error(); 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) { TEST_F(WgslGeneratorImplTest, EmitVariable_Const) {
@ -118,7 +118,7 @@ TEST_F(WgslGeneratorImplTest, EmitVariable_Const) {
std::stringstream out; std::stringstream out;
ASSERT_TRUE(gen.EmitVariable(out, v)) << gen.error(); 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 } // namespace

View File

@ -1,5 +1,5 @@
fn main_1() { 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; return;
} }

View File

@ -1,7 +1,7 @@
fn main_1() { fn main_1() {
let x_11 : f32 = 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.0, 2.0, 3.0).x, vec3<f32>(1.0, 2.0, 3.0).z); 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.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_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; return;
} }

View File

@ -26,7 +26,7 @@ fn f_1() {
let x_28 : Arr = s.a[3i].el[2i]; let x_28 : Arr = s.a[3i].el[2i];
let x_32 : f32 = s.a[3i].el[2i][1i].el; let x_32 : f32 = s.a[3i].el[2i][1i].el;
s.a = array<strided_arr_1, 4u>(); 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; return;
} }

View File

@ -32,7 +32,7 @@ fn main_1() {
var q : vec4<f32>; var q : vec4<f32>;
var p : vec3<f32>; var p : vec3<f32>;
let x_13 : vec3<f32> = position; 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; let x_21 : vec4<f32> = q;
p = vec3<f32>(x_21.x, x_21.y, x_21.z); p = vec3<f32>(x_21.x, x_21.y, x_21.z);
let x_27 : f32 = p.x; let x_27 : f32 = p.x;
@ -42,14 +42,14 @@ fn main_1() {
p.x = (x_27 + sin(((x_41 * x_45) + x_49))); p.x = (x_27 + sin(((x_41 * x_45) + x_49)));
let x_55 : f32 = p.y; let x_55 : f32 = p.y;
let x_57 : f32 = x_14.time; 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_69 : mat4x4<f32> = x_14.worldViewProjection;
let x_70 : vec3<f32> = p; 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; let x_83 : vec2<f32> = uv;
vUV = x_83; vUV = x_83;
let x_87 : f32 = gl_Position.y; let x_87 : f32 = gl_Position.y;
gl_Position.y = (x_87 * -1.0); gl_Position.y = (x_87 * -1.0f);
return; return;
} }

View File

@ -95,20 +95,20 @@ fn main_1() {
x_9_ok = true; x_9_ok = true;
x_87_phi = false; x_87_phi = false;
if (true) { 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; x_87_phi = x_86;
} }
let x_87 : bool = x_87_phi; let x_87 : bool = x_87_phi;
x_9_ok = x_87; x_9_ok = x_87;
let x_89 : vec4<f32> = vec4<f32>(x_77, x_77, x_77, x_77); let x_89 : vec4<f32> = vec4<f32>(x_77, x_77, x_77, x_77);
x_10_val = x_89; 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; 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; 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; 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_10_val = x_95;
x_100_phi = false; x_100_phi = false;
if (x_87) { if (x_87) {
@ -117,13 +117,13 @@ fn main_1() {
} }
let x_100 : bool = x_100_phi; let x_100 : bool = x_100_phi;
x_9_ok = x_100; 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; 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; 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; 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_10_val = x_106;
x_111_phi = false; x_111_phi = false;
if (x_100) { if (x_100) {

View File

@ -1,3 +1,3 @@
fn foo() { fn foo() {
let b = 0x1.16c2p-133; let b = 0x1.16c2p-133f;
} }

View File

@ -19,7 +19,7 @@ fn swap_i1_i1_(i : ptr<function, i32>, j : ptr<function, i32>) {
let x_932 : i32 = temp; let x_932 : i32 = temp;
temp = 0i; temp = 0i;
temp = x_932; 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); let x_933 : i32 = *(i);
*(i) = 0i; *(i) = 0i;
*(i) = x_933; *(i) = x_933;
@ -43,7 +43,7 @@ fn swap_i1_i1_(i : ptr<function, i32>, j : ptr<function, i32>) {
let x_938 : i32 = *(j); let x_938 : i32 = *(j);
*(j) = 0i; *(j) = 0i;
*(j) = x_938; *(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); let x_939 : i32 = *(i);
*(i) = 0i; *(i) = 0i;
*(i) = x_939; *(i) = x_939;
@ -127,7 +127,7 @@ fn performPartition_i1_i1_(l : ptr<function, i32>, h : ptr<function, i32>) -> i3
let x_955 : i32 = param_3; let x_955 : i32 = param_3;
param_3 = 0i; param_3 = 0i;
param_3 = x_955; 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; let x_956 : i32 = param_1;
param_1 = 0i; param_1 = 0i;
param_1 = x_956; param_1 = x_956;
@ -161,7 +161,7 @@ fn performPartition_i1_i1_(l : ptr<function, i32>, h : ptr<function, i32>) -> i3
let x_963 : i32 = pivot; let x_963 : i32 = pivot;
pivot = 0i; pivot = 0i;
pivot = x_963; 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; let x_964 : QuicksortObject = obj;
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_964; obj = x_964;
@ -200,7 +200,7 @@ fn performPartition_i1_i1_(l : ptr<function, i32>, h : ptr<function, i32>) -> i3
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_972; obj = x_972;
let x_63 : i32 = pivot; 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; let x_973 : i32 = i_1;
i_1 = 0i; i_1 = 0i;
i_1 = x_973; i_1 = x_973;
@ -231,7 +231,7 @@ fn performPartition_i1_i1_(l : ptr<function, i32>, h : ptr<function, i32>) -> i3
let x_980 : i32 = *(l); let x_980 : i32 = *(l);
*(l) = 0i; *(l) = 0i;
*(l) = x_980; *(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_70 : i32 = i_1;
let x_545 : vec2<f32> = vec2<f32>(x_537.y, x_538.x); let x_545 : vec2<f32> = vec2<f32>(x_537.y, x_538.x);
let x_981 : i32 = param; let x_981 : i32 = param;
@ -329,7 +329,7 @@ fn performPartition_i1_i1_(l : ptr<function, i32>, h : ptr<function, i32>) -> i3
let x_1003 : i32 = *(l); let x_1003 : i32 = *(l);
*(l) = 0i; *(l) = 0i;
*(l) = x_1003; *(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; let x_1004 : i32 = param_1;
param_1 = 0i; param_1 = 0i;
param_1 = x_1004; param_1 = x_1004;
@ -360,7 +360,7 @@ fn quicksort_() {
let x_1008 : array<i32, 10u> = stack; let x_1008 : array<i32, 10u> = stack;
stack = array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i); stack = array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i);
stack = x_1008; 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; let x_1009 : i32 = param_5;
param_5 = 0i; param_5 = 0i;
param_5 = x_1009; param_5 = x_1009;
@ -369,7 +369,7 @@ fn quicksort_() {
p = 0i; p = 0i;
p = x_1010; p = x_1010;
let x_93 : i32 = top; 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; let x_1011 : i32 = p;
p = 0i; p = 0i;
p = x_1011; p = x_1011;
@ -410,7 +410,7 @@ fn quicksort_() {
let x_1020 : i32 = param_4; let x_1020 : i32 = param_4;
param_4 = 0i; param_4 = 0i;
param_4 = x_1020; 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]; let x_1021 : i32 = stack[x_96_save];
stack[x_96_save] = 0i; stack[x_96_save] = 0i;
stack[x_96_save] = x_1021; stack[x_96_save] = x_1021;
@ -507,7 +507,7 @@ fn quicksort_() {
let x_1043 : i32 = stack[x_100_save]; let x_1043 : i32 = stack[x_100_save];
stack[x_100_save] = 0i; stack[x_100_save] = 0i;
stack[x_100_save] = x_1043; 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); top = (x_112 - 1i);
let x_1044 : i32 = param_5; let x_1044 : i32 = param_5;
param_5 = 0i; param_5 = 0i;
@ -540,7 +540,7 @@ fn quicksort_() {
stack[x_110_save] = x_1050; stack[x_110_save] = x_1050;
let x_577 : vec2<f32> = vec2<f32>(x_569.y, x_569.z); let x_577 : vec2<f32> = vec2<f32>(x_569.y, x_569.z);
let x_120 : i32 = h_1; 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; param_5 = x_120;
let x_1051 : i32 = stack[x_100_save]; let x_1051 : i32 = stack[x_100_save];
stack[x_100_save] = 0i; stack[x_100_save] = 0i;
@ -648,7 +648,7 @@ fn quicksort_() {
let x_1076 : i32 = stack[x_96_save]; let x_1076 : i32 = stack[x_96_save];
stack[x_96_save] = 0i; stack[x_96_save] = 0i;
stack[x_96_save] = x_1076; 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; let x_1077 : QuicksortObject = obj;
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_1077; obj = x_1077;
@ -774,7 +774,7 @@ fn main_1() {
var i_2 : i32; var i_2 : i32;
var uv : vec2<f32>; var uv : vec2<f32>;
let x_717 : vec2<f32> = uv; let x_717 : vec2<f32> = uv;
uv = vec2<f32>(0.0, 0.0); uv = vec2<f32>(0.0f, 0.0f);
uv = x_717; uv = x_717;
i_2 = 0i; i_2 = 0i;
let x_721 : QuicksortObject = obj; let x_721 : QuicksortObject = obj;
@ -784,13 +784,13 @@ fn main_1() {
let x_722 : QuicksortObject = obj; let x_722 : QuicksortObject = obj;
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_722; 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_158 : i32 = i_2;
let x_723 : vec2<f32> = uv; let x_723 : vec2<f32> = uv;
uv = vec2<f32>(0.0, 0.0); uv = vec2<f32>(0.0f, 0.0f);
uv = x_723; uv = x_723;
let x_725 : vec3<f32> = color; 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; color = x_725;
let x_432 : vec2<f32> = vec2<f32>(x_431.y, x_431.y); let x_432 : vec2<f32> = vec2<f32>(x_431.y, x_431.y);
let x_726 : QuicksortObject = obj; let x_726 : QuicksortObject = obj;
@ -810,11 +810,11 @@ fn main_1() {
obj = x_758; obj = x_758;
let x_184 : vec4<f32> = gl_FragCoord; let x_184 : vec4<f32> = gl_FragCoord;
let x_759 : vec2<f32> = uv; let x_759 : vec2<f32> = uv;
uv = vec2<f32>(0.0, 0.0); uv = vec2<f32>(0.0f, 0.0f);
uv = x_759; uv = x_759;
let x_447 : vec2<f32> = vec2<f32>(vec2<f32>().y, vec2<f32>().y); let x_447 : vec2<f32> = vec2<f32>(vec2<f32>().y, vec2<f32>().y);
let x_760 : vec2<f32> = uv; let x_760 : vec2<f32> = uv;
uv = vec2<f32>(0.0, 0.0); uv = vec2<f32>(0.0f, 0.0f);
uv = x_760; uv = x_760;
let x_185 : vec2<f32> = vec2<f32>(x_184.x, x_184.y); 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); let x_448 : vec3<f32> = vec3<f32>(x_185.y, x_446.y, x_446.y);
@ -822,15 +822,15 @@ fn main_1() {
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_761; obj = x_761;
let x_762 : vec2<f32> = uv; let x_762 : vec2<f32> = uv;
uv = vec2<f32>(0.0, 0.0); uv = vec2<f32>(0.0f, 0.0f);
uv = x_762; uv = x_762;
let x_191 : vec2<f32> = x_188.resolution; let x_191 : vec2<f32> = x_188.resolution;
let x_763 : QuicksortObject = obj; let x_763 : QuicksortObject = obj;
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_763; 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; 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; color = x_764;
let x_192 : vec2<f32> = (x_185 / x_191); let x_192 : vec2<f32> = (x_185 / x_191);
let x_765 : QuicksortObject = obj; let x_765 : QuicksortObject = obj;
@ -838,15 +838,15 @@ fn main_1() {
obj = x_765; obj = x_765;
let x_450 : vec2<f32> = vec2<f32>(x_447.x, x_185.y); let x_450 : vec2<f32> = vec2<f32>(x_447.x, x_185.y);
let x_766 : vec3<f32> = color; 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; 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_767;
color = x_766; color = x_766;
uv = x_192; 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; 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; color = x_768;
let x_451 : vec3<f32> = vec3<f32>(x_185.x, x_185.y, x_446.y); let x_451 : vec3<f32> = vec3<f32>(x_185.x, x_185.y, x_446.y);
let x_769 : QuicksortObject = obj; let x_769 : QuicksortObject = obj;
@ -864,9 +864,9 @@ fn main_1() {
obj.numbers[0u] = x_772; obj.numbers[0u] = x_772;
let x_206 : f32 = color.x; let x_206 : f32 = color.x;
let x_773 : f32 = color.x; let x_773 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_773; 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; let x_774 : i32 = i_2;
i_2 = 0i; i_2 = 0i;
i_2 = x_774; i_2 = x_774;
@ -876,21 +876,21 @@ fn main_1() {
let x_453 : vec3<f32> = vec3<f32>(x_451.x, x_450.x, x_450.y); let x_453 : vec3<f32> = vec3<f32>(x_451.x, x_450.x, x_450.y);
color.x = (x_206 + f32(x_201)); color.x = (x_206 + f32(x_201));
let x_776 : vec2<f32> = uv; let x_776 : vec2<f32> = uv;
uv = vec2<f32>(0.0, 0.0); uv = vec2<f32>(0.0f, 0.0f);
uv = x_776; uv = x_776;
let x_777 : vec2<f32> = uv; let x_777 : vec2<f32> = uv;
uv = vec2<f32>(0.0, 0.0); uv = vec2<f32>(0.0f, 0.0f);
uv = x_777; uv = x_777;
let x_454 : vec2<f32> = vec2<f32>(x_184.y, x_184.y); let x_454 : vec2<f32> = vec2<f32>(x_184.y, x_184.y);
let x_210 : f32 = uv.x; let x_210 : f32 = uv.x;
let x_455 : vec2<f32> = vec2<f32>(x_192.y, x_192.x); let x_455 : vec2<f32> = vec2<f32>(x_192.y, x_192.x);
let x_778 : f32 = uv.x; let x_778 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_778; uv.x = x_778;
let x_779 : QuicksortObject = obj; let x_779 : QuicksortObject = obj;
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_779; obj = x_779;
if ((x_210 > 0.25)) { if ((x_210 > 0.25f)) {
let x_780 : i32 = i_2; let x_780 : i32 = i_2;
i_2 = 0i; i_2 = 0i;
i_2 = x_780; i_2 = x_780;
@ -899,7 +899,7 @@ fn main_1() {
obj.numbers[0u] = x_781; obj.numbers[0u] = x_781;
let x_456 : vec3<f32> = vec3<f32>(vec2<f32>().y, x_448.y, x_448.y); let x_456 : vec3<f32> = vec3<f32>(vec2<f32>().y, x_448.y, x_448.y);
let x_782 : f32 = uv.x; let x_782 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_782; uv.x = x_782;
let x_216 : i32 = obj.numbers[1i]; let x_216 : i32 = obj.numbers[1i];
let x_783 : QuicksortObject = obj; let x_783 : QuicksortObject = obj;
@ -907,28 +907,28 @@ fn main_1() {
obj = x_783; obj = x_783;
let x_457 : vec2<f32> = vec2<f32>(x_454.x, x_454.x); let x_457 : vec2<f32> = vec2<f32>(x_454.x, x_454.x);
let x_784 : vec2<f32> = uv; let x_784 : vec2<f32> = uv;
uv = vec2<f32>(0.0, 0.0); uv = vec2<f32>(0.0f, 0.0f);
uv = x_784; uv = x_784;
let x_785 : QuicksortObject = obj; let x_785 : QuicksortObject = obj;
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_785; 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; let x_786 : i32 = i_2;
i_2 = 0i; i_2 = 0i;
i_2 = x_786; i_2 = x_786;
let x_219 : f32 = color[0i]; let x_219 : f32 = color[0i];
let x_787 : f32 = color[0i]; let x_787 : f32 = color[0i];
color[0i] = 0.0; color[0i] = 0.0f;
color[0i] = x_787; color[0i] = x_787;
let x_788 : vec3<f32> = color; 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; color = x_788;
let x_789 : vec3<f32> = color; 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; color = x_789;
let x_459 : vec3<f32> = vec3<f32>(x_454.y, x_454.y, x_447.y); let x_459 : vec3<f32> = vec3<f32>(x_454.y, x_454.y, x_447.y);
let x_790 : f32 = color[0i]; let x_790 : f32 = color[0i];
color[0i] = 0.0; color[0i] = 0.0f;
color[0i] = x_790; color[0i] = x_790;
color.x = (f32(x_216) + x_219); color.x = (f32(x_216) + x_219);
let x_791 : i32 = obj.numbers[0u]; let x_791 : i32 = obj.numbers[0u];
@ -936,54 +936,54 @@ fn main_1() {
obj.numbers[0u] = x_791; obj.numbers[0u] = x_791;
} }
let x_792 : f32 = uv.x; let x_792 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_792; uv.x = x_792;
let x_793 : f32 = uv.x; let x_793 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_793; uv.x = x_793;
let x_223 : f32 = uv.x; let x_223 : f32 = uv.x;
let x_794 : f32 = uv.x; let x_794 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_794; uv.x = x_794;
let x_460 : vec3<f32> = vec3<f32>(x_453.z, x_453.y, x_453.y); let x_460 : vec3<f32> = vec3<f32>(x_453.z, x_453.y, x_453.y);
let x_795 : vec2<f32> = uv; let x_795 : vec2<f32> = uv;
uv = vec2<f32>(0.0, 0.0); uv = vec2<f32>(0.0f, 0.0f);
uv = x_795; uv = x_795;
let x_796 : f32 = uv.x; let x_796 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_796; uv.x = x_796;
let x_461 : vec2<f32> = vec2<f32>(vec2<f32>().y, vec2<f32>().y); let x_461 : vec2<f32> = vec2<f32>(vec2<f32>().y, vec2<f32>().y);
let x_797 : f32 = uv.x; let x_797 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_797; uv.x = x_797;
if ((x_223 > 0.5)) { if ((x_223 > 0.5f)) {
let x_798 : f32 = uv.x; let x_798 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_798; uv.x = x_798;
let x_462 : vec2<f32> = vec2<f32>(x_446.x, x_446.x); let x_462 : vec2<f32> = vec2<f32>(x_446.x, x_446.x);
let x_799 : f32 = color.x; let x_799 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_799; color.x = x_799;
let x_800 : f32 = color.x; let x_800 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_800; color.x = x_800;
let x_463 : vec3<f32> = vec3<f32>(x_453.x, x_453.z, x_461.y); let x_463 : vec3<f32> = vec3<f32>(x_453.x, x_453.z, x_461.y);
let x_801 : f32 = color.x; let x_801 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_801; color.x = x_801;
let x_230 : i32 = obj.numbers[2u]; let x_230 : i32 = obj.numbers[2u];
let x_802 : f32 = uv.x; let x_802 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_802; uv.x = x_802;
let x_803 : f32 = color.x; let x_803 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_803; color.x = x_803;
let x_804 : i32 = obj.numbers[2u]; let x_804 : i32 = obj.numbers[2u];
obj.numbers[2u] = 0i; obj.numbers[2u] = 0i;
obj.numbers[2u] = x_804; obj.numbers[2u] = x_804;
let x_464 : vec2<f32> = vec2<f32>(x_450.y, x_191.x); let x_464 : vec2<f32> = vec2<f32>(x_450.y, x_191.x);
let x_805 : f32 = color.y; let x_805 : f32 = color.y;
color.y = 0.0; color.y = 0.0f;
color.y = x_805; color.y = x_805;
let x_234 : f32 = color.y; let x_234 : f32 = color.y;
let x_806 : i32 = obj.numbers[2u]; let x_806 : i32 = obj.numbers[2u];
@ -991,7 +991,7 @@ fn main_1() {
obj.numbers[2u] = x_806; obj.numbers[2u] = x_806;
let x_465 : vec2<f32> = vec2<f32>(x_463.x, x_185.x); let x_465 : vec2<f32> = vec2<f32>(x_463.x, x_185.x);
let x_807 : f32 = color.x; let x_807 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_807; color.x = x_807;
let x_808 : i32 = i_2; let x_808 : i32 = i_2;
i_2 = 0i; i_2 = 0i;
@ -1002,7 +1002,7 @@ fn main_1() {
i_2 = x_809; i_2 = x_809;
color.y = (f32(x_230) + x_234); color.y = (f32(x_230) + x_234);
let x_810 : f32 = uv.x; let x_810 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_810; uv.x = x_810;
} }
let x_811 : i32 = i_2; let x_811 : i32 = i_2;
@ -1010,64 +1010,64 @@ fn main_1() {
i_2 = x_811; i_2 = x_811;
let x_467 : vec2<f32> = vec2<f32>(x_191.x, x_191.x); let x_467 : vec2<f32> = vec2<f32>(x_191.x, x_191.x);
let x_812 : f32 = uv.x; let x_812 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_812; uv.x = x_812;
let x_238 : f32 = uv[0i]; let x_238 : f32 = uv[0i];
let x_813 : vec3<f32> = color; 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; color = x_813;
let x_814 : f32 = color.x; let x_814 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_814; color.x = x_814;
if ((x_238 > 0.75)) { if ((x_238 > 0.75f)) {
let x_815 : f32 = color.x; let x_815 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_815; color.x = x_815;
let x_245 : i32 = obj.numbers[3i]; let x_245 : i32 = obj.numbers[3i];
let x_816 : f32 = color.x; let x_816 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_816; color.x = x_816;
let x_817 : QuicksortObject = obj; let x_817 : QuicksortObject = obj;
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_817; obj = x_817;
let x_468 : vec3<f32> = vec3<f32>(x_467.x, x_467.x, x_467.x); let x_468 : vec3<f32> = vec3<f32>(x_467.x, x_467.x, x_467.x);
let x_818 : f32 = uv[0i]; let x_818 : f32 = uv[0i];
uv[0i] = 0.0; uv[0i] = 0.0f;
uv[0i] = x_818; uv[0i] = x_818;
let x_819 : f32 = uv.x; let x_819 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_819; uv.x = x_819;
let x_249 : f32 = color.z; let x_249 : f32 = color.z;
let x_820 : vec3<f32> = color; 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; color = x_820;
let x_469 : vec3<f32> = vec3<f32>(x_467.x, x_191.y, x_467.y); let x_469 : vec3<f32> = vec3<f32>(x_467.x, x_191.y, x_467.y);
let x_821 : f32 = color.z; let x_821 : f32 = color.z;
color.z = 0.0; color.z = 0.0f;
color.z = x_821; color.z = x_821;
let x_822 : i32 = obj.numbers[0u]; let x_822 : i32 = obj.numbers[0u];
obj.numbers[0u] = 0i; obj.numbers[0u] = 0i;
obj.numbers[0u] = x_822; obj.numbers[0u] = x_822;
let x_470 : vec2<f32> = vec2<f32>(vec2<f32>().x, vec2<f32>().y); let x_470 : vec2<f32> = vec2<f32>(vec2<f32>().x, vec2<f32>().y);
let x_823 : f32 = color.z; let x_823 : f32 = color.z;
color.z = 0.0; color.z = 0.0f;
color.z = x_823; color.z = x_823;
color.z = (x_249 + f32(x_245)); color.z = (x_249 + f32(x_245));
let x_824 : vec2<f32> = uv; let x_824 : vec2<f32> = uv;
uv = vec2<f32>(0.0, 0.0); uv = vec2<f32>(0.0f, 0.0f);
uv = x_824; uv = x_824;
let x_471 : vec2<f32> = vec2<f32>(x_470.y, x_470.y); let x_471 : vec2<f32> = vec2<f32>(x_470.y, x_470.y);
} }
let x_825 : f32 = uv[0i]; let x_825 : f32 = uv[0i];
uv[0i] = 0.0; uv[0i] = 0.0f;
uv[0i] = x_825; uv[0i] = x_825;
let x_472 : vec3<f32> = vec3<f32>(x_454.x, x_454.y, x_454.y); 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_254 : i32 = obj.numbers[4i];
let x_826 : f32 = uv[0i]; let x_826 : f32 = uv[0i];
uv[0i] = 0.0; uv[0i] = 0.0f;
uv[0i] = x_826; uv[0i] = x_826;
let x_827 : vec3<f32> = color; 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; color = x_827;
let x_473 : vec3<f32> = vec3<f32>(x_446.y, x_453.x, x_453.x); let x_473 : vec3<f32> = vec3<f32>(x_446.y, x_453.x, x_453.x);
let x_828 : i32 = obj.numbers[4i]; let x_828 : i32 = obj.numbers[4i];
@ -1075,31 +1075,31 @@ fn main_1() {
obj.numbers[4i] = x_828; obj.numbers[4i] = x_828;
let x_474 : vec2<f32> = vec2<f32>(x_191.x, x_184.z); let x_474 : vec2<f32> = vec2<f32>(x_191.x, x_184.z);
let x_829 : f32 = uv.x; let x_829 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_829; uv.x = x_829;
let x_257 : f32 = color.y; let x_257 : f32 = color.y;
let x_830 : f32 = color.y; let x_830 : f32 = color.y;
color.y = 0.0; color.y = 0.0f;
color.y = x_830; color.y = x_830;
let x_475 : vec2<f32> = vec2<f32>(x_467.x, x_450.x); let x_475 : vec2<f32> = vec2<f32>(x_467.x, x_450.x);
let x_831 : f32 = uv.x; let x_831 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_831; uv.x = x_831;
let x_832 : f32 = color.x; let x_832 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_832; color.x = x_832;
let x_476 : vec2<f32> = vec2<f32>(x_451.z, x_460.y); let x_476 : vec2<f32> = vec2<f32>(x_451.z, x_460.y);
color.y = (x_257 + f32(x_254)); 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_477 : vec3<f32> = vec3<f32>(vec2<f32>().x, x_472.x, vec2<f32>().y);
let x_833 : f32 = uv.x; let x_833 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_833; uv.x = x_833;
let x_834 : f32 = color.x; let x_834 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_834; color.x = x_834;
let x_478 : vec2<f32> = vec2<f32>(x_472.x, x_472.y); let x_478 : vec2<f32> = vec2<f32>(x_472.x, x_472.y);
let x_835 : f32 = uv.y; let x_835 : f32 = uv.y;
uv.y = 0.0; uv.y = 0.0f;
uv.y = x_835; uv.y = x_835;
let x_261 : f32 = uv.y; let x_261 : f32 = uv.y;
let x_836 : i32 = i_2; let x_836 : i32 = i_2;
@ -1110,20 +1110,20 @@ fn main_1() {
obj.numbers[0u] = 0i; obj.numbers[0u] = 0i;
obj.numbers[0u] = x_837; obj.numbers[0u] = x_837;
let x_838 : f32 = color.y; let x_838 : f32 = color.y;
color.y = 0.0; color.y = 0.0f;
color.y = x_838; color.y = x_838;
let x_480 : vec3<f32> = vec3<f32>(x_446.x, x_446.x, vec2<f32>().y); let x_480 : vec3<f32> = vec3<f32>(x_446.x, x_446.x, vec2<f32>().y);
let x_839 : f32 = uv.x; let x_839 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_839; 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_481 : vec2<f32> = vec2<f32>(x_447.x, x_480.z);
let x_840 : vec3<f32> = color; 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; color = x_840;
let x_267 : i32 = obj.numbers[5u]; let x_267 : i32 = obj.numbers[5u];
let x_841 : f32 = color.x; let x_841 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_841; color.x = x_841;
let x_842 : i32 = i_2; let x_842 : i32 = i_2;
i_2 = 0i; i_2 = 0i;
@ -1133,34 +1133,34 @@ fn main_1() {
i_2 = x_843; i_2 = x_843;
let x_270 : f32 = color.x; let x_270 : f32 = color.x;
let x_844 : f32 = uv[0i]; let x_844 : f32 = uv[0i];
uv[0i] = 0.0; uv[0i] = 0.0f;
uv[0i] = x_844; uv[0i] = x_844;
let x_482 : vec3<f32> = vec3<f32>(x_455.x, x_475.y, x_455.y); let x_482 : vec3<f32> = vec3<f32>(x_455.x, x_475.y, x_455.y);
let x_845 : QuicksortObject = obj; let x_845 : QuicksortObject = obj;
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_845; obj = x_845;
let x_846 : f32 = uv.y; let x_846 : f32 = uv.y;
uv.y = 0.0; uv.y = 0.0f;
uv.y = x_846; uv.y = x_846;
let x_847 : i32 = i_2; let x_847 : i32 = i_2;
i_2 = 0i; i_2 = 0i;
i_2 = x_847; i_2 = x_847;
let x_483 : vec3<f32> = vec3<f32>(x_184.w, x_184.w, x_192.x); let x_483 : vec3<f32> = vec3<f32>(x_184.w, x_184.w, x_192.x);
let x_848 : f32 = uv.x; let x_848 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_848; uv.x = x_848;
color.x = (f32(x_267) + x_270); 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_484 : vec3<f32> = vec3<f32>(x_454.y, x_450.x, x_454.y);
let x_849 : f32 = uv.x; let x_849 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_849; uv.x = x_849;
} }
let x_850 : f32 = color.x; let x_850 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_850; color.x = x_850;
let x_485 : vec3<f32> = vec3<f32>(x_467.x, x_450.y, x_450.x); let x_485 : vec3<f32> = vec3<f32>(x_467.x, x_450.y, x_450.x);
let x_851 : f32 = uv.y; let x_851 : f32 = uv.y;
uv.y = 0.0; uv.y = 0.0f;
uv.y = x_851; uv.y = x_851;
let x_852 : i32 = obj.numbers[4i]; let x_852 : i32 = obj.numbers[4i];
obj.numbers[4i] = 0i; obj.numbers[4i] = 0i;
@ -1169,21 +1169,21 @@ fn main_1() {
let x_853 : i32 = obj.numbers[0u]; let x_853 : i32 = obj.numbers[0u];
obj.numbers[0u] = 0i; obj.numbers[0u] = 0i;
obj.numbers[0u] = x_853; obj.numbers[0u] = x_853;
if ((x_274 > 0.5)) { if ((x_274 > 0.5f)) {
let x_854 : f32 = uv.x; let x_854 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_854; uv.x = x_854;
let x_486 : vec2<f32> = vec2<f32>(x_480.y, x_455.y); let x_486 : vec2<f32> = vec2<f32>(x_480.y, x_455.y);
let x_855 : f32 = color.y; let x_855 : f32 = color.y;
color.y = 0.0; color.y = 0.0f;
color.y = x_855; color.y = x_855;
let x_487 : vec2<f32> = vec2<f32>(x_449.z, x_449.y); let x_487 : vec2<f32> = vec2<f32>(x_449.z, x_449.y);
let x_856 : f32 = uv.y; let x_856 : f32 = uv.y;
uv.y = 0.0; uv.y = 0.0f;
uv.y = x_856; uv.y = x_856;
let x_280 : i32 = obj.numbers[6u]; let x_280 : i32 = obj.numbers[6u];
let x_857 : f32 = uv.y; let x_857 : f32 = uv.y;
uv.y = 0.0; uv.y = 0.0f;
uv.y = x_857; uv.y = x_857;
let x_858 : i32 = i_2; let x_858 : i32 = i_2;
i_2 = 0i; i_2 = 0i;
@ -1194,10 +1194,10 @@ fn main_1() {
let x_488 : vec2<f32> = vec2<f32>(x_473.z, x_473.y); let x_488 : vec2<f32> = vec2<f32>(x_473.z, x_473.y);
let x_283 : f32 = color.y; let x_283 : f32 = color.y;
let x_860 : vec2<f32> = uv; let x_860 : vec2<f32> = uv;
uv = vec2<f32>(0.0, 0.0); uv = vec2<f32>(0.0f, 0.0f);
uv = x_860; uv = x_860;
let x_861 : f32 = color.x; let x_861 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_861; color.x = x_861;
let x_489 : vec2<f32> = vec2<f32>(x_475.y, x_475.x); let x_489 : vec2<f32> = vec2<f32>(x_475.y, x_475.x);
let x_862 : i32 = obj.numbers[6u]; let x_862 : i32 = obj.numbers[6u];
@ -1212,16 +1212,16 @@ fn main_1() {
obj = x_864; obj = x_864;
color.y = (f32(x_280) + x_283); color.y = (f32(x_280) + x_283);
let x_865 : f32 = color.x; let x_865 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_865; 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; let x_866 : f32 = color.y;
color.y = 0.0; color.y = 0.0f;
color.y = x_866; color.y = x_866;
} }
let x_492 : vec2<f32> = vec2<f32>(x_455.y, x_455.y); let x_492 : vec2<f32> = vec2<f32>(x_455.y, x_455.y);
let x_867 : f32 = color.x; let x_867 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_867; color.x = x_867;
let x_287 : f32 = uv.y; let x_287 : f32 = uv.y;
let x_868 : QuicksortObject = obj; let x_868 : QuicksortObject = obj;
@ -1229,70 +1229,70 @@ fn main_1() {
obj = x_868; obj = x_868;
let x_493 : vec2<f32> = vec2<f32>(x_475.x, x_475.y); let x_493 : vec2<f32> = vec2<f32>(x_475.x, x_475.y);
let x_869 : f32 = uv[0i]; let x_869 : f32 = uv[0i];
uv[0i] = 0.0; uv[0i] = 0.0f;
uv[0i] = x_869; uv[0i] = x_869;
let x_870 : f32 = color.y; let x_870 : f32 = color.y;
color.y = 0.0; color.y = 0.0f;
color.y = x_870; color.y = x_870;
let x_494 : vec3<f32> = vec3<f32>(x_191.x, x_191.y, x_191.y); let x_494 : vec3<f32> = vec3<f32>(x_191.x, x_191.y, x_191.y);
let x_871 : i32 = obj.numbers[4i]; let x_871 : i32 = obj.numbers[4i];
obj.numbers[4i] = 0i; obj.numbers[4i] = 0i;
obj.numbers[4i] = x_871; obj.numbers[4i] = x_871;
if ((x_287 > 0.75)) { if ((x_287 > 0.75f)) {
let x_872 : vec3<f32> = color; 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; color = x_872;
let x_873 : f32 = color.x; let x_873 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_873; color.x = x_873;
let x_495 : vec3<f32> = vec3<f32>(x_192.y, x_192.x, x_192.y); let x_495 : vec3<f32> = vec3<f32>(x_192.y, x_192.x, x_192.y);
let x_874 : vec3<f32> = color; 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; color = x_874;
let x_293 : i32 = obj.numbers[7i]; let x_293 : i32 = obj.numbers[7i];
let x_875 : f32 = uv.x; let x_875 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_875; uv.x = x_875;
let x_496 : vec3<f32> = vec3<f32>(x_475.x, x_467.y, x_467.x); let x_496 : vec3<f32> = vec3<f32>(x_475.x, x_467.y, x_467.x);
let x_876 : f32 = color.y; let x_876 : f32 = color.y;
color.y = 0.0; color.y = 0.0f;
color.y = x_876; color.y = x_876;
let x_497 : vec2<f32> = vec2<f32>(x_477.x, x_461.y); let x_497 : vec2<f32> = vec2<f32>(x_477.x, x_461.y);
let x_877 : i32 = obj.numbers[0u]; let x_877 : i32 = obj.numbers[0u];
obj.numbers[0u] = 0i; obj.numbers[0u] = 0i;
obj.numbers[0u] = x_877; obj.numbers[0u] = x_877;
let x_878 : f32 = color.y; let x_878 : f32 = color.y;
color.y = 0.0; color.y = 0.0f;
color.y = x_878; color.y = x_878;
let x_498 : vec3<f32> = vec3<f32>(x_478.x, x_478.y, x_478.x); let x_498 : vec3<f32> = vec3<f32>(x_478.x, x_478.y, x_478.x);
let x_879 : f32 = color.x; let x_879 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_879; color.x = x_879;
let x_296 : f32 = color.z; let x_296 : f32 = color.z;
let x_880 : f32 = uv.y; let x_880 : f32 = uv.y;
uv.y = 0.0; uv.y = 0.0f;
uv.y = x_880; uv.y = x_880;
let x_499 : vec2<f32> = vec2<f32>(x_184.x, x_184.y); let x_499 : vec2<f32> = vec2<f32>(x_184.x, x_184.y);
let x_881 : f32 = uv.x; let x_881 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_881; uv.x = x_881;
let x_882 : f32 = uv.y; let x_882 : f32 = uv.y;
uv.y = 0.0; uv.y = 0.0f;
uv.y = x_882; uv.y = x_882;
let x_883 : f32 = uv.y; let x_883 : f32 = uv.y;
uv.y = 0.0; uv.y = 0.0f;
uv.y = x_883; uv.y = x_883;
let x_500 : vec3<f32> = vec3<f32>(x_499.y, x_499.y, x_494.z); let x_500 : vec3<f32> = vec3<f32>(x_499.y, x_499.y, x_494.z);
let x_884 : f32 = color.z; let x_884 : f32 = color.z;
color.z = 0.0; color.z = 0.0f;
color.z = x_884; color.z = x_884;
color.z = (f32(x_293) + x_296); color.z = (f32(x_293) + x_296);
let x_885 : f32 = color.y; let x_885 : f32 = color.y;
color.y = 0.0; color.y = 0.0f;
color.y = x_885; color.y = x_885;
let x_501 : vec2<f32> = vec2<f32>(x_453.x, x_453.z); let x_501 : vec2<f32> = vec2<f32>(x_453.x, x_453.z);
let x_886 : f32 = color.x; let x_886 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_886; color.x = x_886;
} }
let x_887 : i32 = i_2; let x_887 : i32 = i_2;
@ -1300,7 +1300,7 @@ fn main_1() {
i_2 = x_887; i_2 = x_887;
let x_502 : vec2<f32> = vec2<f32>(x_451.y, x_192.y); let x_502 : vec2<f32> = vec2<f32>(x_451.y, x_192.y);
let x_888 : vec2<f32> = uv; let x_888 : vec2<f32> = uv;
uv = vec2<f32>(0.0, 0.0); uv = vec2<f32>(0.0f, 0.0f);
uv = x_888; uv = x_888;
let x_301 : i32 = obj.numbers[8i]; let x_301 : i32 = obj.numbers[8i];
let x_889 : i32 = i_2; let x_889 : i32 = i_2;
@ -1311,78 +1311,78 @@ fn main_1() {
obj.numbers[8i] = 0i; obj.numbers[8i] = 0i;
obj.numbers[8i] = x_890; obj.numbers[8i] = x_890;
let x_891 : f32 = color.y; let x_891 : f32 = color.y;
color.y = 0.0; color.y = 0.0f;
color.y = x_891; color.y = x_891;
let x_504 : vec2<f32> = vec2<f32>(x_453.y, vec2<f32>().x); let x_504 : vec2<f32> = vec2<f32>(x_453.y, vec2<f32>().x);
let x_892 : f32 = color.x; let x_892 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_892; color.x = x_892;
let x_505 : vec3<f32> = vec3<f32>(x_504.x, x_504.y, x_504.x); let x_505 : vec3<f32> = vec3<f32>(x_504.x, x_504.y, x_504.x);
let x_893 : f32 = color.z; let x_893 : f32 = color.z;
color.z = 0.0; color.z = 0.0f;
color.z = x_893; color.z = x_893;
let x_304 : f32 = color.z; let x_304 : f32 = color.z;
let x_894 : f32 = color.x; let x_894 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_894; color.x = x_894;
let x_506 : vec2<f32> = vec2<f32>(x_493.x, x_492.x); let x_506 : vec2<f32> = vec2<f32>(x_493.x, x_492.x);
let x_895 : i32 = obj.numbers[4i]; let x_895 : i32 = obj.numbers[4i];
obj.numbers[4i] = 0i; obj.numbers[4i] = 0i;
obj.numbers[4i] = x_895; obj.numbers[4i] = x_895;
let x_896 : f32 = uv.y; let x_896 : f32 = uv.y;
uv.y = 0.0; uv.y = 0.0f;
uv.y = x_896; uv.y = x_896;
let x_507 : vec2<f32> = vec2<f32>(x_461.x, x_447.x); let x_507 : vec2<f32> = vec2<f32>(x_461.x, x_447.x);
let x_897 : f32 = color.y; let x_897 : f32 = color.y;
color.y = 0.0; color.y = 0.0f;
color.y = x_897; color.y = x_897;
color.z = (x_304 + f32(x_301)); color.z = (x_304 + f32(x_301));
let x_898 : vec2<f32> = uv; let x_898 : vec2<f32> = uv;
uv = vec2<f32>(0.0, 0.0); uv = vec2<f32>(0.0f, 0.0f);
uv = x_898; uv = x_898;
let x_899 : f32 = uv.x; let x_899 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_899; uv.x = x_899;
let x_508 : vec3<f32> = vec3<f32>(x_461.y, x_461.x, x_506.y); let x_508 : vec3<f32> = vec3<f32>(x_461.y, x_461.x, x_506.y);
let x_900 : f32 = uv.x; let x_900 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_900; uv.x = x_900;
let x_308 : f32 = uv.x; let x_308 : f32 = uv.x;
let x_901 : f32 = color.y; let x_901 : f32 = color.y;
color.y = 0.0; color.y = 0.0f;
color.y = x_901; color.y = x_901;
let x_509 : vec3<f32> = vec3<f32>(x_503.y, x_503.x, x_448.z); let x_509 : vec3<f32> = vec3<f32>(x_503.y, x_503.x, x_448.z);
let x_902 : f32 = uv.y; let x_902 : f32 = uv.y;
uv.y = 0.0; uv.y = 0.0f;
uv.y = x_902; uv.y = x_902;
let x_310 : f32 = uv.y; let x_310 : f32 = uv.y;
let x_903 : f32 = uv.y; let x_903 : f32 = uv.y;
uv.y = 0.0; uv.y = 0.0f;
uv.y = x_903; uv.y = x_903;
let x_904 : f32 = color.z; let x_904 : f32 = color.z;
color.z = 0.0; color.z = 0.0f;
color.z = x_904; 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; let x_905 : f32 = color.z;
color.z = 0.0; color.z = 0.0f;
color.z = x_905; color.z = x_905;
let x_906 : i32 = i_2; let x_906 : i32 = i_2;
i_2 = 0i; i_2 = 0i;
i_2 = x_906; i_2 = x_906;
let x_511 : vec2<f32> = vec2<f32>(x_485.z, x_485.y); let x_511 : vec2<f32> = vec2<f32>(x_485.z, x_485.y);
let x_907 : vec3<f32> = color; 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; color = x_907;
let x_908 : f32 = uv.y; let x_908 : f32 = uv.y;
uv.y = 0.0; uv.y = 0.0f;
uv.y = x_908; uv.y = x_908;
let x_512 : vec3<f32> = vec3<f32>(x_455.y, x_455.y, x_455.y); let x_512 : vec3<f32> = vec3<f32>(x_455.y, x_455.y, x_455.y);
let x_909 : i32 = obj.numbers[4i]; let x_909 : i32 = obj.numbers[4i];
obj.numbers[4i] = 0i; obj.numbers[4i] = 0i;
obj.numbers[4i] = x_909; 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; let x_910 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_910; uv.x = x_910;
let x_911 : QuicksortObject = obj; let x_911 : QuicksortObject = obj;
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
@ -1394,47 +1394,47 @@ fn main_1() {
let x_317 : i32 = obj.numbers[9u]; let x_317 : i32 = obj.numbers[9u];
let x_514 : vec3<f32> = vec3<f32>(x_474.y, x_474.y, x_474.y); let x_514 : vec3<f32> = vec3<f32>(x_474.y, x_474.y, x_474.y);
let x_913 : f32 = uv.y; let x_913 : f32 = uv.y;
uv.y = 0.0; uv.y = 0.0f;
uv.y = x_913; uv.y = x_913;
let x_320 : f32 = color.x; let x_320 : f32 = color.x;
let x_914 : f32 = uv.y; let x_914 : f32 = uv.y;
uv.y = 0.0; uv.y = 0.0f;
uv.y = x_914; uv.y = x_914;
let x_515 : vec2<f32> = vec2<f32>(x_502.x, x_502.y); let x_515 : vec2<f32> = vec2<f32>(x_502.x, x_502.y);
let x_915 : f32 = color.x; let x_915 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_915; color.x = x_915;
let x_916 : vec3<f32> = color; 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; color = x_916;
let x_516 : vec2<f32> = vec2<f32>(x_452.x, x_452.x); let x_516 : vec2<f32> = vec2<f32>(x_452.x, x_452.x);
let x_917 : vec2<f32> = uv; let x_917 : vec2<f32> = uv;
uv = vec2<f32>(0.0, 0.0); uv = vec2<f32>(0.0f, 0.0f);
uv = x_917; uv = x_917;
let x_918 : f32 = uv.x; let x_918 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_918; uv.x = x_918;
let x_517 : vec3<f32> = vec3<f32>(vec2<f32>().x, vec2<f32>().x, vec2<f32>().y); let x_517 : vec3<f32> = vec3<f32>(vec2<f32>().x, vec2<f32>().x, vec2<f32>().y);
color.x = (f32(x_317) + x_320); color.x = (f32(x_317) + x_320);
let x_919 : f32 = color.x; let x_919 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_919; color.x = x_919;
let x_518 : vec3<f32> = vec3<f32>(x_480.y, x_508.x, x_480.x); let x_518 : vec3<f32> = vec3<f32>(x_480.y, x_508.x, x_480.x);
let x_920 : f32 = color.x; let x_920 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_920; color.x = x_920;
} }
let x_921 : f32 = uv.y; let x_921 : f32 = uv.y;
uv.y = 0.0; uv.y = 0.0f;
uv.y = x_921; uv.y = x_921;
let x_325 : vec3<f32> = color; let x_325 : vec3<f32> = color;
let x_922 : f32 = uv[0i]; let x_922 : f32 = uv[0i];
uv[0i] = 0.0; uv[0i] = 0.0f;
uv[0i] = x_922; uv[0i] = x_922;
let x_519 : vec3<f32> = vec3<f32>(x_447.x, x_446.x, x_446.y); 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_326 : vec3<f32> = normalize(x_325);
let x_923 : f32 = uv.x; let x_923 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_923; uv.x = x_923;
let x_924 : QuicksortObject = obj; let x_924 : QuicksortObject = obj;
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
@ -1443,19 +1443,19 @@ fn main_1() {
obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i)); obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
obj = x_925; obj = x_925;
let x_926 : f32 = color.y; let x_926 : f32 = color.y;
color.y = 0.0; color.y = 0.0f;
color.y = x_926; color.y = x_926;
let x_520 : vec2<f32> = vec2<f32>(x_506.y, x_519.y); let x_520 : vec2<f32> = vec2<f32>(x_506.y, x_519.y);
let x_927 : f32 = color.y; let x_927 : f32 = color.y;
color.y = 0.0; color.y = 0.0f;
color.y = x_927; 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; let x_928 : f32 = uv.y;
uv.y = 0.0; uv.y = 0.0f;
uv.y = x_928; 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; let x_929 : f32 = uv.x;
uv.x = 0.0; uv.x = 0.0f;
uv.x = x_929; uv.x = x_929;
x_GLF_color = x_330; x_GLF_color = x_330;
let x_930 : QuicksortObject = obj; let x_930 : QuicksortObject = obj;
@ -1463,7 +1463,7 @@ fn main_1() {
obj = x_930; obj = x_930;
let x_522 : vec3<f32> = vec3<f32>(x_330.w, x_330.y, x_493.x); let x_522 : vec3<f32> = vec3<f32>(x_330.w, x_330.y, x_493.x);
let x_931 : f32 = color.x; let x_931 : f32 = color.x;
color.x = 0.0; color.x = 0.0f;
color.x = x_931; color.x = x_931;
return; return;
} }

View File

@ -99,7 +99,7 @@ fn mm_readA_i1_i1_(row : ptr<function, i32>, col : ptr<function, i32>) -> f32 {
let x_448 : f32 = x_165.A[(((x_438 * x_439) + (x_441 * x_442)) + x_445)]; let x_448 : f32 = x_165.A[(((x_438 * x_439) + (x_441 * x_442)) + x_445)];
x_430 = x_448; x_430 = x_448;
} else { } else {
x_430 = 0.0; x_430 = 0.0f;
} }
let x_450 : f32 = x_430; let x_450 : f32 = x_430;
return x_450; return x_450;
@ -129,7 +129,7 @@ fn mm_readB_i1_i1_(row_1 : ptr<function, i32>, col_1 : ptr<function, i32>) -> f3
let x_485 : f32 = x_185.B[(((x_475 * x_476) + (x_478 * x_479)) + x_482)]; let x_485 : f32 = x_185.B[(((x_475 * x_476) + (x_478 * x_479)) + x_482)];
x_468 = x_485; x_468 = x_485;
} else { } else {
x_468 = 0.0; x_468 = 0.0f;
} }
let x_487 : f32 = x_468; let x_487 : f32 = x_468;
return x_487; return x_487;
@ -251,7 +251,7 @@ fn mm_matMul_i1_i1_i1_(dimAOuter : ptr<function, i32>, dimInner : ptr<function,
} }
let x_177 : i32 = innerRow; let x_177 : i32 = innerRow;
let x_178 : i32 = innerCol; let x_178 : i32 = innerCol;
acc[x_177][x_178] = 0.0; acc[x_177][x_178] = 0.0f;
continuing { continuing {
let x_181 : i32 = innerCol; let x_181 : i32 = innerCol;

View File

@ -34,8 +34,8 @@ fn getAAtOutCoords_() -> f32 {
fn unaryOperation_f1_(a : ptr<function, f32>) -> f32 { fn unaryOperation_f1_(a : ptr<function, f32>) -> f32 {
let x_47 : f32 = *(a); let x_47 : f32 = *(a);
if ((x_47 < 0.0)) { if ((x_47 < 0.0f)) {
return 0x1p+128; return 0x1p+128f;
} }
let x_55 : f32 = *(a); let x_55 : f32 = *(a);
return log(x_55); return log(x_55);

View File

@ -35,11 +35,11 @@ var<private> gl_GlobalInvocationID : vec3<u32>;
fn binaryOperation_f1_f1_(a : ptr<function, f32>, b : ptr<function, f32>) -> f32 { fn binaryOperation_f1_f1_(a : ptr<function, f32>, b : ptr<function, f32>) -> f32 {
var x_26 : f32; var x_26 : f32;
let x_13 : f32 = *(b); let x_13 : f32 = *(b);
if ((x_13 == 0.0)) { if ((x_13 == 0.0f)) {
return 1.0; return 1.0f;
} }
let x_21 : f32 = *(b); 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_29 : f32 = *(a);
let x_31 : f32 = *(b); let x_31 : f32 = *(b);
x_26 = pow(abs(x_29), x_31); x_26 = pow(abs(x_29), x_31);
@ -62,8 +62,8 @@ fn main_1() {
index = bitcast<i32>(x_54); index = bitcast<i32>(x_54);
a_1 = -10i; a_1 = -10i;
let x_63 : i32 = index; let x_63 : i32 = index;
param = -4.0; param = -4.0f;
param_1 = -3.0; param_1 = -3.0f;
let x_68 : f32 = binaryOperation_f1_f1_(&(param), &(param_1)); let x_68 : f32 = binaryOperation_f1_f1_(&(param), &(param_1));
resultMatrix.numbers[x_63] = x_68; resultMatrix.numbers[x_63] = x_68;
return; return;

View File

@ -1,7 +1,7 @@
fn main_1() { fn main_1() {
var a : f32; var a : f32;
var b : f32; var b : f32;
a = 42.0; a = 42.0f;
let x_11 : f32 = a; let x_11 : f32 = a;
b = degrees(x_11); b = degrees(x_11);
return; return;

View File

@ -1,7 +1,7 @@
fn main_1() { fn main_1() {
var a : f32; var a : f32;
var b : f32; var b : f32;
a = 42.0; a = 42.0f;
let x_11 : f32 = a; let x_11 : f32 = a;
b = radians(x_11); b = radians(x_11);
return; return;

View File

@ -3,8 +3,8 @@
var<private> tint_symbol_1 : vec4<f32> = vec4<f32>(); var<private> tint_symbol_1 : vec4<f32> = vec4<f32>();
fn textureLoad_6273b1() { fn textureLoad_6273b1() {
var res : f32 = 0.0; var res : f32 = 0.0f;
let x_17 : vec4<f32> = vec4<f32>(textureLoad(arg_0, vec2<i32>(), 1i), 0.0, 0.0, 0.0); let x_17 : vec4<f32> = vec4<f32>(textureLoad(arg_0, vec2<i32>(), 1i), 0.0f, 0.0f, 0.0f);
res = x_17.x; res = x_17.x;
return; return;
} }

View File

@ -1,7 +1,7 @@
var<private> out_var_SV_TARGET : vec4<f32>; var<private> out_var_SV_TARGET : vec4<f32>;
fn main_1() { 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; return;
} }

View File

@ -1,7 +1,7 @@
var<private> out_var_SV_TARGET : vec4<f32>; var<private> out_var_SV_TARGET : vec4<f32>;
fn main_1() { 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; return;
} }

View File

@ -1,7 +1,7 @@
var<private> out_var_SV_TARGET : vec4<f32>; var<private> out_var_SV_TARGET : vec4<f32>;
fn main_1() { 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; return;
} }

View File

@ -1,2 +1,2 @@
let m = mat2x2<f32>(0.0, 1.0, let m = mat2x2<f32>(0.0f, 1.0f,
2.0, 3.0); 2.0f, 3.0f);

View File

@ -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);

View File

@ -1,2 +1,2 @@
let m = mat2x2<f32>(vec2<f32>(0.0, 1.0), let m = mat2x2<f32>(vec2<f32>(0.0f, 1.0f),
vec2<f32>(2.0, 3.0)); vec2<f32>(2.0f, 3.0f));

View File

@ -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));

View File

@ -0,0 +1,2 @@
let m = mat2x2(0.0, 1.0,
2.0, 3.0);

View File

@ -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);

View File

@ -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));

View File

@ -0,0 +1,5 @@
#include <metal_stdlib>
using namespace metal;
constant float2x2 m = float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f));

View File

@ -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

View File

@ -0,0 +1 @@
let m = mat2x2(0.0, 1.0, 2.0, 3.0);

View File

@ -1,2 +1,2 @@
let m = mat2x2(0.0, 1.0, let m = mat2x2(0.0f, 1.0f,
2.0, 3.0); 2.0f, 3.0f);

View File

@ -1 +1 @@
let m = mat2x2(0.0, 1.0, 2.0, 3.0); let m = mat2x2(0.0f, 1.0f, 2.0f, 3.0f);

View File

@ -0,0 +1,2 @@
let m = mat2x2(vec2(0.0, 1.0),
vec2(2.0, 3.0));

View File

@ -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));

View File

@ -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));

View File

@ -0,0 +1,5 @@
#include <metal_stdlib>
using namespace metal;
constant float2x2 m = float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f));

View File

@ -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

View File

@ -0,0 +1 @@
let m = mat2x2(vec2(0.0, 1.0), vec2(2.0, 3.0));

View File

@ -1,2 +1,2 @@
let m = mat2x3<f32>(0.0, 1.0, 2.0, let m = mat2x3<f32>(0.0f, 1.0f, 2.0f,
3.0, 4.0, 5.0); 3.0f, 4.0f, 5.0f);

View File

@ -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);

View File

@ -1,2 +1,2 @@
let m = mat2x3<f32>(vec3<f32>(0.0, 1.0, 2.0), let m = mat2x3<f32>(vec3<f32>(0.0f, 1.0f, 2.0f),
vec3<f32>(3.0, 4.0, 5.0)); vec3<f32>(3.0f, 4.0f, 5.0f));

View File

@ -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));

View File

@ -0,0 +1,2 @@
let m = mat2x3(0.0, 1.0, 2.0,
3.0, 4.0, 5.0);

View File

@ -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);

View File

@ -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));

View File

@ -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));

View File

@ -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

View File

@ -0,0 +1 @@
let m = mat2x3(0.0, 1.0, 2.0, 3.0, 4.0, 5.0);

View File

@ -1,2 +1,2 @@
let m = mat2x3(0.0, 1.0, 2.0, let m = mat2x3(0.0f, 1.0f, 2.0f,
3.0, 4.0, 5.0); 3.0f, 4.0f, 5.0f);

View File

@ -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);

View File

@ -0,0 +1,2 @@
let m = mat2x3(vec3(0.0, 1.0, 2.0),
vec3(3.0, 4.0, 5.0));

View File

@ -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));

View File

@ -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));

View File

@ -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));

View File

@ -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

View File

@ -0,0 +1 @@
let m = mat2x3(vec3(0.0, 1.0, 2.0), vec3(3.0, 4.0, 5.0));

View File

@ -1,2 +1,2 @@
let m = mat2x3(vec3<f32>(0.0, 1.0, 2.0), let m = mat2x3(vec3<f32>(0.0f, 1.0f, 2.0f),
vec3<f32>(3.0, 4.0, 5.0)); vec3<f32>(3.0f, 4.0f, 5.0f));

View File

@ -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));

View File

@ -1,2 +1,2 @@
let m = mat2x4<f32>(0.0, 1.0, 2.0, 3.0, let m = mat2x4<f32>(0.0f, 1.0f, 2.0f, 3.0f,
4.0, 5.0, 6.0, 7.0); 4.0f, 5.0f, 6.0f, 7.0f);

View File

@ -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);

View File

@ -1,2 +1,2 @@
let m = mat2x4<f32>(vec4<f32>(0.0, 1.0, 2.0, 3.0), let m = mat2x4<f32>(vec4<f32>(0.0f, 1.0f, 2.0f, 3.0f),
vec4<f32>(4.0, 5.0, 6.0, 7.0)); vec4<f32>(4.0f, 5.0f, 6.0f, 7.0f));

View File

@ -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));

View File

@ -0,0 +1,2 @@
let m = mat2x4(0.0, 1.0, 2.0, 3.0,
4.0, 5.0, 6.0, 7.0);

View File

@ -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);

View File

@ -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));

View File

@ -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));

View File

@ -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

View File

@ -0,0 +1 @@
let m = mat2x4(0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0);

View File

@ -1,2 +1,2 @@
let m = mat2x4(0.0, 1.0, 2.0, 3.0, let m = mat2x4(0.0f, 1.0f, 2.0f, 3.0f,
4.0, 5.0, 6.0, 7.0); 4.0f, 5.0f, 6.0f, 7.0f);

View File

@ -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);

View File

@ -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));

View File

@ -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));

View File

@ -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));

View File

@ -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));

View File

@ -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

View File

@ -0,0 +1 @@
let m = mat2x4(vec4(0.0, 1.0, 2.0, 3.0), vec4(4.0, 5.0, 6.0, 7.0));

Some files were not shown because too many files have changed in this diff Show More