[Piglit] [PATCH 3/4] vs|fs-sqrt-const-zero: new sqrt(0) tests to replace tests removed previously

Brian Paul brianp at vmware.com
Fri Jul 20 11:33:42 PDT 2012


Note that sqrt(0) will typically be evaluated at compile time, not at render
time.  New tests will be added for render-time testing.
---
 tests/all.tests                                    |    5 +++++
 .../execution/fs-sqrt-const-zero.shader_test       |   19 +++++++++++++++++++
 .../execution/vs-sqrt-const-zero.shader_test       |   20 ++++++++++++++++++++
 3 files changed, 44 insertions(+), 0 deletions(-)
 create mode 100644 tests/spec/glsl-1.00/execution/fs-sqrt-const-zero.shader_test
 create mode 100644 tests/spec/glsl-1.00/execution/vs-sqrt-const-zero.shader_test

diff --git a/tests/all.tests b/tests/all.tests
index 5303272..db31eab 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -932,6 +932,11 @@ spec['glsl-1.00'] = Group()
 import_glsl_parser_tests(spec['glsl-1.00'],
 			 os.path.join(testsDir, 'spec', 'glsl-1.00'),
 			 ['compiler'])
+spec['glsl-1.00']['execution'] = Group()
+add_shader_test_dir(spec['glsl-1.00']['execution'],
+	            os.path.join(testsDir, 'spec', 'glsl-1.00', 'execution'),
+		    recursive=True)
+	
 
 # Group spec/glsl-1.10
 spec['glsl-1.10'] = Group()
diff --git a/tests/spec/glsl-1.00/execution/fs-sqrt-const-zero.shader_test b/tests/spec/glsl-1.00/execution/fs-sqrt-const-zero.shader_test
new file mode 100644
index 0000000..f14f767
--- /dev/null
+++ b/tests/spec/glsl-1.00/execution/fs-sqrt-const-zero.shader_test
@@ -0,0 +1,19 @@
+[require]
+GLSL >= 1.00
+
+[vertex shader]
+void main()
+{
+  gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+void main()
+{
+  gl_FragColor = vec4(sqrt(0.0) + 0.75);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe rgba 0 0   0.75 0.75 0.75 0.75
+
diff --git a/tests/spec/glsl-1.00/execution/vs-sqrt-const-zero.shader_test b/tests/spec/glsl-1.00/execution/vs-sqrt-const-zero.shader_test
new file mode 100644
index 0000000..414c7c3
--- /dev/null
+++ b/tests/spec/glsl-1.00/execution/vs-sqrt-const-zero.shader_test
@@ -0,0 +1,20 @@
+[require]
+GLSL >= 1.00
+
+[vertex shader]
+void main()
+{
+  gl_Position = gl_Vertex;
+  gl_FrontColor = vec4(sqrt(0.0) + 0.75);
+}
+
+[fragment shader]
+void main()
+{
+  gl_FragColor = gl_Color;
+}
+
+[test]
+draw rect -1 -1 2 2
+probe rgba 0 0   0.75 0.75 0.75 0.75
+
-- 
1.7.3.4



More information about the Piglit mailing list