[Piglit] [PATCH 6/7] Add sampler1DArrayShadow and sampler2DArrayShadow GLSL tests

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


---
 tests/all.tests                                    |    3 +
 tests/shaders/shader_runner.c                      |  178 +++++++++++++++++++-
 tests/spec/ext_texture_array/glsl-fs-shadow.vert   |    8 +
 .../glsl-fs-shadow1DArray-01.shader_test           |   29 ++++
 .../glsl-fs-shadow1DArray-02.shader_test           |   29 ++++
 .../glsl-fs-shadow1DArray-03.shader_test           |   29 ++++
 .../glsl-fs-shadow1DArray-04.shader_test           |   29 ++++
 .../glsl-fs-shadow1DArray-05.shader_test           |   29 ++++
 .../glsl-fs-shadow1DArray-06.shader_test           |   29 ++++
 .../glsl-fs-shadow1DArray-07.shader_test           |   29 ++++
 .../glsl-fs-shadow1DArray-08.shader_test           |   29 ++++
 .../glsl-fs-shadow1DArray-09.shader_test           |   29 ++++
 .../glsl-fs-shadow1DArray-bias.shader_test         |   30 ++++
 .../ext_texture_array/glsl-fs-shadow1DArray.frag   |    9 +
 .../glsl-fs-shadow1DArray.shader_test              |   29 ++++
 .../glsl-fs-shadow2DArray-01.shader_test           |   29 ++++
 .../glsl-fs-shadow2DArray-02.shader_test           |   29 ++++
 .../glsl-fs-shadow2DArray-03.shader_test           |   29 ++++
 .../glsl-fs-shadow2DArray-04.shader_test           |   29 ++++
 .../glsl-fs-shadow2DArray-05.shader_test           |   29 ++++
 .../glsl-fs-shadow2DArray-06.shader_test           |   29 ++++
 .../glsl-fs-shadow2DArray-07.shader_test           |   29 ++++
 .../glsl-fs-shadow2DArray-08.shader_test           |   29 ++++
 .../glsl-fs-shadow2DArray-09.shader_test           |   29 ++++
 .../ext_texture_array/glsl-fs-shadow2DArray.frag   |    9 +
 .../glsl-fs-shadow2DArray.shader_test              |   29 ++++
 26 files changed, 816 insertions(+), 1 deletions(-)
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow.vert
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow1DArray-01.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow1DArray-02.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow1DArray-03.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow1DArray-04.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow1DArray-05.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow1DArray-06.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow1DArray-07.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow1DArray-08.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow1DArray-09.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow1DArray-bias.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow1DArray.frag
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow1DArray.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow2DArray-01.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow2DArray-02.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow2DArray-03.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow2DArray-04.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow2DArray-05.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow2DArray-06.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow2DArray-07.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow2DArray-08.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow2DArray-09.shader_test
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow2DArray.frag
 create mode 100644 tests/spec/ext_texture_array/glsl-fs-shadow2DArray.shader_test

