summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Versace <chad.versace@intel.com>2011-03-12 12:11:01 -0800
committerChad Versace <chad.versace@intel.com>2011-03-12 17:30:29 -0800
commit1681b12cad68638ff63cfbbde5af0efc7073203c (patch)
treeba5d02e504e954d553fc4b3a33ede9c2d6819966
parentad41d5532f5d8df71253d708f7c86cad315547a3 (diff)
glsl-1.30: Add tests for texture(sampler2DShadow, vec3)
Test each combination of (depth_texture_mode, texture_compare_func), where: depth_texture_mode is one of {red, luminance, intensity, alpha} texture_compare_func is one of {greater, always, never} Signed-off-by: Chad Versace <chad.versace@intel.com>
-rw-r--r--tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-01.shader_test29
-rw-r--r--tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-02.shader_test29
-rw-r--r--tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-03.shader_test29
-rw-r--r--tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-04.shader_test28
-rw-r--r--tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-05.shader_test28
-rw-r--r--tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-06.shader_test28
-rw-r--r--tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-07.shader_test28
-rw-r--r--tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-08.shader_test28
-rw-r--r--tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-09.shader_test28
-rw-r--r--tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-10.shader_test28
-rw-r--r--tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-11.shader_test28
-rw-r--r--tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-12.shader_test28
-rw-r--r--tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow.frag8
-rw-r--r--tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow.vert6
14 files changed, 353 insertions, 0 deletions
diff --git a/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-01.shader_test b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-01.shader_test
new file mode 100644
index 000000000..8cab7dd54
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-01.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test texture(sampler2DShadow, vec3) with
+# - depth texture mode = red
+# - texture compare func = greater
+
+[require]
+GLSL >= 1.30
+GL_ARB_texture_rg
+
+[vertex shader file]
+fs-texture-sampler2dshadow.vert
+
+[fragment shader file]
+fs-texture-sampler2dshadow.frag
+
+[test]
+uniform int tex 0
+texture shadow 0 (32, 32)
+texparameter depth_mode red
+texparameter compare_func greater
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 0.125, 0.125, 0.125);
+relative probe rgba (0.9, 1.0) (1.0, 0.125, 0.125, 0.125);
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (0.0, 0.125, 0.125, 0.125);
+relative probe rgba (1.0, 0.9) (0.0, 0.125, 0.125, 0.125);
diff --git a/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-02.shader_test b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-02.shader_test
new file mode 100644
index 000000000..b443bf103
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-02.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test texture(sampler2DShadow, vec3) with
+# - depth texture mode = red
+# - texture compare func = always
+
+[require]
+GLSL >= 1.30
+GL_ARB_texture_rg
+
+[vertex shader file]
+fs-texture-sampler2dshadow.vert
+
+[fragment shader file]
+fs-texture-sampler2dshadow.frag
+
+[test]
+uniform int tex 0
+texture shadow 0 (32, 32)
+texparameter depth_mode red
+texparameter compare_func always
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 0.125, 0.125, 0.125);
+relative probe rgba (0.9, 1.0) (1.0, 0.125, 0.125, 0.125);
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (1.0, 0.125, 0.125, 0.125);
+relative probe rgba (1.0, 0.9) (1.0, 0.125, 0.125, 0.125);
diff --git a/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-03.shader_test b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-03.shader_test
new file mode 100644
index 000000000..97af27cf4
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-03.shader_test
@@ -0,0 +1,29 @@
+# [description]
+# Test texture(sampler2DShadow, vec3) with
+# - depth texture mode = red
+# - texture compare func = never
+
+[require]
+GLSL >= 1.30
+GL_ARB_texture_rg
+
+[vertex shader file]
+fs-texture-sampler2dshadow.vert
+
+[fragment shader file]
+fs-texture-sampler2dshadow.frag
+
+[test]
+uniform int tex 0
+texture shadow 0 (32, 32)
+texparameter depth_mode red
+texparameter compare_func never
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (0.0, 0.125, 0.125, 0.125);
+relative probe rgba (0.9, 1.0) (0.0, 0.125, 0.125, 0.125);
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (0.0, 0.125, 0.125, 0.125);
+relative probe rgba (1.0, 0.9) (0.0, 0.125, 0.125, 0.125);
diff --git a/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-04.shader_test b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-04.shader_test
new file mode 100644
index 000000000..700d30e3d
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-04.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test texture(sampler2DShadow, vec3) with
+# - depth texture mode = luminance
+# - texture compare func = greater
+
+[require]
+GLSL >= 1.30
+
+[vertex shader file]
+fs-texture-sampler2dshadow.vert
+
+[fragment shader file]
+fs-texture-sampler2dshadow.frag
+
+[test]
+uniform int tex 0
+texture shadow 0 (32, 32)
+texparameter depth_mode luminance
+texparameter compare_func greater
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 0.125, 0.125, 0.125);
+relative probe rgba (0.9, 1.0) (1.0, 0.125, 0.125, 0.125);
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (0.0, 0.125, 0.125, 0.125);
+relative probe rgba (1.0, 0.9) (0.0, 0.125, 0.125, 0.125);
diff --git a/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-05.shader_test b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-05.shader_test
new file mode 100644
index 000000000..0423a3efc
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-05.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test texture(sampler2DShadow, vec3) with
+# - depth texture mode = luminance
+# - texture compare func = always
+
+[require]
+GLSL >= 1.30
+
+[vertex shader file]
+fs-texture-sampler2dshadow.vert
+
+[fragment shader file]
+fs-texture-sampler2dshadow.frag
+
+[test]
+uniform int tex 0
+texture shadow 0 (32, 32)
+texparameter depth_mode luminance
+texparameter compare_func always
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 0.125, 0.125, 0.125);
+relative probe rgba (0.9, 1.0) (1.0, 0.125, 0.125, 0.125);
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (1.0, 0.125, 0.125, 0.125);
+relative probe rgba (1.0, 0.9) (1.0, 0.125, 0.125, 0.125);
diff --git a/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-06.shader_test b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-06.shader_test
new file mode 100644
index 000000000..5a30f39c7
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-06.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test texture(sampler2DShadow, vec3) with
+# - depth texture mode = luminance
+# - texture compare func = never
+
+[require]
+GLSL >= 1.30
+
+[vertex shader file]
+fs-texture-sampler2dshadow.vert
+
+[fragment shader file]
+fs-texture-sampler2dshadow.frag
+
+[test]
+uniform int tex 0
+texture shadow 0 (32, 32)
+texparameter depth_mode luminance
+texparameter compare_func never
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (0.0, 0.125, 0.125, 0.125);
+relative probe rgba (0.9, 1.0) (0.0, 0.125, 0.125, 0.125);
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (0.0, 0.125, 0.125, 0.125);
+relative probe rgba (1.0, 0.9) (0.0, 0.125, 0.125, 0.125);
diff --git a/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-07.shader_test b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-07.shader_test
new file mode 100644
index 000000000..1c21206bf
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-07.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test texture(sampler2DShadow, vec3) with
+# - depth texture mode = intensity
+# - texture compare func = greater
+
+[require]
+GLSL >= 1.30
+
+[vertex shader file]
+fs-texture-sampler2dshadow.vert
+
+[fragment shader file]
+fs-texture-sampler2dshadow.frag
+
+[test]
+uniform int tex 0
+texture shadow 0 (32, 32)
+texparameter depth_mode intensity
+texparameter compare_func greater
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 0.125, 0.125, 0.125);
+relative probe rgba (0.9, 1.0) (1.0, 0.125, 0.125, 0.125);
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (0.0, 0.125, 0.125, 0.125);
+relative probe rgba (1.0, 0.9) (0.0, 0.125, 0.125, 0.125);
diff --git a/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-08.shader_test b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-08.shader_test
new file mode 100644
index 000000000..64ec75bb8
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-08.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test texture(sampler2DShadow, vec3) with
+# - depth texture mode = intensity
+# - texture compare func = always
+
+[require]
+GLSL >= 1.30
+
+[vertex shader file]
+fs-texture-sampler2dshadow.vert
+
+[fragment shader file]
+fs-texture-sampler2dshadow.frag
+
+[test]
+uniform int tex 0
+texture shadow 0 (32, 32)
+texparameter depth_mode intensity
+texparameter compare_func always
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 0.125, 0.125, 0.125);
+relative probe rgba (0.9, 1.0) (1.0, 0.125, 0.125, 0.125);
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (1.0, 0.125, 0.125, 0.125);
+relative probe rgba (1.0, 0.9) (1.0, 0.125, 0.125, 0.125);
diff --git a/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-09.shader_test b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-09.shader_test
new file mode 100644
index 000000000..8c455bbd3
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-09.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test texture(sampler2DShadow, vec3) with
+# - depth texture mode = intensity
+# - texture compare func = never
+
+[require]
+GLSL >= 1.30
+
+[vertex shader file]
+fs-texture-sampler2dshadow.vert
+
+[fragment shader file]
+fs-texture-sampler2dshadow.frag
+
+[test]
+uniform int tex 0
+texture shadow 0 (32, 32)
+texparameter depth_mode intensity
+texparameter compare_func never
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (0.0, 0.125, 0.125, 0.125);
+relative probe rgba (0.9, 1.0) (0.0, 0.125, 0.125, 0.125);
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (0.0, 0.125, 0.125, 0.125);
+relative probe rgba (1.0, 0.9) (0.0, 0.125, 0.125, 0.125);
diff --git a/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-10.shader_test b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-10.shader_test
new file mode 100644
index 000000000..8ad19c6de
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-10.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test texture(sampler2DShadow, vec3) with
+# - depth texture mode = alpha
+# - texture compare func = greater
+
+[require]
+GLSL >= 1.30
+
+[vertex shader file]
+fs-texture-sampler2dshadow.vert
+
+[fragment shader file]
+fs-texture-sampler2dshadow.frag
+
+[test]
+uniform int tex 0
+texture shadow 0 (32, 32)
+texparameter depth_mode alpha
+texparameter compare_func greater
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 0.125, 0.125, 0.125);
+relative probe rgba (0.9, 1.0) (1.0, 0.125, 0.125, 0.125);
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (0.0, 0.125, 0.125, 0.125);
+relative probe rgba (1.0, 0.9) (0.0, 0.125, 0.125, 0.125);
diff --git a/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-11.shader_test b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-11.shader_test
new file mode 100644
index 000000000..1c06a462a
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-11.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test texture(sampler2DShadow, vec3) with
+# - depth texture mode = alpha
+# - texture compare func = always
+
+[require]
+GLSL >= 1.30
+
+[vertex shader file]
+fs-texture-sampler2dshadow.vert
+
+[fragment shader file]
+fs-texture-sampler2dshadow.frag
+
+[test]
+uniform int tex 0
+texture shadow 0 (32, 32)
+texparameter depth_mode alpha
+texparameter compare_func always
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (1.0, 0.125, 0.125, 0.125);
+relative probe rgba (0.9, 1.0) (1.0, 0.125, 0.125, 0.125);
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (1.0, 0.125, 0.125, 0.125);
+relative probe rgba (1.0, 0.9) (1.0, 0.125, 0.125, 0.125);
diff --git a/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-12.shader_test b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-12.shader_test
new file mode 100644
index 000000000..6318a40d3
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow-12.shader_test
@@ -0,0 +1,28 @@
+# [description]
+# Test texture(sampler2DShadow, vec3) with
+# - depth texture mode = alpha
+# - texture compare func = never
+
+[require]
+GLSL >= 1.30
+
+[vertex shader file]
+fs-texture-sampler2dshadow.vert
+
+[fragment shader file]
+fs-texture-sampler2dshadow.frag
+
+[test]
+uniform int tex 0
+texture shadow 0 (32, 32)
+texparameter depth_mode alpha
+texparameter compare_func never
+draw rect -1 -1 2 2
+
+# depth comparison pass
+relative probe rgba (0.0, 0.1) (0.0, 0.125, 0.125, 0.125);
+relative probe rgba (0.9, 1.0) (0.0, 0.125, 0.125, 0.125);
+
+# depth comparison fail
+relative probe rgba (0.1, 0.0) (0.0, 0.125, 0.125, 0.125);
+relative probe rgba (1.0, 0.9) (0.0, 0.125, 0.125, 0.125);
diff --git a/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow.frag b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow.frag
new file mode 100644
index 000000000..e6763d23f
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow.frag
@@ -0,0 +1,8 @@
+#version 130
+const float canary = 0.125;
+uniform sampler2DShadow tex;
+in vec4 tex_coord;
+void main() {
+ float s = texture(tex, tex_coord.xyy);
+ gl_FragColor = vec4(s, canary, canary, canary);
+}
diff --git a/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow.vert b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow.vert
new file mode 100644
index 000000000..bb6661d9d
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-texture-sampler2dshadow.vert
@@ -0,0 +1,6 @@
+#version 130
+out vec4 tex_coord;
+void main() {
+ gl_Position = gl_Vertex;
+ tex_coord = (gl_Vertex + 1.0) / 2.0;
+}