aboutsummaryrefslogtreecommitdiff
path: root/tests/spec/glsl-es-1.00/execution/1.20/clipping/vs-clip-vertex-const-reject.shader_test
blob: 0bb08ea0c156886723eaa17026d791289098146e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# From the GL 2.1 spec, section 2.17 (Clipping):
#
#   All points with eye coordinates (x_e y_e z_e w_e)^T that satisfy
#
#                          (x_e)
#     (p_1' p_2' p_3' p_4')(y_e) >= 0
#                          (z_e)
#                          (w_e)
#
#   lie in the half-space defined by the plane; points that do not
#   satisfy this condition do not lie in the half-space.
#
# This test checks that gl_ClipVertex works properly for the trivial
# case where gl_ClipVertex is a constant value not satisfying the
# above inequality.

[require]
GLSL >= 1.20

[vertex shader]
#version 120
void main(void)
{
	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

	gl_ClipVertex = vec4(-1.0, 0.0, 0.0, 0.0);
}

[fragment shader]
#version 120
void main(void)
{
	gl_FragColor = vec4(1.0);
}

[test]
clear color 0.0 0.0 0.0 0.0
clear
clip plane 0 1.0 0.0 0.0 0.0 # accept points where gl_ClipVertex.x >= 0
enable GL_CLIP_PLANE0
draw rect -1 -1 2 2
probe all rgba 0.0 0.0 0.0 0.0