[Piglit] [PATCH 2/2] glsl-1.30: Add fragment shader tests for modulus.

Kenneth Graunke kenneth at whitecape.org
Thu Aug 11 17:31:02 PDT 2011


---
 .../glsl-1.30/execution/fs-modulus-01.shader_test  |   26 ++++++++++++++++++++
 .../glsl-1.30/execution/fs-modulus-02.shader_test  |   25 +++++++++++++++++++
 2 files changed, 51 insertions(+), 0 deletions(-)
 create mode 100644 tests/spec/glsl-1.30/execution/fs-modulus-01.shader_test
 create mode 100644 tests/spec/glsl-1.30/execution/fs-modulus-02.shader_test

diff --git a/tests/spec/glsl-1.30/execution/fs-modulus-01.shader_test b/tests/spec/glsl-1.30/execution/fs-modulus-01.shader_test
new file mode 100644
index 0000000..e30dcf5
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-modulus-01.shader_test
@@ -0,0 +1,26 @@
+# [description]
+# Test integer modulus operations.
+
+[require]
+GLSL >= 1.30
+
+[vertex shader]
+#version 130
+void main()
+{
+	gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 130
+uniform int v;
+void main()
+{
+	int two = v % 3;
+	gl_FragColor = vec4(0.1 * two);
+}
+
+[test]
+uniform int v 5
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.2, 0.2, 0.2, 0.2);
diff --git a/tests/spec/glsl-1.30/execution/fs-modulus-02.shader_test b/tests/spec/glsl-1.30/execution/fs-modulus-02.shader_test
new file mode 100644
index 0000000..a20f136
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-modulus-02.shader_test
@@ -0,0 +1,25 @@
+# [description]
+# Test integer modulus operations.
+
+[require]
+GLSL >= 1.30
+
+[vertex shader]
+#version 130
+void main()
+{
+	gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 130
+uniform ivec4 v;
+void main()
+{
+	gl_FragColor = 0.1 * (v % 3);
+}
+
+[test]
+uniform ivec4 v 4 3 2 1
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.1, 0, 0.2, 0.1);
-- 
1.7.6



More information about the Piglit mailing list