diff options
author | Chad Versace <chad.versace@intel.com> | 2011-03-12 15:08:35 -0800 |
---|---|---|
committer | Chad Versace <chad.versace@intel.com> | 2011-03-12 17:30:29 -0800 |
commit | 8fa7aff20059e4819ad671cbb6920450d9859fea (patch) | |
tree | 27e2085d1a78aff26e37274b98c3aec788101f98 | |
parent | 511e806c31cee8f5e187133df0b4386aeda9ed39 (diff) |
arb_texture_rg: Add execution tests for shadow2D()
Signed-off-by: Chad Versace <chad.versace@intel.com>
6 files changed, 127 insertions, 0 deletions
diff --git a/tests/all.tests b/tests/all.tests index cef2af2cb..7a37b4ea6 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -814,6 +814,9 @@ spec['EXT_texture_integer'] = ext_texture_integer arb_texture_rg = Group() spec['ARB_texture_rg'] = arb_texture_rg +add_shader_test_dir(arb_texture_rg, + os.path.dirname(__file__) + '/spec/arb_texture_rg/execution', + recursive=True) add_fbo_generatemipmap_extension(arb_texture_rg, 'GL_ARB_texture_rg', 'fbo-generatemipmap-formats') add_fbo_generatemipmap_extension(arb_texture_rg, 'GL_ARB_texture_rg-float', 'fbo-generatemipmap-formats-float') add_fbo_clear_extension(arb_texture_rg, 'GL_ARB_texture_rg', 'fbo-clear-formats') diff --git a/tests/spec/arb_texture_rg/execution/fs-shadow2d-red-01.shader_test b/tests/spec/arb_texture_rg/execution/fs-shadow2d-red-01.shader_test new file mode 100644 index 000000000..4124634e6 --- /dev/null +++ b/tests/spec/arb_texture_rg/execution/fs-shadow2d-red-01.shader_test @@ -0,0 +1,36 @@ +# [description] +# Test shadow2D(sampler2DShadow, vec3) with +# - depth texture mode = red +# - texture compare func = greater +# +# From the ARB_texture_rg spec: +# Texture Base Texture source color +# Internal Format C_s A_s +# --------------- ------------- ------ +# RED (R_t, 0, 0) 1 +# + +[require] +GLSL >= 1.10 +GL_ARB_texture_rg + +[vertex shader file] +fs-shadow2d.vert + +[fragment shader file] +fs-shadow2d.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.0, 0.0, 1.0) +relative probe rgba (0.9, 1.0) (1.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_rg/execution/fs-shadow2d-red-02.shader_test b/tests/spec/arb_texture_rg/execution/fs-shadow2d-red-02.shader_test new file mode 100644 index 000000000..e80a83452 --- /dev/null +++ b/tests/spec/arb_texture_rg/execution/fs-shadow2d-red-02.shader_test @@ -0,0 +1,36 @@ +# [description] +# Test shadow2D(sampler2DShadow, vec3) with +# - depth texture mode = red +# - texture compare func = always +# +# From the ARB_texture_rg spec: +# Texture Base Texture source color +# Internal Format C_s A_s +# --------------- ------------- ------ +# RED (R_t, 0, 0) 1 +# + +[require] +GLSL >= 1.10 +GL_ARB_texture_rg + +[vertex shader file] +fs-shadow2d.vert + +[fragment shader file] +fs-shadow2d.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.0, 0.0, 1.0) +relative probe rgba (0.9, 1.0) (1.0, 0.0, 0.0, 1.0) + +# depth comparison fail +relative probe rgba (0.1, 0.0) (1.0, 0.0, 0.0, 1.0) +relative probe rgba (1.0, 0.9) (1.0, 0.0, 0.0, 1.0) diff --git a/tests/spec/arb_texture_rg/execution/fs-shadow2d-red-03.shader_test b/tests/spec/arb_texture_rg/execution/fs-shadow2d-red-03.shader_test new file mode 100644 index 000000000..37344132b --- /dev/null +++ b/tests/spec/arb_texture_rg/execution/fs-shadow2d-red-03.shader_test @@ -0,0 +1,36 @@ +# [description] +# Test shadow2D(sampler2DShadow, vec3) with +# - depth texture mode = red +# - texture compare func = never +# +# From the ARB_texture_rg spec: +# Texture Base Texture source color +# Internal Format C_s A_s +# --------------- ------------- ------ +# RED (R_t, 0, 0) 1 +# + +[require] +GLSL >= 1.10 +GL_ARB_texture_rg + +[vertex shader file] +fs-shadow2d.vert + +[fragment shader file] +fs-shadow2d.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.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_rg/execution/fs-shadow2d.frag b/tests/spec/arb_texture_rg/execution/fs-shadow2d.frag new file mode 100644 index 000000000..765f648d2 --- /dev/null +++ b/tests/spec/arb_texture_rg/execution/fs-shadow2d.frag @@ -0,0 +1,8 @@ +#version 110 + +uniform sampler2DShadow tex; +varying vec4 tex_coord; + +void main() { + gl_FragColor = shadow2D(tex, tex_coord.xyy); +} diff --git a/tests/spec/arb_texture_rg/execution/fs-shadow2d.vert b/tests/spec/arb_texture_rg/execution/fs-shadow2d.vert new file mode 100644 index 000000000..426e7b791 --- /dev/null +++ b/tests/spec/arb_texture_rg/execution/fs-shadow2d.vert @@ -0,0 +1,8 @@ +#version 110 + +varying vec4 tex_coord; + +void main() { + gl_Position = gl_Vertex; + tex_coord = (gl_Vertex + 1.0) / 2.0; +} |