[Piglit] [PATCH 5/7] Add sampler1DShadow GLSL tests

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


---
 tests/shaders/shader_runner.c                      |   88 ++++++++++++++++++++
 .../samplers/glsl-fs-shadow1D-01.shader_test       |   28 ++++++
 .../samplers/glsl-fs-shadow1D-02.shader_test       |   28 ++++++
 .../samplers/glsl-fs-shadow1D-03.shader_test       |   28 ++++++
 .../samplers/glsl-fs-shadow1D-04.shader_test       |   28 ++++++
 .../samplers/glsl-fs-shadow1D-05.shader_test       |   28 ++++++
 .../samplers/glsl-fs-shadow1D-06.shader_test       |   28 ++++++
 .../samplers/glsl-fs-shadow1D-07.shader_test       |   28 ++++++
 .../samplers/glsl-fs-shadow1D-08.shader_test       |   28 ++++++
 .../samplers/glsl-fs-shadow1D-09.shader_test       |   28 ++++++
 .../samplers/glsl-fs-shadow1D-bias.shader_test     |   26 ++++++
 .../execution/samplers/glsl-fs-shadow1D.frag       |    8 ++
 .../samplers/glsl-fs-shadow1D.shader_test          |   26 ++++++
 .../samplers/glsl-fs-shadow1DProj-bias.shader_test |   32 +++++++
 .../samplers/glsl-fs-shadow1DProj.shader_test      |   32 +++++++
 15 files changed, 464 insertions(+), 0 deletions(-)
 create mode 100644 tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-01.shader_test
 create mode 100644 tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-02.shader_test
 create mode 100644 tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-03.shader_test
 create mode 100644 tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-04.shader_test
 create mode 100644 tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-05.shader_test
 create mode 100644 tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-06.shader_test
 create mode 100644 tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-07.shader_test
 create mode 100644 tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-08.shader_test
 create mode 100644 tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-09.shader_test
 create mode 100644 tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-bias.shader_test
 create mode 100644 tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D.frag
 create mode 100644 tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D.shader_test
 create mode 100644 tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1DProj-bias.shader_test
 create mode 100644 tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1DProj.shader_test

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 3e9431b..09d9b41 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -1024,6 +1024,21 @@ piglit_display(void)
 					GL_INTENSITY);
 
 			glEnable(GL_TEXTURE_2D);
