[Piglit] [PATCH 1/2] Add tests for integer uniforms in GLSL 1.10 and 1.30.

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


It's important to test both versions since GLSL 1.30 requires real
32-bit integer support while 1.10 (and 1.20) allow ints to be stored as
floating point values.
---
 .../execution/fs-uniform-int-110.shader_test       |   23 +++++++++++++++
 .../execution/vs-uniform-int-110.shader_test       |   27 ++++++++++++++++++
 .../execution/fs-uniform-int-130.shader_test       |   25 +++++++++++++++++
 .../execution/vs-uniform-int-130.shader_test       |   29 ++++++++++++++++++++
 4 files changed, 104 insertions(+), 0 deletions(-)
 create mode 100644 tests/spec/glsl-1.10/execution/fs-uniform-int-110.shader_test
 create mode 100644 tests/spec/glsl-1.10/execution/vs-uniform-int-110.shader_test
 create mode 100644 tests/spec/glsl-1.30/execution/fs-uniform-int-130.shader_test
 create mode 100644 tests/spec/glsl-1.30/execution/vs-uniform-int-130.shader_test

diff --git a/tests/spec/glsl-1.10/execution/fs-uniform-int-110.shader_test b/tests/spec/glsl-1.10/execution/fs-uniform-int-110.shader_test
new file mode 100644
index 0000000..408c6e5
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/fs-uniform-int-110.shader_test
@@ -0,0 +1,23 @@
+# [description]
+# Test integer uniforms.
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+void main()
+{
+	gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+uniform int v;
+void main()
+{
+	gl_FragColor = vec4(0.1 * float(v));
+}
+
+[test]
+uniform int v 2
+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.10/execution/vs-uniform-int-110.shader_test b/tests/spec/glsl-1.10/execution/vs-uniform-int-110.shader_test
new file mode 100644
index 0000000..91eda27
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/vs-uniform-int-110.shader_test
@@ -0,0 +1,27 @@
+# [description]
+# Test integer uniforms.
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+uniform int v;
+varying vec4 color;
+void main()
+{
+	color = vec4(0.1 * float(v));
+	gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+uniform int v;
+varying vec4 color;
+void main()
+{
+	gl_FragColor = color;
+}
+
+[test]
+uniform int v 2
+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-uniform-int-130.shader_test b/tests/spec/glsl-1.30/execution/fs-uniform-int-130.shader_test
new file mode 100644
index 0000000..9a00414
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-uniform-int-130.shader_test
@@ -0,0 +1,25 @@
+# [description]
+# Test integer uniforms.
+
+[require]
+GLSL >= 1.30
+
+[vertex shader]
+#version 130
+void main()
+{
+	gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 130
+uniform int v;
+void main()
+{
+	gl_FragColor = vec4(0.1 * v);
+}
+
+[test]
+uniform int v 2
+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/vs-uniform-int-130.shader_test b/tests/spec/glsl-1.30/execution/vs-uniform-int-130.shader_test
new file mode 100644
index 0000000..a39df0e
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/vs-uniform-int-130.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test integer uniforms.
+
+[require]
+GLSL >= 1.30
+
+[vertex shader]
+#version 130
+uniform int v;
+varying vec4 color;
+void main()
+{
+	color = vec4(0.1 * v);
+	gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 130
+uniform int v;
+varying vec4 color;
+void main()
+{
+	gl_FragColor = color;
+}
+
+[test]
+uniform int v 2
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.2, 0.2, 0.2, 0.2);
-- 
1.7.6



More information about the Piglit mailing list