[Piglit] [PATCH 4/5] glsl-1.40: Add some tests for ARB_texture_rectangle being folded in.

Eric Anholt eric at anholt.net
Fri Mar 9 12:58:48 PST 2012


---
 .../execution/glsl-fs-shadow2DRect.shader_test     |   42 +++++++++++++++++++
 .../execution/glsl-fs-shadow2DRectProj.shader_test |   43 ++++++++++++++++++++
 2 files changed, 85 insertions(+), 0 deletions(-)
 create mode 100644 tests/spec/glsl-1.40/execution/glsl-fs-shadow2DRect.shader_test
 create mode 100644 tests/spec/glsl-1.40/execution/glsl-fs-shadow2DRectProj.shader_test

diff --git a/tests/spec/glsl-1.40/execution/glsl-fs-shadow2DRect.shader_test b/tests/spec/glsl-1.40/execution/glsl-fs-shadow2DRect.shader_test
new file mode 100644
index 0000000..d091784
--- /dev/null
+++ b/tests/spec/glsl-1.40/execution/glsl-fs-shadow2DRect.shader_test
@@ -0,0 +1,42 @@
+[require]
+GLSL >= 1.40
+
+[vertex shader]
+#version 140
+
+in vec4 vertex;
+out vec2 texcoords;
+void main()
+{
+	gl_Position = vertex;
+	texcoords = texcoords = (vertex.xy + 1.0) / 2.0;
+}
+
+[fragment shader]
+#version 140
+varying vec2 texcoords;
+uniform sampler2DRectShadow tex;
+
+void main()
+{
+	gl_FragColor = shadow2DRect(tex, texcoords.xyy * vec3(31.0, 31.0, 1.0));
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+uniform int tex 0
+texture shadowRect 0 (32, 32)
+draw arrays GL_TRIANGLE_FAN 0 4
+relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (0.0, 1.0) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
+
+relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 0.0)
+relative probe rgba (1.0, 0.0) (0.0, 0.0, 0.0, 0.0)
+relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 0.0)
diff --git a/tests/spec/glsl-1.40/execution/glsl-fs-shadow2DRectProj.shader_test b/tests/spec/glsl-1.40/execution/glsl-fs-shadow2DRectProj.shader_test
new file mode 100644
index 0000000..f79e38e
--- /dev/null
+++ b/tests/spec/glsl-1.40/execution/glsl-fs-shadow2DRectProj.shader_test
@@ -0,0 +1,43 @@
+x[require]
+GLSL >= 1.40
+
+[vertex shader]
+#version 140
+
+in vec4 vertex;
+out vec2 texcoords;
+
+void main()
+{
+	gl_Position = vertex;
+	texcoords = texcoords = (vertex.xy + 1.0) / 2.0;
+}
+
+[fragment shader]
+#version 140
+varying vec2 texcoords;
+uniform sampler2DRectShadow tex;
+
+void main()
+{
+	gl_FragColor = shadow2DRectProj(tex, vec4(texcoords.xyy * vec3(31.0, 31.0, 1.0), 2.0));
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+uniform int tex 0
+texture shadowRect 0 (32, 32)
+draw arrays GL_TRIANGLE_FAN 0 4
+relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (0.0, 1.0) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
+
+relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 0.0)
+relative probe rgba (1.0, 0.0) (0.0, 0.0, 0.0, 0.0)
+relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 0.0)
-- 
1.7.9.1



More information about the Piglit mailing list