+		} else if (sscanf(line,
+				  "texture shadow1D %d ( %d )",
+				  &tex, &w) == 2) {
+			glActiveTexture(GL_TEXTURE0 + tex);
+			piglit_depth_texture(GL_TEXTURE_1D, GL_DEPTH_COMPONENT,
+					     w, 1, 1, GL_FALSE);
+			glTexParameteri(GL_TEXTURE_1D,
+					GL_TEXTURE_COMPARE_MODE_ARB,
+					GL_COMPARE_R_TO_TEXTURE_ARB);
+			glTexParameteri(GL_TEXTURE_1D,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_GREATER);
+			glTexParameteri(GL_TEXTURE_1D,
+					GL_DEPTH_TEXTURE_MODE_ARB,
+					GL_INTENSITY);
 		} else if (!strncmp(line,
 				    "texparameter2D compare_func greater\n",
 				    36)) {
@@ -1097,6 +1112,79 @@ piglit_display(void)
 			glTexParameteri(GL_TEXTURE_2D,
 				        GL_DEPTH_TEXTURE_MODE_ARB,
 				        GL_ALPHA);
+		} else if (!strncmp(line,
+				    "texparameter1D compare_func greater\n",
+				    36)) {
+			glTexParameteri(GL_TEXTURE_1D,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_GREATER);
+		} else if (!strncmp(line,
+				    "texparameter1D compare_func gequal\n",
+				    35)) {
+			glTexParameteri(GL_TEXTURE_1D,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_GEQUAL);
+		} else if (!strncmp(line,
+				    "texparameter1D compare_func less\n",
+				    33)) {
+			glTexParameteri(GL_TEXTURE_1D,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_LESS);
+		} else if (!strncmp(line,
+				    "texparameter1D compare_func lequal\n",
+				    35)) {
+			glTexParameteri(GL_TEXTURE_1D,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_LEQUAL);
+		} else if (!strncmp(line,
+				    "texparameter1D compare_func equal\n",
+				    34)) {
+			glTexParameteri(GL_TEXTURE_1D,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_EQUAL);
+		} else if (!strncmp(line,
+				    "texparameter1D compare_func notequal\n",
+				    37)) {
+			glTexParameteri(GL_TEXTURE_1D,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_NOTEQUAL);
+		} else if (!strncmp(line,
+				    "texparameter1D compare_func always\n",
+				    35)) {
+			glTexParameteri(GL_TEXTURE_1D,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_ALWAYS);
+		} else if (!strncmp(line,
+				    "texparameter1D compare_func never\n",
+				    34)) {
+			glTexParameteri(GL_TEXTURE_1D,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_NEVER);
+		} else if (!strncmp(line,
+			           "texparameter1D depth_mode red\n",
+			            30)) {
+			/* Requires GL 3.0 or GL_ARB_texture_rg */
+			glTexParameteri(GL_TEXTURE_1D,
+				        GL_DEPTH_TEXTURE_MODE_ARB,
+				        GL_RED);
+		} else if (!strncmp(line,
+			           "texparameter1D depth_mode luminance\n",
+			            36)) {
+			glTexParameteri(GL_TEXTURE_1D,
+				        GL_DEPTH_TEXTURE_MODE_ARB,
+				        GL_LUMINANCE);
+		} else if (!strncmp(line,
+			           "texparameter1D depth_mode intensity\n",
+			            36)) {
+			glTexParameteri(GL_TEXTURE_1D,
+				        GL_DEPTH_TEXTURE_MODE_ARB,
+				        GL_INTENSITY);
+		} else if (!strncmp(line,
+			           "texparameter1D depth_mode alpha\n",
+			            31)) {
+			glTexParameteri(GL_TEXTURE_1D,
+				        GL_DEPTH_TEXTURE_MODE_ARB,
+				        GL_ALPHA);
 		} else if (string_match("uniform", line)) {
 			set_uniform(line + 7);
 		} else if ((line[0] != '\n') && (line[0] != '\0')
diff --git a/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-01.shader_test b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-01.shader_test
new file mode 100644
index 0000000..ffac6f6
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-01.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test shadow1D(sampler1DShadow, vec3) with
+#   - depth texture mode = luminance
+#   - texture compare func = greater
+
+[require]
+GLSL >= 1.10
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1D.frag
+
+[test]
+uniform int tex 0
+texture shadow1D 0 (32)
+texparameter1D depth_mode luminance
+texparameter1D 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/glsl-1.10/execution/samplers/glsl-fs-shadow1D-02.shader_test b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-02.shader_test
new file mode 100644
index 0000000..ce264a9
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-02.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test shadow1D(sampler1DShadow, vec3) with
+#   - depth texture mode = luminance
+#   - texture compare func = always
+
+[require]
+GLSL >= 1.10
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1D.frag
+
+[test]
+uniform int tex 0
+texture shadow1D 0 (32)
+texparameter1D depth_mode luminance
+texparameter1D 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/glsl-1.10/execution/samplers/glsl-fs-shadow1D-03.shader_test b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-03.shader_test
new file mode 100644
index 0000000..2e8dcb9
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-03.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test shadow1D(sampler1DShadow, vec3) with
+#   - depth texture mode = luminance
+#   - texture compare func = never
+
+[require]
+GLSL >= 1.10
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1D.frag
+
+[test]
+uniform int tex 0
+texture shadow1D 0 (32)
+texparameter1D depth_mode luminance
+texparameter1D 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/glsl-1.10/execution/samplers/glsl-fs-shadow1D-04.shader_test b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-04.shader_test
new file mode 100644
index 0000000..4f486a0
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-04.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test shadow1D(sampler1DShadow, vec3) with
+#   - depth texture mode = intensity
+#   - texture compare func = greater
+
+[require]
+GLSL >= 1.10
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1D.frag
+
+[test]
+uniform int tex 0
+texture shadow1D 0 (32)
+texparameter1D depth_mode intensity
+texparameter1D 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/glsl-1.10/execution/samplers/glsl-fs-shadow1D-05.shader_test b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-05.shader_test
new file mode 100644
index 0000000..605eb0a
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-05.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test shadow1D(sampler1DShadow, vec3) with
+#   - depth texture mode = intensity
+#   - texture compare func = always
+
+[require]
+GLSL >= 1.10
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1D.frag
+
+[test]
+uniform int tex 0
+texture shadow1D 0 (32)
+texparameter1D depth_mode intensity
+texparameter1D 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/glsl-1.10/execution/samplers/glsl-fs-shadow1D-06.shader_test b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-06.shader_test
new file mode 100644
index 0000000..c7ee17f
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-06.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test shadow1D(sampler1DShadow, vec3) with
+#   - depth texture mode = intensity
+#   - texture compare func = never
+
+[require]
+GLSL >= 1.10
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1D.frag
+
+[test]
+uniform int tex 0
+texture shadow1D 0 (32)
+texparameter1D depth_mode intensity
+texparameter1D 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/glsl-1.10/execution/samplers/glsl-fs-shadow1D-07.shader_test b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-07.shader_test
new file mode 100644
index 0000000..7da5f9c
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-07.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test shadow1D(sampler1DShadow, vec3) with
+#   - depth texture mode = alpha
+#   - texture compare func = greater
+
+[require]
+GLSL >= 1.10
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1D.frag
+
+[test]
+uniform int tex 0
+texture shadow1D 0 (32)
+texparameter1D depth_mode alpha
+texparameter1D 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/glsl-1.10/execution/samplers/glsl-fs-shadow1D-08.shader_test b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-08.shader_test
new file mode 100644
index 0000000..4875408
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-08.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test shadow1D(sampler1DShadow, vec3) with
+#   - depth texture mode = alpha
+#   - texture compare func = always
+
+[require]
+GLSL >= 1.10
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1D.frag
+
+[test]
+uniform int tex 0
+texture shadow1D 0 (32)
+texparameter1D depth_mode alpha
+texparameter1D 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/glsl-1.10/execution/samplers/glsl-fs-shadow1D-09.shader_test b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-09.shader_test
new file mode 100644
index 0000000..3b58f08
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-09.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test shadow1D(sampler1DShadow, vec3) with
+#   - depth texture mode = alpha
+#   - texture compare func = never
+
+[require]
+GLSL >= 1.10
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1D.frag
+
+[test]
+uniform int tex 0
+texture shadow1D 0 (32)
+texparameter1D depth_mode alpha
+texparameter1D 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/glsl-1.10/execution/samplers/glsl-fs-shadow1D-bias.shader_test b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-bias.shader_test
new file mode 100644
index 0000000..59519e7
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D-bias.shader_test
@@ -0,0 +1,26 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader]
+varying vec4 texcoords;
+uniform sampler1DShadow tex;
+
+void main()
+{
+	gl_FragColor = shadow1D(tex, texcoords.xyy, 1.0);
+}
+
+[test]
+uniform int tex 0
+texture shadow1D 0 (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/glsl-1.10/execution/samplers/glsl-fs-shadow1D.frag b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D.frag
new file mode 100644
index 0000000..f32e98f
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D.frag
@@ -0,0 +1,8 @@
+#version 110
+
+uniform sampler1DShadow tex;
+varying vec4 texcoords;
+
+void main() {
+	gl_FragColor = shadow1D(tex, vec3(texcoords.x, 0.0, texcoords.y));
+}
diff --git a/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D.shader_test b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D.shader_test
new file mode 100644
index 0000000..cba45a3
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1D.shader_test
@@ -0,0 +1,26 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader]
+varying vec4 texcoords;
+uniform sampler1DShadow tex;
+
+void main()
+{
+	gl_FragColor = shadow1D(tex, vec3(texcoords.x, 0.0, texcoords.y));
+}
+
+[test]
+uniform int tex 0
+texture shadow1D 0 (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/glsl-1.10/execution/samplers/glsl-fs-shadow1DProj-bias.shader_test b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1DProj-bias.shader_test
new file mode 100644
index 0000000..0f30307
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1DProj-bias.shader_test
@@ -0,0 +1,32 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+varying vec4 texcoords;
+
+void main()
+{
+	gl_Position = gl_Vertex;
+	texcoords = gl_Vertex + 1.0;
+}
+
+[fragment shader]
+varying vec4 texcoords;
+uniform sampler1DShadow tex;
+
+void main()
+{
+	gl_FragColor = shadow1DProj(tex, vec4(texcoords.x, 0.0, texcoords.y, 2.0), 1.0);
+}
+
+[test]
+uniform int tex 0
+texture shadow1D 0 (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/glsl-1.10/execution/samplers/glsl-fs-shadow1DProj.shader_test b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1DProj.shader_test
new file mode 100644
index 0000000..1ab4bf4
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow1DProj.shader_test
@@ -0,0 +1,32 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+varying vec4 texcoords;
+
+void main()
+{
+	gl_Position = gl_Vertex;
+	texcoords = gl_Vertex + 1.0;
+}
+
+[fragment shader]
+varying vec4 texcoords;
+uniform sampler1DShadow tex;
+
+void main()
+{
+	gl_FragColor = shadow1DProj(tex, vec4(texcoords.x, 0.0, texcoords.y, 2.0));
+}
+
+[test]
+uniform int tex 0
+texture shadow1D 0 (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)
-- 
1.7.4.1



More information about the Piglit mailing list