perf/pixel-rate: new pixel throughput microbenchmark
[piglit.git] / tests / spec / glsl-1.30 / execution / clipping / vs-clip-based-on-position-homogeneity.shader_test
blob7d1bae8a9331e7f85cf9d9560ba220355d54dab0
1 # [description]
3 # From the GLSL 1.30 spec, section 7.1 (Vertex Shader Special
4 # Variables):
6 #   If a linked set of shaders forming the vertex stage contains no
7 #   static write to gl_ClipVertex or gl_ClipDistance, but the
8 #   application has requested clipping against user clip planes
9 #   through the API, then the coordinate written to gl_Position is
10 #   used for comparison against the user clip planes.
12 # This test:
13 # - uses all 6 clip planes to clip a rectangle to a hexagon shape.
14 # - Multiplies all coordinates of gl_Position by 2 (including the
15 #   homogeneous coordinate) to verify that homogeneity is properly
16 #   accounted for in clipping.
18 [require]
19 GLSL >= 1.30
21 [vertex shader]
22 #version 130
23 void main(void)
25         gl_Position = 2.0 * gl_ModelViewProjectionMatrix * gl_Vertex;
28 [fragment shader]
29 #version 130
30 void main(void)
32         gl_FragColor = vec4(1, 1, 1, 1);
35 [test]
36 clear color 0.0 0.0 0.0 0.0
37 clear
38 ortho 0 1 0 1
39 clip plane 0 0 1 0 0.5
40 clip plane 1 -1 1 0 0.8
41 clip plane 2 -1 -1 0 0.8
42 clip plane 3 0 -1 0 0.5
43 clip plane 4 1 -1 0 0.8
44 clip plane 5 1 1 0 0.8
45 enable GL_CLIP_PLANE0
46 enable GL_CLIP_PLANE1
47 enable GL_CLIP_PLANE2
48 enable GL_CLIP_PLANE3
49 enable GL_CLIP_PLANE4
50 enable GL_CLIP_PLANE5
51 draw rect 0.1 0.1 0.8 0.8
53 # Test points inside each hexagon edge
54 relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0)
55 relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0)
56 relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0)
57 relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0)
58 relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0)
59 relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0)
61 # Test points outside each hexagon edge
62 relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0)
63 relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0)
64 relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0)
65 relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0)
66 relative probe rgba (0.5, 0.8) (0.0, 0.0, 0.0, 0.0)
67 relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0)