ext_gpu_shader4: add compiler tests for everything
[piglit.git] / generated_tests / templates / gen_uniform_initializer_tests / vs-initializer-set-by-API.shader_test.mako
blobca56ec54b551827a064d3b73b3b953d2242a5fa6
1 [require]
2 GLSL >= ${major}.${minor}
4 [vertex shader]
5 varying vec4 color;
7 % for type_, name, value in type_list:
8 uniform ${type_} ${name} = ${value};
9 % endfor
11 void main()
13   ## This is a little bit complex too look at, but it's actually pretty simple.
14   ## What it does is use the name and type values from type_list, but the values from api_types
15   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))}) {
16     color = vec4(0, 1, 0, 1);
17   } else {
18     color = vec4(1, 0, 0, 1);
19   }
21   gl_Position = gl_Vertex;
24 [fragment shader]
25 varying vec4 color;
27 void main()
29   gl_FragColor = color;
32 [test]
33 % for api_type, name, values in api_types:
34 uniform ${api_type} ${name} ${" ".join(values)}
35 % endfor
36 draw rect -1 -1 2 2
37 probe all rgb 0 1 0