summaryrefslogtreecommitdiff
path: root/tests/shaders/glsl-fs-tan-3.shader_test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shaders/glsl-fs-tan-3.shader_test')
-rw-r--r--tests/shaders/glsl-fs-tan-3.shader_test7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/shaders/glsl-fs-tan-3.shader_test b/tests/shaders/glsl-fs-tan-3.shader_test
index 6df7d4045..7a75ea6de 100644
--- a/tests/shaders/glsl-fs-tan-3.shader_test
+++ b/tests/shaders/glsl-fs-tan-3.shader_test
@@ -20,15 +20,16 @@ void main()
float retVal = tan(x);
// expected result, calculated by C program
- const float expVal = 1255.765592;
const float tolerance = 0.001;
+ const vec2 expVal = vec2(1255.765592 - tolerance,
+ 1255.848311 + tolerance);
// Top half of the window should be 0.5 gray, and the bottom half
// should be green.
if (y > 0.0)
- gl_FragColor = vec4(vec3(retVal / (2.0 * expVal)), 1.0);
+ gl_FragColor = vec4(vec2(retVal / (2.0 * expVal)).xyy, 1.0);
else
- gl_FragColor = (abs(retVal - expVal) <= tolerance)
+ gl_FragColor = ((retVal >= expVal.x) && (retVal <= expVal.y))
? vec4(0.0, 1.0, 0.0, 1.0) // green
: vec4(1.0, 0.0, 0.0, 1.0); // red
}