From 7e96ca56e7177f80ac522a5ba20c17901bfd4a08 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 29 Sep 2009 16:45:05 -0600 Subject: glsl1: added sqrt(vec4) test --- src/glean/tglsl1.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/glean/tglsl1.cpp b/src/glean/tglsl1.cpp index 79ac78e..8169533 100644 --- a/src/glean/tglsl1.cpp +++ b/src/glean/tglsl1.cpp @@ -605,6 +605,23 @@ static const ShaderProgram Programs[] = { FLAG_NONE }, + { + // This test is interesting for sqrt(0) which may be + // implemented as 1/rsqrt(x) which would generate Inf values + "sqrt(vec4) function", + NO_VERTEX_SHADER, + "uniform vec4 uniform1; \n" + "void main() { \n" + " vec4 u = vec4(0.0, 0.09, 0.25, 1.0); \n" + " u = u * uniform1.xxxx; // mul by 1.0 \n" + " u = sqrt(u); \n" + " gl_FragColor = u; \n" + "} \n", + { 0.0, 0.3, 0.5, 1.0 }, + DONT_CARE_Z, + FLAG_NONE + }, + { "clamp() function", NO_VERTEX_SHADER, -- cgit v1.2.3