perf/pixel-rate: new pixel throughput microbenchmark
[piglit.git] / generated_tests / templates / gen_uniform_initializer_tests / fs-initializer-set-by-API.shader_test.mako
blob8e94633f974d3db41811897b9fc87c33f00d5aa6
1 [require]
2 GLSL >= ${major}.${minor}
4 [vertex shader]
6 void main()
8   gl_Position = gl_Vertex;
11 [fragment shader]
13 % for type_, name, value in type_list:
14 uniform ${type_} ${name} = ${value};
15 % endfor
17 void main()
19   ## This is a little bit complex too look at, but it's actually pretty simple.
20   ## What it does is use the name and type values from type_list, but the values from api_types
21   if (${' && '.join('{0} == {1}({2})'.format(n, t, ', '.join(api_types[i][2])) for i, (t, n, _) in enumerate(type_list[1:-1], start=1))}) {
22     gl_FragColor = vec4(0, 1, 0, 1);
23   } else {
24     gl_FragColor = vec4(1, 0, 0, 1);
25   }
28 [test]
29 % for api_type, name, values in api_types:
30 uniform ${api_type} ${name} ${" ".join(values)}
31 % endfor
32 draw rect -1 -1 2 2
33 probe all rgb 0 1 0