diff --git a/tests/all.tests b/tests/all.tests
index 931e0d3..32c62df 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -1037,6 +1037,9 @@ ext_packed_depth_stencil['readpixels-24_8'] = PlainExecTest(['ext_packed_depth_s
 ext_texture_array = Group()
 spec['EXT_texture_array'] = ext_texture_array
 add_plain_test(ext_texture_array, 'fbo-generatemipmap-array')
+add_shader_test_dir(ext_texture_array,
+                    os.path.dirname(__file__) + '/spec/ext_texture_array',
+                    recursive=True)
 
 ext_texture_compression_latc = Group()
 spec['EXT_texture_compression_latc'] = ext_texture_compression_latc
diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 09d9b41..8ff370d 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -897,7 +897,7 @@ piglit_display(void)
 	while (line[0] != '\0') {
 		float c[32];
 		double d[4];
-		int x, y, w, h, tex, level;
+		int x, y, w, h, l, tex, level;
 
 		line = eat_whitespace(line);
 
@@ -1039,6 +1039,36 @@ piglit_display(void)
 			glTexParameteri(GL_TEXTURE_1D,
 					GL_DEPTH_TEXTURE_MODE_ARB,
 					GL_INTENSITY);
+		} else if (sscanf(line,
+				  "texture shadow1DArray %d ( %d , %d )",
+				  &tex, &w, &l) == 3) {
+			glActiveTexture(GL_TEXTURE0 + tex);
+			piglit_depth_texture(GL_TEXTURE_1D_ARRAY, GL_DEPTH_COMPONENT,
+					     w, 1, l, GL_FALSE);
+			glTexParameteri(GL_TEXTURE_1D_ARRAY,
+					GL_TEXTURE_COMPARE_MODE_ARB,
+					GL_COMPARE_R_TO_TEXTURE_ARB);
+			glTexParameteri(GL_TEXTURE_1D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_GREATER);
+			glTexParameteri(GL_TEXTURE_1D_ARRAY,
+					GL_DEPTH_TEXTURE_MODE_ARB,
+					GL_INTENSITY);
+		} else if (sscanf(line,
+				  "texture shadow2DArray %d ( %d , %d , %d )",
+				  &tex, &w, &h, &l) == 4) {
+			glActiveTexture(GL_TEXTURE0 + tex);
+			piglit_depth_texture(GL_TEXTURE_2D_ARRAY, GL_DEPTH_COMPONENT,
+					     w, h, l, GL_FALSE);
+			glTexParameteri(GL_TEXTURE_2D_ARRAY,
+					GL_TEXTURE_COMPARE_MODE_ARB,
+					GL_COMPARE_R_TO_TEXTURE_ARB);
+			glTexParameteri(GL_TEXTURE_2D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_GREATER);
+			glTexParameteri(GL_TEXTURE_2D_ARRAY,
+					GL_DEPTH_TEXTURE_MODE_ARB,
+					GL_INTENSITY);
 		} else if (!strncmp(line,
 				    "texparameter2D compare_func greater\n",
 				    36)) {
@@ -1185,6 +1215,152 @@ piglit_display(void)
 			glTexParameteri(GL_TEXTURE_1D,
 				        GL_DEPTH_TEXTURE_MODE_ARB,
 				        GL_ALPHA);
+		} else if (!strncmp(line,
+				    "texparameter1DArray compare_func greater\n",
+				    41)) {
+			glTexParameteri(GL_TEXTURE_1D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_GREATER);
+		} else if (!strncmp(line,
+				    "texparameter1DArray compare_func gequal\n",
+				    40)) {
+			glTexParameteri(GL_TEXTURE_1D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_GEQUAL);
+		} else if (!strncmp(line,
+				    "texparameter1DArray compare_func less\n",
+				    38)) {
+			glTexParameteri(GL_TEXTURE_1D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_LESS);
+		} else if (!strncmp(line,
+				    "texparameter1DArray compare_func lequal\n",
+				    40)) {
+			glTexParameteri(GL_TEXTURE_1D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_LEQUAL);
+		} else if (!strncmp(line,
+				    "texparameter1DArray compare_func equal\n",
+				    39)) {
+			glTexParameteri(GL_TEXTURE_1D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_EQUAL);
+		} else if (!strncmp(line,
+				    "texparameter1DArray compare_func notequal\n",
+				    42)) {
+			glTexParameteri(GL_TEXTURE_1D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_NOTEQUAL);
+		} else if (!strncmp(line,
+				    "texparameter1DArray compare_func always\n",
+				    40)) {
+			glTexParameteri(GL_TEXTURE_1D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_ALWAYS);
+		} else if (!strncmp(line,
+				    "texparameter1DArray compare_func never\n",
+				    39)) {
+			glTexParameteri(GL_TEXTURE_1D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_NEVER);
+		} else if (!strncmp(line,
+			           "texparameter1DArray depth_mode red\n",
+			            35)) {
+			/* Requires GL 3.0 or GL_ARB_texture_rg */
+			glTexParameteri(GL_TEXTURE_1D_ARRAY,
+				        GL_DEPTH_TEXTURE_MODE_ARB,
+				        GL_RED);
+		} else if (!strncmp(line,
+			           "texparameter1DArray depth_mode luminance\n",
+			            41)) {
+			glTexParameteri(GL_TEXTURE_1D_ARRAY,
+				        GL_DEPTH_TEXTURE_MODE_ARB,
+				        GL_LUMINANCE);
+		} else if (!strncmp(line,
+			           "texparameter1DArray depth_mode intensity\n",
+			            41)) {
+			glTexParameteri(GL_TEXTURE_1D_ARRAY,
+				        GL_DEPTH_TEXTURE_MODE_ARB,
+				        GL_INTENSITY);
+		} else if (!strncmp(line,
+			           "texparameter1DArray depth_mode alpha\n",
+			            36)) {
+			glTexParameteri(GL_TEXTURE_1D_ARRAY,
+				        GL_DEPTH_TEXTURE_MODE_ARB,
+				        GL_ALPHA);
+		} else if (!strncmp(line,
+				    "texparameter2DArray compare_func greater\n",
+				    41)) {
+			glTexParameteri(GL_TEXTURE_2D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_GREATER);
+		} else if (!strncmp(line,
+				    "texparameter2DArray compare_func gequal\n",
+				    40)) {
+			glTexParameteri(GL_TEXTURE_2D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_GEQUAL);
+		} else if (!strncmp(line,
+				    "texparameter2DArray compare_func less\n",
+				    38)) {
+			glTexParameteri(GL_TEXTURE_2D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_LESS);
+		} else if (!strncmp(line,
+				    "texparameter2DArray compare_func lequal\n",
+				    40)) {
+			glTexParameteri(GL_TEXTURE_2D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_LEQUAL);
+		} else if (!strncmp(line,
+				    "texparameter2DArray compare_func equal\n",
+				    39)) {
+			glTexParameteri(GL_TEXTURE_2D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_EQUAL);
+		} else if (!strncmp(line,
+				    "texparameter2DArray compare_func notequal\n",
+				    42)) {
+			glTexParameteri(GL_TEXTURE_2D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_NOTEQUAL);
+		} else if (!strncmp(line,
+				    "texparameter2DArray compare_func always\n",
+				    40)) {
+			glTexParameteri(GL_TEXTURE_2D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_ALWAYS);
+		} else if (!strncmp(line,
+				    "texparameter2DArray compare_func never\n",
+				    39)) {
+			glTexParameteri(GL_TEXTURE_2D_ARRAY,
+					GL_TEXTURE_COMPARE_FUNC_ARB,
+					GL_NEVER);
+		} else if (!strncmp(line,
+			           "texparameter2DArray depth_mode red\n",
+			            35)) {
+			/* Requires GL 3.0 or GL_ARB_texture_rg */
+			glTexParameteri(GL_TEXTURE_2D_ARRAY,
+				        GL_DEPTH_TEXTURE_MODE_ARB,
+				        GL_RED);
+		} else if (!strncmp(line,
+			           "texparameter2DArray depth_mode luminance\n",
+			            41)) {
+			glTexParameteri(GL_TEXTURE_2D_ARRAY,
+				        GL_DEPTH_TEXTURE_MODE_ARB,
+				        GL_LUMINANCE);
+		} else if (!strncmp(line,
+			           "texparameter2DArray depth_mode intensity\n",
+			            41)) {
+			glTexParameteri(GL_TEXTURE_2D_ARRAY,
+				        GL_DEPTH_TEXTURE_MODE_ARB,
+				        GL_INTENSITY);
+		} else if (!strncmp(line,
+			           "texparameter2DArray depth_mode alpha\n",
+			            36)) {
+			glTexParameteri(GL_TEXTURE_2D_ARRAY,
+				        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/ext_texture_array/glsl-fs-shadow.vert b/tests/spec/ext_texture_array/glsl-fs-shadow.vert
new file mode 100644
index 0000000..49de642
--- /dev/null
+++ b/tests/spec/ext_texture_array/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/ext_texture_array/glsl-fs-shadow1DArray-01.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-01.shader_test
new file mode 100644
index 0000000..64dcabf
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-01.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow1DArray(sampler1DArrayShadow, vec3) with
+#   - depth texture mode = luminance
+#   - texture compare func = greater
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow1DArray 0 (32, 1)
+texparameter1DArray depth_mode luminance
+texparameter1DArray 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/ext_texture_array/glsl-fs-shadow1DArray-02.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-02.shader_test
new file mode 100644
index 0000000..d33e4a4
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-02.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow1DArray(sampler1DArrayShadow, vec3) with
+#   - depth texture mode = luminance
+#   - texture compare func = always
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow1DArray 0 (32, 1)
+texparameter1DArray depth_mode luminance
+texparameter1DArray 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/ext_texture_array/glsl-fs-shadow1DArray-03.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-03.shader_test
new file mode 100644
index 0000000..a7b0f10
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-03.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow1DArray(sampler1DArrayShadow, vec3) with
+#   - depth texture mode = luminance
+#   - texture compare func = never
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow1DArray 0 (32, 1)
+texparameter1DArray depth_mode luminance
+texparameter1DArray 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/ext_texture_array/glsl-fs-shadow1DArray-04.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-04.shader_test
new file mode 100644
index 0000000..c6da231
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-04.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow1DArray(sampler1DArrayShadow, vec3) with
+#   - depth texture mode = intensity
+#   - texture compare func = greater
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow1DArray 0 (32, 1)
+texparameter1DArray depth_mode intensity
+texparameter1DArray 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/ext_texture_array/glsl-fs-shadow1DArray-05.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-05.shader_test
new file mode 100644
index 0000000..092be3b
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-05.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow1DArray(sampler1DArrayShadow, vec3) with
+#   - depth texture mode = intensity
+#   - texture compare func = always
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow1DArray 0 (32, 1)
+texparameter1DArray depth_mode intensity
+texparameter1DArray 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/ext_texture_array/glsl-fs-shadow1DArray-06.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-06.shader_test
new file mode 100644
index 0000000..71b5826
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-06.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow1DArray(sampler1DArrayShadow, vec3) with
+#   - depth texture mode = intensity
+#   - texture compare func = never
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow1DArray 0 (32, 1)
+texparameter1DArray depth_mode intensity
+texparameter1DArray 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/ext_texture_array/glsl-fs-shadow1DArray-07.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-07.shader_test
new file mode 100644
index 0000000..8c7cd12
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-07.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow1DArray(sampler1DArrayShadow, vec3) with
+#   - depth texture mode = alpha
+#   - texture compare func = greater
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow1DArray 0 (32, 1)
+texparameter1DArray depth_mode alpha
+texparameter1DArray 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/ext_texture_array/glsl-fs-shadow1DArray-08.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-08.shader_test
new file mode 100644
index 0000000..09f693c
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-08.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow1DArray(sampler1DArrayShadow, vec3) with
+#   - depth texture mode = alpha
+#   - texture compare func = always
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow1DArray 0 (32, 1)
+texparameter1DArray depth_mode alpha
+texparameter1DArray 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/ext_texture_array/glsl-fs-shadow1DArray-09.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-09.shader_test
new file mode 100644
index 0000000..e0a4963
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-09.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow1DArray(sampler1DArrayShadow, vec3) with
+#   - depth texture mode = alpha
+#   - texture compare func = never
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow1DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow1DArray 0 (32, 1)
+texparameter1DArray depth_mode alpha
+texparameter1DArray 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/ext_texture_array/glsl-fs-shadow1DArray-bias.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-bias.shader_test
new file mode 100644
index 0000000..84cd64f
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray-bias.shader_test
@@ -0,0 +1,30 @@
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader]
+#version 110
+#extension GL_EXT_texture_array : enable
+
+varying vec4 texcoords;
+uniform sampler1DArrayShadow tex;
+
+void main()
+{
+	gl_FragColor = shadow1DArray(tex, vec3(texcoords.x, 0.0, texcoords.y), 1.0);
+}
+
+[test]
+uniform int tex 0
+texture shadow1DArray 0 (32, 1)
+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/ext_texture_array/glsl-fs-shadow1DArray.frag b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray.frag
new file mode 100644
index 0000000..e3d2fc5
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray.frag
@@ -0,0 +1,9 @@
+#version 110
+#extension GL_EXT_texture_array : enable
+
+uniform sampler1DArrayShadow tex;
+varying vec4 texcoords;
+
+void main() {
+	gl_FragColor = shadow1DArray(tex, vec3(texcoords.x, 0.0, texcoords.y));
+}
diff --git a/tests/spec/ext_texture_array/glsl-fs-shadow1DArray.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray.shader_test
new file mode 100644
index 0000000..5dee31e
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow1DArray.shader_test
@@ -0,0 +1,29 @@
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader]
+#version 110
+#extension GL_EXT_texture_array : enable
+varying vec4 texcoords;
+uniform sampler1DArrayShadow tex;
+
+void main()
+{
+	gl_FragColor = shadow1DArray(tex, vec3(texcoords.x, 0.0, texcoords.y));
+}
+
+[test]
+uniform int tex 0
+texture shadow1DArray 0 (32, 1)
+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/ext_texture_array/glsl-fs-shadow2DArray-01.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-01.shader_test
new file mode 100644
index 0000000..db641ae
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-01.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DArray(sampler2DArrayShadow, vec3) with
+#   - depth texture mode = luminance
+#   - texture compare func = greater
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow2DArray 0 (32, 32, 1)
+texparameter2DArray depth_mode luminance
+texparameter2DArray 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/ext_texture_array/glsl-fs-shadow2DArray-02.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-02.shader_test
new file mode 100644
index 0000000..f74f23c
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-02.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DArray(sampler2DArrayShadow, vec3) with
+#   - depth texture mode = luminance
+#   - texture compare func = always
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow2DArray 0 (32, 32, 1)
+texparameter2DArray depth_mode luminance
+texparameter2DArray 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/ext_texture_array/glsl-fs-shadow2DArray-03.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-03.shader_test
new file mode 100644
index 0000000..a9bc114
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-03.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DArray(sampler2DArrayShadow, vec3) with
+#   - depth texture mode = luminance
+#   - texture compare func = never
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow2DArray 0 (32, 32, 1)
+texparameter2DArray depth_mode luminance
+texparameter2DArray 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/ext_texture_array/glsl-fs-shadow2DArray-04.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-04.shader_test
new file mode 100644
index 0000000..0404b9d
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-04.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DArray(sampler2DArrayShadow, vec3) with
+#   - depth texture mode = intensity
+#   - texture compare func = greater
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow2DArray 0 (32, 32, 1)
+texparameter2DArray depth_mode intensity
+texparameter2DArray 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/ext_texture_array/glsl-fs-shadow2DArray-05.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-05.shader_test
new file mode 100644
index 0000000..518e489
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-05.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DArray(sampler2DArrayShadow, vec3) with
+#   - depth texture mode = intensity
+#   - texture compare func = always
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow2DArray 0 (32, 32, 1)
+texparameter2DArray depth_mode intensity
+texparameter2DArray 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/ext_texture_array/glsl-fs-shadow2DArray-06.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-06.shader_test
new file mode 100644
index 0000000..319925a
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-06.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DArray(sampler2DArrayShadow, vec3) with
+#   - depth texture mode = intensity
+#   - texture compare func = never
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow2DArray 0 (32, 32, 1)
+texparameter2DArray depth_mode intensity
+texparameter2DArray 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/ext_texture_array/glsl-fs-shadow2DArray-07.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-07.shader_test
new file mode 100644
index 0000000..fb9d9cc
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-07.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DArray(sampler2DArrayShadow, vec3) with
+#   - depth texture mode = alpha
+#   - texture compare func = greater
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow2DArray 0 (32, 32, 1)
+texparameter2DArray depth_mode alpha
+texparameter2DArray 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/ext_texture_array/glsl-fs-shadow2DArray-08.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-08.shader_test
new file mode 100644
index 0000000..bd1c5ee
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-08.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DArray(sampler2DArrayShadow, vec3) with
+#   - depth texture mode = alpha
+#   - texture compare func = always
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow2DArray 0 (32, 32, 1)
+texparameter2DArray depth_mode alpha
+texparameter2DArray 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/ext_texture_array/glsl-fs-shadow2DArray-09.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-09.shader_test
new file mode 100644
index 0000000..cf2883b
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray-09.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test shadow2DArray(sampler2DArrayShadow, vec3) with
+#   - depth texture mode = alpha
+#   - texture compare func = never
+
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader file]
+glsl-fs-shadow2DArray.frag
+
+[test]
+uniform int tex 0
+texture shadow2DArray 0 (32, 32, 1)
+texparameter2DArray depth_mode alpha
+texparameter2DArray 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/ext_texture_array/glsl-fs-shadow2DArray.frag b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray.frag
new file mode 100644
index 0000000..b1b08e3
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray.frag
@@ -0,0 +1,9 @@
+#version 110
+#extension GL_EXT_texture_array : enable
+
+uniform sampler2DArrayShadow tex;
+varying vec4 texcoords;
+
+void main() {
+	gl_FragColor = shadow2DArray(tex, vec4(texcoords.x, texcoords.y, 0.0, texcoords.y));
+}
diff --git a/tests/spec/ext_texture_array/glsl-fs-shadow2DArray.shader_test b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray.shader_test
new file mode 100644
index 0000000..aa58405
--- /dev/null
+++ b/tests/spec/ext_texture_array/glsl-fs-shadow2DArray.shader_test
@@ -0,0 +1,29 @@
+[require]
+GLSL >= 1.10
+GL_EXT_texture_array
+
+[vertex shader file]
+glsl-fs-shadow.vert
+
+[fragment shader]
+#version 110
+#extension GL_EXT_texture_array : enable
+varying vec4 texcoords;
+uniform sampler2DArrayShadow tex;
+
+void main()
+{
+	gl_FragColor = shadow2DArray(tex, vec4(texcoords.x, texcoords.y, 0.5, texcoords.y));
+}
+
+[test]
+uniform int tex 0
+texture shadow2DArray 0 (32, 32, 1)
+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