[Piglit] [PATCH 3/3] ext_texture_array: add a simple rendering test
Brian Paul
brianp at vmware.com
Thu Jul 31 16:00:21 PDT 2014
Check that we're sampling from the expected array slices.
---
tests/spec/ext_texture_array/render.shader_test | 44 +++++++++++++++++++++++
1 file changed, 44 insertions(+)
create mode 100644 tests/spec/ext_texture_array/render.shader_test
diff --git a/tests/spec/ext_texture_array/render.shader_test b/tests/spec/ext_texture_array/render.shader_test
new file mode 100644
index 0000000..189bb13
--- /dev/null
+++ b/tests/spec/ext_texture_array/render.shader_test
@@ -0,0 +1,44 @@
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader]
+#version 110
+varying vec4 texcoords;
+void main() {
+ gl_Position = gl_Vertex;
+ texcoords = (gl_Vertex + 1.0) / 2.0;
+}
+
+[fragment shader]
+#version 110
+#extension GL_EXT_texture_array : enable
+varying vec4 texcoords;
+uniform sampler2DArray tex;
+uniform float layer;
+
+void main()
+{
+ vec3 p = vec3(texcoords.xy, layer);
+ gl_FragColor = texture2DArray(tex, p);
+}
+
+[test]
+uniform int tex 0
+texture rgbw 2DArray 0 (32, 32, 4)
+
+uniform float layer 0
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (1.0, 0.0, 0.0, 1.0)
+
+uniform float layer 1
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.0, 1.0, 0.0, 1.0)
+
+uniform float layer 2
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (0.0, 0.0, 1.0, 1.0)
+
+uniform float layer 3
+draw rect -1 -1 2 2
+relative probe rgba (0.5, 0.5) (1.0, 1.0, 1.0, 1.0)
--
1.7.10.4
More information about the Piglit
mailing list