perf/pixel-rate: new pixel throughput microbenchmark
[piglit.git] / tests / spec / glsl-1.10 / execution / texcoord-array.shader_test
blobb6c5deaf1315bf7827ee84345744ff6083a14d79
1 [require]
2 GLSL >= 1.10
4 [vertex shader]
5 uniform int n;
6 varying vec4 gl_TexCoord[5];
7 void main()
9         // First initialise all array elements. Otherwise compiler optimisations
10         // can simply unroll the second loop ignoring n
11         for (int i = 0; i < 5; i++) {
12                 gl_TexCoord[i] = vec4(0.2, 0.2, 0.2, 0.2) * float(i);
13         }
15         for (int i = 0; i < n; i++) {
16                 gl_TexCoord[i] = vec4(0.5, 0.5, 0.5, 0.5) * float(i);
17         }
19         gl_Position = gl_Vertex;
22 [fragment shader]
23 uniform int index;
24 varying vec4 gl_TexCoord[5];
25 void main()
27         gl_FragColor = gl_TexCoord[index];
30 [test]
31 uniform int index 1
32 uniform int n 4
33 draw rect -1 -1 2 2
34 probe rgba 1 1 0.5 0.5 0.5 0.5