[Piglit] [PATCH] arb_gs5: add nonconst sampler access tests

Ilia Mirkin imirkin at alum.mit.edu
Thu Aug 7 18:18:17 PDT 2014


These test some of the annoying cases of fermi/kepler instruction
encodings.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 .../sampler-nonconst-2d-array-proj.shader_test     | 48 +++++++++++++++++++
 .../sampler-nonconst-2d-array.shader_test          | 48 +++++++++++++++++++
 .../execution/sampler-nonconst-2d-proj.shader_test | 54 ++++++++++++++++++++++
 .../execution/sampler-nonconst-2d.shader_test      | 54 ++++++++++++++++++++++
 4 files changed, 204 insertions(+)
 create mode 100644 tests/spec/arb_gpu_shader5/execution/sampler-nonconst-2d-array-proj.shader_test
 create mode 100644 tests/spec/arb_gpu_shader5/execution/sampler-nonconst-2d-array.shader_test
 create mode 100644 tests/spec/arb_gpu_shader5/execution/sampler-nonconst-2d-proj.shader_test
 create mode 100644 tests/spec/arb_gpu_shader5/execution/sampler-nonconst-2d.shader_test

diff --git a/tests/spec/arb_gpu_shader5/execution/sampler-nonconst-2d-array-proj.shader_test b/tests/spec/arb_gpu_shader5/execution/sampler-nonconst-2d-array-proj.shader_test
new file mode 100644
index 0000000..3216cee
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/execution/sampler-nonconst-2d-array-proj.shader_test
@@ -0,0 +1,48 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader]
+#version 150
+in vec4 piglit_vertex;
+out vec4 texcoords;
+
+void main()
+{
+	gl_Position = piglit_vertex;
+	texcoords = (piglit_vertex + 1.0) / 2.0;
+}
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader5: enable
+in vec4 texcoords;
+
+/* The idea is that the tex array doesn't come first (and so 'other' must get
+ * some sort of usage), and we also want to ensure that the index is actually
+ * respected.
+ */
+uniform sampler2DArray other;
+uniform sampler2DArray tex[3];
+uniform int n;
+
+void main()
+{
+	gl_FragColor = textureGrad(tex[n], vec3(texcoords.xy, 1.0), vec2(0), vec2(0)) +
+		texture(other, vec3(texcoords.xy, 1.0)) * 0.00000000001;
+}
+
+[test]
+uniform int other 2
+uniform int tex[0] 3
+uniform int tex[1] 1
+uniform int tex[2] 4
+uniform int n 1
+
+texture rgbw 2DArray 1 (8, 8, 4)
+texture junk 2DArray 2 (8, 8, 4)
+texture junk 2DArray 3 (8, 8, 4)
+texture junk 2DArray 4 (8, 8, 4)
+
+draw rect -1 -1 2 2
+probe all rgb 0.0 1.0 0.0
diff --git a/tests/spec/arb_gpu_shader5/execution/sampler-nonconst-2d-array.shader_test b/tests/spec/arb_gpu_shader5/execution/sampler-nonconst-2d-array.shader_test
new file mode 100644
index 0000000..af52c75
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/execution/sampler-nonconst-2d-array.shader_test
@@ -0,0 +1,48 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader]
+#version 150
+in vec4 piglit_vertex;
+out vec4 texcoords;
+
+void main()
+{
+	gl_Position = piglit_vertex;
+	texcoords = (piglit_vertex + 1.0) / 2.0;
+}
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader5: enable
+in vec4 texcoords;
+
+/* The idea is that the tex array doesn't come first (and so 'other' must get
+ * some sort of usage), and we also want to ensure that the index is actually
+ * respected.
+ */
+uniform sampler2DArray other;
+uniform sampler2DArray tex[3];
+uniform int n;
+
+void main()
+{
+	gl_FragColor = texture(tex[n], vec3(texcoords.xy, 1.0)) +
+		texture(other, vec3(texcoords.xy, 1.0)) * 0.00000000001;
+}
+
+[test]
+uniform int other 2
+uniform int tex[0] 3
+uniform int tex[1] 1
+uniform int tex[2] 4
+uniform int n 1
+
+texture rgbw 2DArray 1 (8, 8, 4)
+texture junk 2DArray 2 (8, 8, 4)
+texture junk 2DArray 3 (8, 8, 4)
+texture junk 2DArray 4 (8, 8, 4)
+
+draw rect -1 -1 2 2
+probe all rgb 0.0 1.0 0.0
diff --git a/tests/spec/arb_gpu_shader5/execution/sampler-nonconst-2d-proj.shader_test b/tests/spec/arb_gpu_shader5/execution/sampler-nonconst-2d-proj.shader_test
new file mode 100644
index 0000000..e3fe9b3
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/execution/sampler-nonconst-2d-proj.shader_test
@@ -0,0 +1,54 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader]
+#version 150
+in vec4 piglit_vertex;
+out vec4 texcoords;
+
+void main()
+{
+	gl_Position = piglit_vertex;
+	texcoords = (piglit_vertex + 1.0) / 2.0;
+}
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader5: enable
+in vec4 texcoords;
+
+/* The idea is that the tex array doesn't come first (and so 'other' must get
+ * some sort of usage), and we also want to ensure that the index is actually
+ * respected.
+ */
+uniform sampler2D other;
+uniform sampler2D tex[3];
+uniform int n;
+
+void main()
+{
+	gl_FragColor = textureGrad(tex[n], texcoords.xy, vec2(0), vec2(0)) +
+		texture(other, texcoords.xy) * 0.00000000001;
+}
+
+[test]
+uniform int other 2
+uniform int tex[0] 3
+uniform int tex[1] 1
+uniform int tex[2] 4
+uniform int n 1
+
+texture rgbw 1 (8, 8)
+texture checkerboard 2 0 (8, 8) (0.0, 0.0, 0.0, 0.0) (1.0, 1.0, 0.0, 0.0)
+texparameter 2D min linear
+texture checkerboard 3 0 (8, 8) (0.0, 0.0, 0.0, 0.0) (0.0, 1.0, 1.0, 0.0)
+texparameter 2D min linear
+texture checkerboard 4 0 (8, 8) (0.0, 0.0, 0.0, 0.0) (1.0, 0.0, 1.0, 0.0)
+texparameter 2D min linear
+
+draw rect -1 -1 2 2
+relative probe rgb (0.25, 0.25) (1.0, 0.0, 0.0)
+relative probe rgb (0.75, 0.25) (0.0, 1.0, 0.0)
+relative probe rgb (0.25, 0.75) (0.0, 0.0, 1.0)
+relative probe rgb (0.75, 0.75) (1.0, 1.0, 1.0)
diff --git a/tests/spec/arb_gpu_shader5/execution/sampler-nonconst-2d.shader_test b/tests/spec/arb_gpu_shader5/execution/sampler-nonconst-2d.shader_test
new file mode 100644
index 0000000..54f0b79
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/execution/sampler-nonconst-2d.shader_test
@@ -0,0 +1,54 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader]
+#version 150
+in vec4 piglit_vertex;
+out vec4 texcoords;
+
+void main()
+{
+	gl_Position = piglit_vertex;
+	texcoords = (piglit_vertex + 1.0) / 2.0;
+}
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader5: enable
+in vec4 texcoords;
+
+/* The idea is that the tex array doesn't come first (and so 'other' must get
+ * some sort of usage), and we also want to ensure that the index is actually
+ * respected.
+ */
+uniform sampler2D other;
+uniform sampler2D tex[3];
+uniform int n;
+
+void main()
+{
+	gl_FragColor = texture(tex[n], texcoords.xy) +
+		texture(other, texcoords.xy) * 0.00000000001;
+}
+
+[test]
+uniform int other 2
+uniform int tex[0] 3
+uniform int tex[1] 1
+uniform int tex[2] 4
+uniform int n 1
+
+texture rgbw 1 (8, 8)
+texture checkerboard 2 0 (8, 8) (0.0, 0.0, 0.0, 0.0) (1.0, 1.0, 0.0, 0.0)
+texparameter 2D min linear
+texture checkerboard 3 0 (8, 8) (0.0, 0.0, 0.0, 0.0) (0.0, 1.0, 1.0, 0.0)
+texparameter 2D min linear
+texture checkerboard 4 0 (8, 8) (0.0, 0.0, 0.0, 0.0) (1.0, 0.0, 1.0, 0.0)
+texparameter 2D min linear
+
+draw rect -1 -1 2 2
+relative probe rgb (0.25, 0.25) (1.0, 0.0, 0.0)
+relative probe rgb (0.75, 0.25) (0.0, 1.0, 0.0)
+relative probe rgb (0.25, 0.75) (0.0, 0.0, 1.0)
+relative probe rgb (0.75, 0.75) (1.0, 1.0, 1.0)
-- 
1.8.5.5



More information about the Piglit mailing list