1# [description] 2# Test texture(sampler2DShadow, vec3) with 3# - depth texture mode = red 4# - texture compare func = never 5 6[require] 7GLSL >= 1.30 8GL_ARB_texture_rg 9 10[vertex shader] 11#version 130 12out vec4 tex_coord; 13void main() { 14 gl_Position = gl_Vertex; 15 tex_coord = (gl_Vertex + 1.0) / 2.0; 16} 17 18[fragment shader] 19#version 130 20const float canary = 0.125; 21uniform sampler2DShadow tex; 22in vec4 tex_coord; 23void main() { 24 float s = texture(tex, tex_coord.xyy); 25 gl_FragColor = vec4(s, canary, canary, canary); 26} 27 28[test] 29uniform int tex 0 30texture shadow2D 0 (32, 32) 31texparameter 2D depth_mode red 32texparameter 2D compare_func never 33draw rect -1 -1 2 2 34 35# depth comparison pass 36relative probe rgba (0.0, 0.1) (0.0, 0.125, 0.125, 0.125); 37relative probe rgba (0.9, 1.0) (0.0, 0.125, 0.125, 0.125); 38 39# depth comparison fail 40relative probe rgba (0.1, 0.0) (0.0, 0.125, 0.125, 0.125); 41relative probe rgba (1.0, 0.9) (0.0, 0.125, 0.125, 0.125); 42