ext_gpu_shader4: add compiler tests for everything
[piglit.git] / generated_tests / templates / gen_builtin_packing_tests / vs_pack.shader_test.mako
blob5f37d7eafc8404874b5d881a8b5b8fb48e7e3f06
1 <%! from six.moves import range %>
2 ## Test execution of pack2x16 functions in the vertex shader.
3 [require]
4 ${func.requirements}
6 [vertex shader]
7 #ifndef GL_ES
8 #extension GL_ARB_shading_language_packing : require
9 #endif
11 const vec4 red = vec4(1, 0, 0, 1);
12 const vec4 green = vec4(0, 1, 0, 1);
14 uniform ${func.vector_type} func_input;
16 % for j in range(func.num_valid_outputs):
17 uniform ${func.result_precision} uint expect${j};
18 % endfor
20 in vec4 vertex;
21 out vec4 vert_color;
23 void main()
25     gl_Position = vertex;
26     ${func.result_precision} uint actual = ${func.name}(func_input);
28     if (false
29         % for j in range(func.num_valid_outputs):
30         || actual == expect${j}
31         % endfor
32        ) {
33        vert_color = green;
34     } else {
35         vert_color = red;
36     }
39 [fragment shader]
40 #ifdef GL_ES
41 precision highp float;
42 #endif
44 in vec4 vert_color;
45 out vec4 frag_color;
47 void main()
49     frag_color = vert_color;
52 [vertex data]
53 vertex/float/2
54 -1.0 -1.0
55  1.0 -1.0
56  1.0  1.0
57 -1.0  1.0
59 [test]
60 % for io in func.inout_seq:
61 uniform ${func.vector_type} func_input ${" ".join(io.input)}
62 % for j in range(func.num_valid_outputs):
63 uniform uint expect${j} ${io.valid_outputs[j]}
64 % endfor
65 draw arrays GL_TRIANGLE_FAN 0 4
66 probe all rgba 0.0 1.0 0.0 1.0
68 % endfor