[3/3] ext_texture_array: add a simple rendering test

Submitted by Brian Paul on July 31, 2014, 11 p.m.

Details

Message ID 1406847621-11305-3-git-send-email-brianp@vmware.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Brian Paul July 31, 2014, 11 p.m.
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

Patch hide | download patch | download mbox

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)