perf/pixel-rate: new pixel throughput microbenchmark
[piglit.git] / tests / spec / arb_cull_distance / fs-cull-distance-sizeable-to-max.shader_test
blobcf3451aae61e8d057a6f464d593e53e940adef93
1 # From the ARB_cull_distance spec:
3 #    The gl_CullDistance array is predeclared as unsized and must be sized by
4 #    the shader either redeclaring it with a size or indexing it only with
5 #    integral constant expressions. The size determines the number and set of
6 #    enabled cull distances and can be at most gl_MaxCullDistances.
8 # This test checks that the size of gl_CullDistance can be set to
9 # gl_MaxCullDistances without error, and that this actually causes the
10 # size of the array to be set properly.
12 [require]
13 GLSL >= 1.30
14 GL_ARB_cull_distance
16 [vertex shader]
17 #version 130
18 #extension GL_ARB_cull_distance: enable
19 out float gl_CullDistance[gl_MaxCullDistances];
21 void main()
23   gl_Position = gl_Vertex;
26 [fragment shader]
27 #version 130
28 #extension GL_ARB_cull_distance: enable
29 in float gl_CullDistance[gl_MaxCullDistances];
31 void main()
33   gl_FragColor = (gl_CullDistance.length() == gl_MaxCullDistances)
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