perf/pixel-rate: new pixel throughput microbenchmark
[piglit.git] / tests / spec / glsl-1.30 / execution / clipping / fs-clip-distance-sizeable-to-max.shader_test
blobbd525fd7f859a1f9e132c45b3e86d7e54c536b59
1 # From the GLSL 1.30 spec section 7.2 (Fragment Shader Special
2 # Variables):
4 #   The built-in input variable gl_ClipDistance array contains
5 #   linearly interpolated values for the vertex values written by the
6 #   vertex shader to the gl_ClipDistance vertex output variable. This
7 #   array must be sized in the fragment shader either implicitly or
8 #   explicitly to be the same size as it was sized in the vertex
9 #   shader.
11 # This test checks that the size of gl_ClipDistance can be set to
12 # gl_MaxClipDistances without error, and that this actually causes the
13 # size of the array to be set properly.
15 [require]
16 GLSL >= 1.30
18 [vertex shader]
19 #version 130
20 out float gl_ClipDistance[gl_MaxClipDistances];
22 void main()
24   gl_Position = gl_Vertex;
27 [fragment shader]
28 #version 130
29 in float gl_ClipDistance[gl_MaxClipDistances];
31 void main()
33   gl_FragColor = (gl_ClipDistance.length() == gl_MaxClipDistances)
34     ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
37 [test]
38 draw rect -1 -1 2 2
39 probe all rgba 0.0 1.0 0.0 1.0