GLSL: fix frexp and modf builtins.

These still had vestiges of HLSL.

Bug: tint:1222
Change-Id: I5f93f75e7384db641f0c5421dca24a3e8f2b716e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80140
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Stephen White 2022-02-11 13:41:23 +00:00 committed by Tint LUCI CQ
parent 73e7988694
commit 723f999ac2
13 changed files with 152 additions and 337 deletions

View File

@ -865,14 +865,6 @@ bool GeneratorImpl::EmitModfCall(std::ostream& out,
return CallBuiltinHelper( return CallBuiltinHelper(
out, expr, builtin, out, expr, builtin,
[&](TextBuffer* b, const std::vector<std::string>& params) { [&](TextBuffer* b, const std::vector<std::string>& params) {
auto* ty = builtin->Parameters()[0]->Type();
auto in = params[0];
std::string width;
if (auto* vec = ty->As<sem::Vector>()) {
width = std::to_string(vec->Width());
}
// Emit the builtin return type unique to this overload. This does not // Emit the builtin return type unique to this overload. This does not
// exist in the AST, so it will not be generated in Generate(). // exist in the AST, so it will not be generated in Generate().
if (!EmitStructType(&helpers_, if (!EmitStructType(&helpers_,
@ -880,16 +872,15 @@ bool GeneratorImpl::EmitModfCall(std::ostream& out,
return false; return false;
} }
line(b) << "float" << width << " whole;";
line(b) << "float" << width << " fract = modf(" << in << ", whole);";
{ {
auto l = line(b); auto l = line(b);
if (!EmitType(l, builtin->ReturnType(), ast::StorageClass::kNone, if (!EmitType(l, builtin->ReturnType(), ast::StorageClass::kNone,
ast::Access::kUndefined, "")) { ast::Access::kUndefined, "")) {
return false; return false;
} }
l << " result = {fract, whole};"; l << " result;";
} }
line(b) << "result.fract = modf(" << params[0] << ", result.whole);";
line(b) << "return result;"; line(b) << "return result;";
return true; return true;
}); });
@ -915,14 +906,6 @@ bool GeneratorImpl::EmitFrexpCall(std::ostream& out,
return CallBuiltinHelper( return CallBuiltinHelper(
out, expr, builtin, out, expr, builtin,
[&](TextBuffer* b, const std::vector<std::string>& params) { [&](TextBuffer* b, const std::vector<std::string>& params) {
auto* ty = builtin->Parameters()[0]->Type();
auto in = params[0];
std::string width;
if (auto* vec = ty->As<sem::Vector>()) {
width = std::to_string(vec->Width());
}
// Emit the builtin return type unique to this overload. This does not // Emit the builtin return type unique to this overload. This does not
// exist in the AST, so it will not be generated in Generate(). // exist in the AST, so it will not be generated in Generate().
if (!EmitStructType(&helpers_, if (!EmitStructType(&helpers_,
@ -930,16 +913,15 @@ bool GeneratorImpl::EmitFrexpCall(std::ostream& out,
return false; return false;
} }
line(b) << "float" << width << " exp;";
line(b) << "float" << width << " sig = frexp(" << in << ", exp);";
{ {
auto l = line(b); auto l = line(b);
if (!EmitType(l, builtin->ReturnType(), ast::StorageClass::kNone, if (!EmitType(l, builtin->ReturnType(), ast::StorageClass::kNone,
ast::Access::kUndefined, "")) { ast::Access::kUndefined, "")) {
return false; return false;
} }
l << " result = {sig, int" << width << "(exp)};"; l << " result;";
} }
line(b) << "result.sig = frexp(" << params[0] << ", result.exp);";
line(b) << "return result;"; line(b) << "return result;";
return true; return true;
}); });

View File

@ -290,61 +290,132 @@ TEST_F(GlslGeneratorImplTest_Builtin, Select_Vector) {
EXPECT_EQ(out.str(), "(bvec2(true, false) ? ivec2(3, 4) : ivec2(1, 2))"); EXPECT_EQ(out.str(), "(bvec2(true, false) ? ivec2(3, 4) : ivec2(1, 2))");
} }
#if 0
TEST_F(GlslGeneratorImplTest_Builtin, Modf_Scalar) { TEST_F(GlslGeneratorImplTest_Builtin, Modf_Scalar) {
auto* res = Var("res", ty.f32()); auto* call = Call("modf", 1.0f);
auto* call = Call("modf", 1.0f, AddressOf(res)); WrapInFunction(CallStmt(call));
WrapInFunction(res, call);
GeneratorImpl& gen = SanitizeAndBuild(); GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error(); ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_THAT(gen.result(), HasSubstr("modf(1.0f, res)")); EXPECT_EQ(gen.result(), R"(#version 310 es
struct modf_result {
float fract;
float whole;
};
modf_result tint_modf(float param_0) {
modf_result result;
result.fract = modf(param_0, result.whole);
return result;
}
void test_function() {
tint_modf(1.0f);
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
test_function();
return;
}
)");
} }
TEST_F(GlslGeneratorImplTest_Builtin, Modf_Vector) { TEST_F(GlslGeneratorImplTest_Builtin, Modf_Vector) {
auto* res = Var("res", ty.vec3<f32>()); auto* call = Call("modf", vec3<f32>());
auto* call = Call("modf", vec3<f32>(), AddressOf(res)); WrapInFunction(CallStmt(call));
WrapInFunction(res, call);
GeneratorImpl& gen = SanitizeAndBuild(); GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error(); ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_THAT(gen.result(), HasSubstr("modf(vec3(0.0f, 0.0f, 0.0f), res)")); EXPECT_EQ(gen.result(), R"(#version 310 es
struct modf_result_vec3 {
vec3 fract;
vec3 whole;
};
modf_result_vec3 tint_modf(vec3 param_0) {
modf_result_vec3 result;
result.fract = modf(param_0, result.whole);
return result;
}
void test_function() {
tint_modf(vec3(0.0f, 0.0f, 0.0f));
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
test_function();
return;
}
)");
} }
TEST_F(GlslGeneratorImplTest_Builtin, Frexp_Scalar_i32) { TEST_F(GlslGeneratorImplTest_Builtin, Frexp_Scalar_i32) {
auto* exp = Var("exp", ty.i32()); auto* call = Call("frexp", 1.0f);
auto* call = Call("frexp", 1.0f, AddressOf(exp)); WrapInFunction(CallStmt(call));
WrapInFunction(exp, call);
GeneratorImpl& gen = SanitizeAndBuild(); GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error(); ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_THAT(gen.result(), HasSubstr(R"( EXPECT_THAT(gen.result(), HasSubstr(R"(
float tint_tmp; float sig;
float tint_tmp_1 = frexp(1.0f, tint_tmp); int exp;
exp = int(tint_tmp); };
tint_tmp_1;
frexp_result tint_frexp(float param_0) {
frexp_result result;
result.sig = frexp(param_0, result.exp);
return result;
}
void test_function() {
tint_frexp(1.0f);
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
)")); )"));
} }
TEST_F(GlslGeneratorImplTest_Builtin, Frexp_Vector_i32) { TEST_F(GlslGeneratorImplTest_Builtin, Frexp_Vector_i32) {
auto* res = Var("res", ty.vec3<i32>()); auto* call = Call("frexp", vec3<f32>());
auto* call = Call("frexp", vec3<f32>(), AddressOf(res)); WrapInFunction(CallStmt(call));
WrapInFunction(res, call);
GeneratorImpl& gen = SanitizeAndBuild(); GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error(); ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_THAT(gen.result(), HasSubstr(R"( EXPECT_THAT(gen.result(), HasSubstr(R"(
vec3 tint_tmp;
vec3 tint_tmp_1 = frexp(vec3(0.0f, 0.0f, 0.0f), tint_tmp); struct frexp_result_vec3 {
res = ivec3(tint_tmp); vec3 sig;
tint_tmp_1; ivec3 exp;
};
frexp_result_vec3 tint_frexp(vec3 param_0) {
frexp_result_vec3 result;
result.sig = frexp(param_0, result.exp);
return result;
}
void test_function() {
tint_frexp(vec3(0.0f, 0.0f, 0.0f));
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
test_function();
return;
)")); )"));
} }
#if 0
TEST_F(GlslGeneratorImplTest_Builtin, IsNormal_Scalar) { TEST_F(GlslGeneratorImplTest_Builtin, IsNormal_Scalar) {
auto* val = Var("val", ty.f32()); auto* val = Var("val", ty.f32());
auto* call = Call("isNormal", val); auto* call = Call("isNormal", val);

View File

@ -1,5 +1,3 @@
SKIP: FAILED
#version 310 es #version 310 es
struct modf_result { struct modf_result {
@ -8,9 +6,8 @@ struct modf_result {
}; };
modf_result tint_modf(float param_0) { modf_result tint_modf(float param_0) {
float whole; modf_result result;
float fract = modf(param_0, whole); result.fract = modf(param_0, result.whole);
modf_result result = {fract, whole};
return result; return result;
} }
@ -23,10 +20,3 @@ void tint_symbol() {
float tint_symbol_1 = tint_modf(1.0f).whole; float tint_symbol_1 = tint_modf(1.0f).whole;
} }
Error parsing GLSL shader:
ERROR: 0:11: '{ } style initializers' : not supported with this profile: es
ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

@ -1,5 +1,3 @@
SKIP: FAILED
#version 310 es #version 310 es
struct frexp_result { struct frexp_result {
@ -8,9 +6,8 @@ struct frexp_result {
}; };
frexp_result tint_frexp(float param_0) { frexp_result tint_frexp(float param_0) {
float exp; frexp_result result;
float sig = frexp(param_0, exp); result.sig = frexp(param_0, result.exp);
frexp_result result = {sig, int(exp)};
return result; return result;
} }
@ -26,10 +23,3 @@ void main() {
tint_symbol(); tint_symbol();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:10: 'frexp' : no matching overloaded function found
ERROR: 0:10: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

@ -1,5 +1,3 @@
SKIP: FAILED
#version 310 es #version 310 es
struct frexp_result_vec3 { struct frexp_result_vec3 {
@ -8,9 +6,8 @@ struct frexp_result_vec3 {
}; };
frexp_result_vec3 tint_frexp(vec3 param_0) { frexp_result_vec3 tint_frexp(vec3 param_0) {
float3 exp; frexp_result_vec3 result;
float3 sig = frexp(param_0, exp); result.sig = frexp(param_0, result.exp);
frexp_result_vec3 result = {sig, int3(exp)};
return result; return result;
} }
@ -31,13 +28,6 @@ void main() {
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w); gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:9: 'float3' : undeclared identifier
ERROR: 0:9: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es #version 310 es
precision mediump float; precision mediump float;
@ -47,9 +37,8 @@ struct frexp_result_vec3 {
}; };
frexp_result_vec3 tint_frexp(vec3 param_0) { frexp_result_vec3 tint_frexp(vec3 param_0) {
float3 exp; frexp_result_vec3 result;
float3 sig = frexp(param_0, exp); result.sig = frexp(param_0, result.exp);
frexp_result_vec3 result = {sig, int3(exp)};
return result; return result;
} }
@ -66,13 +55,6 @@ void main() {
fragment_main(); fragment_main();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:10: 'float3' : undeclared identifier
ERROR: 0:10: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es #version 310 es
struct frexp_result_vec3 { struct frexp_result_vec3 {
@ -81,9 +63,8 @@ struct frexp_result_vec3 {
}; };
frexp_result_vec3 tint_frexp(vec3 param_0) { frexp_result_vec3 tint_frexp(vec3 param_0) {
float3 exp; frexp_result_vec3 result;
float3 sig = frexp(param_0, exp); result.sig = frexp(param_0, result.exp);
frexp_result_vec3 result = {sig, int3(exp)};
return result; return result;
} }
@ -101,10 +82,3 @@ void main() {
compute_main(); compute_main();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:9: 'float3' : undeclared identifier
ERROR: 0:9: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

@ -1,5 +1,3 @@
SKIP: FAILED
#version 310 es #version 310 es
struct frexp_result_vec4 { struct frexp_result_vec4 {
@ -8,9 +6,8 @@ struct frexp_result_vec4 {
}; };
frexp_result_vec4 tint_frexp(vec4 param_0) { frexp_result_vec4 tint_frexp(vec4 param_0) {
float4 exp; frexp_result_vec4 result;
float4 sig = frexp(param_0, exp); result.sig = frexp(param_0, result.exp);
frexp_result_vec4 result = {sig, int4(exp)};
return result; return result;
} }
@ -31,13 +28,6 @@ void main() {
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w); gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:9: 'float4' : undeclared identifier
ERROR: 0:9: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es #version 310 es
precision mediump float; precision mediump float;
@ -47,9 +37,8 @@ struct frexp_result_vec4 {
}; };
frexp_result_vec4 tint_frexp(vec4 param_0) { frexp_result_vec4 tint_frexp(vec4 param_0) {
float4 exp; frexp_result_vec4 result;
float4 sig = frexp(param_0, exp); result.sig = frexp(param_0, result.exp);
frexp_result_vec4 result = {sig, int4(exp)};
return result; return result;
} }
@ -66,13 +55,6 @@ void main() {
fragment_main(); fragment_main();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:10: 'float4' : undeclared identifier
ERROR: 0:10: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es #version 310 es
struct frexp_result_vec4 { struct frexp_result_vec4 {
@ -81,9 +63,8 @@ struct frexp_result_vec4 {
}; };
frexp_result_vec4 tint_frexp(vec4 param_0) { frexp_result_vec4 tint_frexp(vec4 param_0) {
float4 exp; frexp_result_vec4 result;
float4 sig = frexp(param_0, exp); result.sig = frexp(param_0, result.exp);
frexp_result_vec4 result = {sig, int4(exp)};
return result; return result;
} }
@ -101,10 +82,3 @@ void main() {
compute_main(); compute_main();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:9: 'float4' : undeclared identifier
ERROR: 0:9: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

@ -1,5 +1,3 @@
SKIP: FAILED
#version 310 es #version 310 es
struct frexp_result_vec2 { struct frexp_result_vec2 {
@ -8,9 +6,8 @@ struct frexp_result_vec2 {
}; };
frexp_result_vec2 tint_frexp(vec2 param_0) { frexp_result_vec2 tint_frexp(vec2 param_0) {
float2 exp; frexp_result_vec2 result;
float2 sig = frexp(param_0, exp); result.sig = frexp(param_0, result.exp);
frexp_result_vec2 result = {sig, int2(exp)};
return result; return result;
} }
@ -31,13 +28,6 @@ void main() {
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w); gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:9: 'float2' : undeclared identifier
ERROR: 0:9: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es #version 310 es
precision mediump float; precision mediump float;
@ -47,9 +37,8 @@ struct frexp_result_vec2 {
}; };
frexp_result_vec2 tint_frexp(vec2 param_0) { frexp_result_vec2 tint_frexp(vec2 param_0) {
float2 exp; frexp_result_vec2 result;
float2 sig = frexp(param_0, exp); result.sig = frexp(param_0, result.exp);
frexp_result_vec2 result = {sig, int2(exp)};
return result; return result;
} }
@ -66,13 +55,6 @@ void main() {
fragment_main(); fragment_main();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:10: 'float2' : undeclared identifier
ERROR: 0:10: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es #version 310 es
struct frexp_result_vec2 { struct frexp_result_vec2 {
@ -81,9 +63,8 @@ struct frexp_result_vec2 {
}; };
frexp_result_vec2 tint_frexp(vec2 param_0) { frexp_result_vec2 tint_frexp(vec2 param_0) {
float2 exp; frexp_result_vec2 result;
float2 sig = frexp(param_0, exp); result.sig = frexp(param_0, result.exp);
frexp_result_vec2 result = {sig, int2(exp)};
return result; return result;
} }
@ -101,10 +82,3 @@ void main() {
compute_main(); compute_main();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:9: 'float2' : undeclared identifier
ERROR: 0:9: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

@ -1,5 +1,3 @@
SKIP: FAILED
#version 310 es #version 310 es
struct frexp_result { struct frexp_result {
@ -8,9 +6,8 @@ struct frexp_result {
}; };
frexp_result tint_frexp(float param_0) { frexp_result tint_frexp(float param_0) {
float exp; frexp_result result;
float sig = frexp(param_0, exp); result.sig = frexp(param_0, result.exp);
frexp_result result = {sig, int(exp)};
return result; return result;
} }
@ -31,13 +28,6 @@ void main() {
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w); gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:10: 'frexp' : no matching overloaded function found
ERROR: 0:10: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es #version 310 es
precision mediump float; precision mediump float;
@ -47,9 +37,8 @@ struct frexp_result {
}; };
frexp_result tint_frexp(float param_0) { frexp_result tint_frexp(float param_0) {
float exp; frexp_result result;
float sig = frexp(param_0, exp); result.sig = frexp(param_0, result.exp);
frexp_result result = {sig, int(exp)};
return result; return result;
} }
@ -66,13 +55,6 @@ void main() {
fragment_main(); fragment_main();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:11: 'frexp' : no matching overloaded function found
ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es #version 310 es
struct frexp_result { struct frexp_result {
@ -81,9 +63,8 @@ struct frexp_result {
}; };
frexp_result tint_frexp(float param_0) { frexp_result tint_frexp(float param_0) {
float exp; frexp_result result;
float sig = frexp(param_0, exp); result.sig = frexp(param_0, result.exp);
frexp_result result = {sig, int(exp)};
return result; return result;
} }
@ -101,10 +82,3 @@ void main() {
compute_main(); compute_main();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:10: 'frexp' : no matching overloaded function found
ERROR: 0:10: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

@ -1,5 +1,3 @@
SKIP: FAILED
#version 310 es #version 310 es
struct modf_result { struct modf_result {
@ -8,9 +6,8 @@ struct modf_result {
}; };
modf_result tint_modf(float param_0) { modf_result tint_modf(float param_0) {
float whole; modf_result result;
float fract = modf(param_0, whole); result.fract = modf(param_0, result.whole);
modf_result result = {fract, whole};
return result; return result;
} }
@ -31,13 +28,6 @@ void main() {
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w); gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:11: '{ } style initializers' : not supported with this profile: es
ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es #version 310 es
precision mediump float; precision mediump float;
@ -47,9 +37,8 @@ struct modf_result {
}; };
modf_result tint_modf(float param_0) { modf_result tint_modf(float param_0) {
float whole; modf_result result;
float fract = modf(param_0, whole); result.fract = modf(param_0, result.whole);
modf_result result = {fract, whole};
return result; return result;
} }
@ -66,13 +55,6 @@ void main() {
fragment_main(); fragment_main();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:12: '{ } style initializers' : not supported with this profile: es
ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es #version 310 es
struct modf_result { struct modf_result {
@ -81,9 +63,8 @@ struct modf_result {
}; };
modf_result tint_modf(float param_0) { modf_result tint_modf(float param_0) {
float whole; modf_result result;
float fract = modf(param_0, whole); result.fract = modf(param_0, result.whole);
modf_result result = {fract, whole};
return result; return result;
} }
@ -101,10 +82,3 @@ void main() {
compute_main(); compute_main();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:11: '{ } style initializers' : not supported with this profile: es
ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

@ -1,5 +1,3 @@
SKIP: FAILED
#version 310 es #version 310 es
struct modf_result_vec3 { struct modf_result_vec3 {
@ -8,9 +6,8 @@ struct modf_result_vec3 {
}; };
modf_result_vec3 tint_modf(vec3 param_0) { modf_result_vec3 tint_modf(vec3 param_0) {
float3 whole; modf_result_vec3 result;
float3 fract = modf(param_0, whole); result.fract = modf(param_0, result.whole);
modf_result_vec3 result = {fract, whole};
return result; return result;
} }
@ -31,13 +28,6 @@ void main() {
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w); gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:9: 'float3' : undeclared identifier
ERROR: 0:9: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es #version 310 es
precision mediump float; precision mediump float;
@ -47,9 +37,8 @@ struct modf_result_vec3 {
}; };
modf_result_vec3 tint_modf(vec3 param_0) { modf_result_vec3 tint_modf(vec3 param_0) {
float3 whole; modf_result_vec3 result;
float3 fract = modf(param_0, whole); result.fract = modf(param_0, result.whole);
modf_result_vec3 result = {fract, whole};
return result; return result;
} }
@ -66,13 +55,6 @@ void main() {
fragment_main(); fragment_main();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:10: 'float3' : undeclared identifier
ERROR: 0:10: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es #version 310 es
struct modf_result_vec3 { struct modf_result_vec3 {
@ -81,9 +63,8 @@ struct modf_result_vec3 {
}; };
modf_result_vec3 tint_modf(vec3 param_0) { modf_result_vec3 tint_modf(vec3 param_0) {
float3 whole; modf_result_vec3 result;
float3 fract = modf(param_0, whole); result.fract = modf(param_0, result.whole);
modf_result_vec3 result = {fract, whole};
return result; return result;
} }
@ -101,10 +82,3 @@ void main() {
compute_main(); compute_main();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:9: 'float3' : undeclared identifier
ERROR: 0:9: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

@ -1,5 +1,3 @@
SKIP: FAILED
#version 310 es #version 310 es
struct modf_result_vec4 { struct modf_result_vec4 {
@ -8,9 +6,8 @@ struct modf_result_vec4 {
}; };
modf_result_vec4 tint_modf(vec4 param_0) { modf_result_vec4 tint_modf(vec4 param_0) {
float4 whole; modf_result_vec4 result;
float4 fract = modf(param_0, whole); result.fract = modf(param_0, result.whole);
modf_result_vec4 result = {fract, whole};
return result; return result;
} }
@ -31,13 +28,6 @@ void main() {
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w); gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:9: 'float4' : undeclared identifier
ERROR: 0:9: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es #version 310 es
precision mediump float; precision mediump float;
@ -47,9 +37,8 @@ struct modf_result_vec4 {
}; };
modf_result_vec4 tint_modf(vec4 param_0) { modf_result_vec4 tint_modf(vec4 param_0) {
float4 whole; modf_result_vec4 result;
float4 fract = modf(param_0, whole); result.fract = modf(param_0, result.whole);
modf_result_vec4 result = {fract, whole};
return result; return result;
} }
@ -66,13 +55,6 @@ void main() {
fragment_main(); fragment_main();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:10: 'float4' : undeclared identifier
ERROR: 0:10: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es #version 310 es
struct modf_result_vec4 { struct modf_result_vec4 {
@ -81,9 +63,8 @@ struct modf_result_vec4 {
}; };
modf_result_vec4 tint_modf(vec4 param_0) { modf_result_vec4 tint_modf(vec4 param_0) {
float4 whole; modf_result_vec4 result;
float4 fract = modf(param_0, whole); result.fract = modf(param_0, result.whole);
modf_result_vec4 result = {fract, whole};
return result; return result;
} }
@ -101,10 +82,3 @@ void main() {
compute_main(); compute_main();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:9: 'float4' : undeclared identifier
ERROR: 0:9: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

@ -1,5 +1,3 @@
SKIP: FAILED
#version 310 es #version 310 es
struct modf_result_vec2 { struct modf_result_vec2 {
@ -8,9 +6,8 @@ struct modf_result_vec2 {
}; };
modf_result_vec2 tint_modf(vec2 param_0) { modf_result_vec2 tint_modf(vec2 param_0) {
float2 whole; modf_result_vec2 result;
float2 fract = modf(param_0, whole); result.fract = modf(param_0, result.whole);
modf_result_vec2 result = {fract, whole};
return result; return result;
} }
@ -31,13 +28,6 @@ void main() {
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w); gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:9: 'float2' : undeclared identifier
ERROR: 0:9: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es #version 310 es
precision mediump float; precision mediump float;
@ -47,9 +37,8 @@ struct modf_result_vec2 {
}; };
modf_result_vec2 tint_modf(vec2 param_0) { modf_result_vec2 tint_modf(vec2 param_0) {
float2 whole; modf_result_vec2 result;
float2 fract = modf(param_0, whole); result.fract = modf(param_0, result.whole);
modf_result_vec2 result = {fract, whole};
return result; return result;
} }
@ -66,13 +55,6 @@ void main() {
fragment_main(); fragment_main();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:10: 'float2' : undeclared identifier
ERROR: 0:10: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
#version 310 es #version 310 es
struct modf_result_vec2 { struct modf_result_vec2 {
@ -81,9 +63,8 @@ struct modf_result_vec2 {
}; };
modf_result_vec2 tint_modf(vec2 param_0) { modf_result_vec2 tint_modf(vec2 param_0) {
float2 whole; modf_result_vec2 result;
float2 fract = modf(param_0, whole); result.fract = modf(param_0, result.whole);
modf_result_vec2 result = {fract, whole};
return result; return result;
} }
@ -101,10 +82,3 @@ void main() {
compute_main(); compute_main();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:9: 'float2' : undeclared identifier
ERROR: 0:9: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

@ -1,5 +1,3 @@
SKIP: FAILED
#version 310 es #version 310 es
struct modf_result { struct modf_result {
@ -8,9 +6,8 @@ struct modf_result {
}; };
modf_result tint_modf(float param_0) { modf_result tint_modf(float param_0) {
float whole; modf_result result;
float fract = modf(param_0, whole); result.fract = modf(param_0, result.whole);
modf_result result = {fract, whole};
return result; return result;
} }
@ -26,10 +23,3 @@ void main() {
tint_symbol(); tint_symbol();
return; return;
} }
Error parsing GLSL shader:
ERROR: 0:11: '{ } style initializers' : not supported with this profile: es
ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.