[Piglit] [PATCH 7/7] Add sampler2DRect GLSL tests

Marek Olšák maraeo at gmail.com
Mon Sep 5 14:49:07 PDT 2011


---
 tests/all.tests                                    |    3 +
 tests/shaders/shader_runner.c                      |   88 ++++++++++++++++++++
 .../spec/arb_texture_rectangle/glsl-fs-shadow.vert |    8 ++
 .../glsl-fs-shadow2DRect-01.shader_test            |   29 +++++++
 .../glsl-fs-shadow2DRect-02.shader_test            |   29 +++++++
 .../glsl-fs-shadow2DRect-03.shader_test            |   29 +++++++
 .../glsl-fs-shadow2DRect-04.shader_test            |   29 +++++++
 .../glsl-fs-shadow2DRect-05.shader_test            |   29 +++++++
 .../glsl-fs-shadow2DRect-06.shader_test            |   29 +++++++
 .../glsl-fs-shadow2DRect-07.shader_test            |   29 +++++++
 .../glsl-fs-shadow2DRect-08.shader_test            |   29 +++++++
 .../glsl-fs-shadow2DRect-09.shader_test            |   29 +++++++
 .../glsl-fs-shadow2DRect.frag                      |    8 ++
 .../glsl-fs-shadow2DRect.shader_test               |   27 ++++++
 .../glsl-fs-shadow2DRectProj.shader_test           |   33 +++++++
 tests/util/piglit-util-gl.c                        |    1 +
 16 files changed, 429 insertions(+), 0 deletions(-)
 create mode 100644 tests/spec/arb_texture_rectangle/glsl-fs-shadow.vert
 create mode 100644 tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-01.shader_test
 create mode 100644 tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-02.shader_test
 create mode 100644 tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-03.shader_test
 create mode 100644 tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-04.shader_test
 create mode 100644 tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-05.shader_test
 create mode 100644 tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-06.shader_test
 create mode 100644 tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-07.shader_test
 create mode 100644 tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-08.shader_test
 create mode 100644 tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-09.shader_test
 create mode 100644 tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect.frag
 create mode 100644 tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect.shader_test
 create mode 100644 tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRectProj.shader_test

diff --git a/tests/all.tests b/tests/all.tests
index 32c62df..6161b33 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -907,6 +907,9 @@ arb_texture_rectangle = Group()
 spec['ARB_texture_rectangle'] = arb_texture_rectangle
 add_texwrap_test1(arb_texture_rectangle, 'RECT')
 add_texwrap_test2(arb_texture_rectangle, 'RECT', 'proj')
+add_shader_test_dir(arb_texture_rectangle,
+                    os.path.dirname(__file__) + '/spec/arb_texture_rectangle',
+                    recursive=True)
 
 tdfx_texture_compression_fxt1 = Group()
 spec['3DFX_texture_compression_FXT1'] = tdfx_texture_compression_fxt1
diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 8ff370d..cde5ae3 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -1025,6 +1025,21 @@ piglit_display(void)
 
 			glEnable(GL_TEXTURE_2D);
 		} else if (sscanf(line,
+				  "texture shadowRect %d ( %d , %d )",
+				  &tex, &w, &h) == 3) {
+			glActiveTexture(GL_TEXTURE0 + tex);
+			piglit_depth_texture(GL_TEXTURE_RECTANGLE, GL_DEPTH_COMPONENT,
+					     w, h, 1, GL_FALSE);
+			glTexParameteri(GL_TEXTURE_RECTANGLE,
+					GL_TEXTURE_COMPARE_MODE_ARB,
+					GL_COMPARE_R_TO_TEXTURE_ARB);
+			glTexParameteri(GL_TEXTURE_RECTANGLE,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_GREATER);
+			glTexParameteri(GL_TEXTURE_RECTANGLE,
+					GL_DEPTH_TEXTURE_MODE_ARB,
+					GL_INTENSITY);
+		} else if (sscanf(line,
 				  "texture shadow1D %d ( %d )",
 				  &tex, &w) == 2) {
 			glActiveTexture(GL_TEXTURE0 + tex);
@@ -1143,6 +1158,79 @@ piglit_display(void)
 				        GL_DEPTH_TEXTURE_MODE_ARB,
 				        GL_ALPHA);
 		} else if (!strncmp(line,
+				    "texparameterRect compare_func greater\n",
+				    38)) {
+			glTexParameteri(GL_TEXTURE_RECTANGLE,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_GREATER);
+		} else if (!strncmp(line,
+				    "texparameterRect compare_func gequal\n",
+				    37)) {
+			glTexParameteri(GL_TEXTURE_RECTANGLE,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_GEQUAL);
+		} else if (!strncmp(line,
+				    "texparameterRect compare_func less\n",
+				    35)) {
+			glTexParameteri(GL_TEXTURE_RECTANGLE,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_LESS);
+		} else if (!strncmp(line,
+				    "texparameterRect compare_func lequal\n",
+				    37)) {
+			glTexParameteri(GL_TEXTURE_RECTANGLE,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_LEQUAL);
+		} else if (!strncmp(line,
+				    "texparameterRect compare_func equal\n",
+				    36)) {
+			glTexParameteri(GL_TEXTURE_RECTANGLE,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_EQUAL);
+		} else if (!strncmp(line,
+				    "texparameterRect compare_func notequal\n",
+				    39)) {
+			glTexParameteri(GL_TEXTURE_RECTANGLE,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_NOTEQUAL);
+		} else if (!strncmp(line,
+				    "texparameterRect compare_func always\n",
+				    37)) {
+			glTexParameteri(GL_TEXTURE_RECTANGLE,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_ALWAYS);
+		} else if (!strncmp(line,
+				    "texparameterRect compare_func never\n",
+				    36)) {
+			glTexParameteri(GL_TEXTURE_RECTANGLE,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_NEVER);
+		} else if (!strncmp(line,
+			           "texparameterRect depth_mode red\n",
+			            32)) {
+			/* Requires GL 3.0 or GL_ARB_texture_rg */
+			glTexParameteri(GL_TEXTURE_RECTANGLE,
+				        GL_DEPTH_TEXTURE_MODE_ARB,
+				        GL_RED);
+		} else if (!strncmp(line,
+			           "texparameterRect depth_mode luminance\n",
+			            38)) {
+			glTexParameteri(GL_TEXTURE_RECTANGLE,
+				        GL_DEPTH_TEXTURE_MODE_ARB,
+				        GL_LUMINANCE);
+		} else if (!strncmp(line,
+			           "texparameterRect depth_mode intensity\n",
+			            38)) {
+			glTexParameteri(GL_TEXTURE_RECTANGLE,
+				        GL_DEPTH_TEXTURE_MODE_ARB,
+				        GL_INTENSITY);
+		} else if (!strncmp(line,
+			           "texparameterRect depth_mode alpha\n",
+			            33)) {
+			glTexParameteri(GL_TEXTURE_RECTANGLE,
+				        GL_DEPTH_TEXTURE_MODE_ARB,
+				        GL_ALPHA);
+		} else if (!strncmp(line,
 				    "texparameter1D compare_func greater\n",
 				    36)) {
 			glTexParameteri(GL_TEXTURE_1D,
diff --git a/tests/spec/arb_texture_rectangle/glsl-fs-shadow.vert b/tests/spec/arb_texture_rectangle/glsl-fs-shadow.vert
new file mode 100644
index 0000000..49de642
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/glsl-fs-shadow.vert
@@ -0,0 +1,8 @@
+#version 110
+
+varying vec4 texcoords;
+
+void main() {
+	gl_Position = gl_Vertex;
+	texcoords = (gl_Vertex + 1.0) / 2.0;
+}
diff --git a/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-01.shader_test b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-01.shader_test
new file mode 100644
index 0000000..2fc8389
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-01.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DRect(sampler2DRectShadow, vec3) with
+#   - depth texture mode = luminance
+#   - texture compare func = greater
+
+[require]
+GLSL >= 1.10
+GL_ARB_texture_rectangle
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DRect.frag
+
+[test]
+uniform int tex 0
+texture shadowRect 0 (32, 32)
+texparameterRect depth_mode luminance
+texparameterRect compare_func greater
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 1.0)
+relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 1.0)
diff --git a/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-02.shader_test b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-02.shader_test
new file mode 100644
index 0000000..2491fa9
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-02.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DRect(sampler2DRectShadow, vec3) with
+#   - depth texture mode = luminance
+#   - texture compare func = always
+
+[require]
+GLSL >= 1.10
+GL_ARB_texture_rectangle
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DRect.frag
+
+[test]
+uniform int tex 0
+texture shadowRect 0 (32, 32)
+texparameterRect depth_mode luminance
+texparameterRect compare_func always
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (1.0, 0.9) (1.0, 1.0, 1.0, 1.0)
diff --git a/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-03.shader_test b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-03.shader_test
new file mode 100644
index 0000000..4cdb71a
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-03.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DRect(sampler2DRectShadow, vec3) with
+#   - depth texture mode = luminance
+#   - texture compare func = never
+
+[require]
+GLSL >= 1.10
+GL_ARB_texture_rectangle
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DRect.frag
+
+[test]
+uniform int tex 0
+texture shadowRect 0 (32, 32)
+texparameterRect depth_mode luminance
+texparameterRect compare_func never
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (0.0, 0.0, 0.0, 1.0)
+relative probe rgba (0.9, 1.0) (0.0, 0.0, 0.0, 1.0)
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 1.0)
+relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 1.0)
diff --git a/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-04.shader_test b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-04.shader_test
new file mode 100644
index 0000000..16255cf
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-04.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DRect(sampler2DRectShadow, vec3) with
+#   - depth texture mode = intensity
+#   - texture compare func = greater
+
+[require]
+GLSL >= 1.10
+GL_ARB_texture_rectangle
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DRect.frag
+
+[test]
+uniform int tex 0
+texture shadowRect 0 (32, 32)
+texparameterRect depth_mode intensity
+texparameterRect compare_func greater
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
+
+# depth comparison fail
+relative probe rgba (0.1, 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/arb_texture_rectangle/glsl-fs-shadow2DRect-05.shader_test b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-05.shader_test
new file mode 100644
index 0000000..c72ccde
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-05.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DRect(sampler2DRectShadow, vec3) with
+#   - depth texture mode = intensity
+#   - texture compare func = always
+
+[require]
+GLSL >= 1.10
+GL_ARB_texture_rectangle
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DRect.frag
+
+[test]
+uniform int tex 0
+texture shadowRect 0 (32, 32)
+texparameterRect depth_mode intensity
+texparameterRect compare_func always
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (1.0, 1.0, 1.0, 1.0)
+relative probe rgba (1.0, 0.9) (1.0, 1.0, 1.0, 1.0)
diff --git a/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-06.shader_test b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-06.shader_test
new file mode 100644
index 0000000..7be391f
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-06.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DRect(sampler2DRectShadow, vec3) with
+#   - depth texture mode = intensity
+#   - texture compare func = never
+
+[require]
+GLSL >= 1.10
+GL_ARB_texture_rectangle
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DRect.frag
+
+[test]
+uniform int tex 0
+texture shadowRect 0 (32, 32)
+texparameterRect depth_mode intensity
+texparameterRect compare_func never
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (0.0, 0.0, 0.0, 0.0)
+relative probe rgba (0.9, 1.0) (0.0, 0.0, 0.0, 0.0)
+
+# depth comparison fail
+relative probe rgba (0.1, 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/arb_texture_rectangle/glsl-fs-shadow2DRect-07.shader_test b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-07.shader_test
new file mode 100644
index 0000000..c3c95bc
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-07.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DRect(sampler2DRectShadow, vec3) with
+#   - depth texture mode = alpha
+#   - texture compare func = greater
+
+[require]
+GLSL >= 1.10
+GL_ARB_texture_rectangle
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DRect.frag
+
+[test]
+uniform int tex 0
+texture shadowRect 0 (32, 32)
+texparameterRect depth_mode alpha
+texparameterRect compare_func greater
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (0.0, 0.0, 0.0, 1.0)
+relative probe rgba (0.9, 1.0) (0.0, 0.0, 0.0, 1.0)
+
+# depth comparison fail
+relative probe rgba (0.1, 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/arb_texture_rectangle/glsl-fs-shadow2DRect-08.shader_test b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-08.shader_test
new file mode 100644
index 0000000..5f78b5e
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-08.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DRect(sampler2DRectShadow, vec3) with
+#   - depth texture mode = alpha
+#   - texture compare func = always
+
+[require]
+GLSL >= 1.10
+GL_ARB_texture_rectangle
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DRect.frag
+
+[test]
+uniform int tex 0
+texture shadowRect 0 (32, 32)
+texparameterRect depth_mode alpha
+texparameterRect compare_func always
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (0.0, 0.0, 0.0, 1.0)
+relative probe rgba (0.9, 1.0) (0.0, 0.0, 0.0, 1.0)
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 1.0)
+relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 1.0)
diff --git a/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-09.shader_test b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-09.shader_test
new file mode 100644
index 0000000..32f90cf
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-09.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DRect(sampler2DRectShadow, vec3) with
+#   - depth texture mode = alpha
+#   - texture compare func = never
+
+[require]
+GLSL >= 1.10
+GL_ARB_texture_rectangle
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DRect.frag
+
+[test]
+uniform int tex 0
+texture shadowRect 0 (32, 32)
+texparameterRect depth_mode alpha
+texparameterRect compare_func never
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (0.0, 0.0, 0.0, 0.0)
+relative probe rgba (0.9, 1.0) (0.0, 0.0, 0.0, 0.0)
+
+# depth comparison fail
+relative probe rgba (0.1, 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/arb_texture_rectangle/glsl-fs-shadow2DRect.frag b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect.frag
new file mode 100644
index 0000000..73e95f2
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect.frag
@@ -0,0 +1,8 @@
+#version 110
+
+uniform sampler2DRectShadow tex;
+varying vec4 texcoords;
+
+void main() {
+	gl_FragColor = shadow2DRect(tex, texcoords.xyy * vec3(31.0, 31.0, 1.0));
+}
diff --git a/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect.shader_test b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect.shader_test
new file mode 100644
index 0000000..72ce736
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect.shader_test
@@ -0,0 +1,27 @@
+[require]
+GLSL >= 1.10
+GL_ARB_texture_rectangle
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader]
+varying vec4 texcoords;
+uniform sampler2DRectShadow tex;
+
+void main()
+{
+	gl_FragColor = shadow2DRect(tex, texcoords.xyy * vec3(31.0, 31.0, 1.0));
+}
+
+[test]
+uniform int tex 0
+texture shadowRect 0 (32, 32)
+draw rect -1 -1 2 2
+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/arb_texture_rectangle/glsl-fs-shadow2DRectProj.shader_test b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRectProj.shader_test
new file mode 100644
index 0000000..22a9c28
--- /dev/null
+++ b/tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRectProj.shader_test
@@ -0,0 +1,33 @@
+[require]
+GLSL >= 1.10
+GL_ARB_texture_rectangle
+
+[vertex shader]
+varying vec4 texcoords;
+
+void main()
+{
+	gl_Position = gl_Vertex;
+	texcoords = gl_Vertex + 1.0;
+}
+
+[fragment shader]
+varying vec4 texcoords;
+uniform sampler2DRectShadow tex;
+
+void main()
+{
+	gl_FragColor = shadow2DRectProj(tex, vec4(texcoords.xyy * vec3(31.0, 31.0, 1.0), 2.0));
+}
+
+[test]
+uniform int tex 0
+texture shadowRect 0 (32, 32)
+draw rect -1 -1 2 2
+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/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index 48472a7..1dead63 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -1040,6 +1040,7 @@ piglit_depth_texture(GLenum target, GLenum internalformat, int w, int h, int d,
 
 		case GL_TEXTURE_1D_ARRAY:
 		case GL_TEXTURE_2D:
+		case GL_TEXTURE_RECTANGLE:
 			glTexImage2D(target, level,
 				     internalformat,
 				     w, h, 0,
-- 
1.7.4.1



More information about the Piglit mailing list