arb_program_interface_query: set vs_input2[1][0] as valid name
[piglit.git] / generated_tests / templates / gen_builtin_packing_tests / fs_unpack.shader_test.mako
blob8f37dc03f6cfa88ce66d6feee1d9fd5014dab8cd
1 ## Test execution of unpack2x16 functions in the fragment shader.
2 [require]
3 ${func.requirements}
4 SIZE 10 10
6 [vertex shader]
7 in vec4 vertex;
9 void main()
11     gl_Position = vertex;
14 [fragment shader]
15 #ifndef GL_ES
16 #extension GL_ARB_shading_language_packing : require
17 #else
18 precision highp float;
19 #endif
21 const vec4 red = vec4(1, 0, 0, 1);
22 const vec4 green = vec4(0, 1, 0, 1);
24 uniform highp uint func_input;
26 uniform bool exact;
28 % for i in range(func.num_valid_outputs):
29 uniform ${func.result_precision} ${func.vector_type} expect${i};
30 % endfor
32 out vec4 frag_color;
34 void main()
36     ${func.result_precision} ${func.vector_type} actual = ${func.name}(func_input);
38     if (false
39         % for i in range(func.num_valid_outputs):
40         || (exact ? actual == expect${i}
41                   : distance(actual, expect${i}) < 0.00001)
42         % endfor
43        ) {
44         frag_color = green;
45     } else {
46         frag_color = red;
47     }
50 [vertex data]
51 vertex/float/2
52 -1.0 -1.0
53  1.0 -1.0
54  1.0  1.0
55 -1.0  1.0
57 [test]
58 % for io in func.inout_seq:
59 uniform uint func_input ${io.input}
60 % if func.exact:
61 uniform int exact 1
62 % else:
63 uniform int exact ${int(int(io.input[:-1]) in (0x0, 0xffffffff, 0x80808080,
64                                                0x81818181))}
65 % endif
66 % for i in range(func.num_valid_outputs):
67 uniform ${func.vector_type} expect${i} ${" ".join(io.valid_outputs[i])}
68 % endfor
69 draw arrays GL_TRIANGLE_FAN 0 4
70 probe all rgba 0.0 1.0 0.0 1.0
72 % endfor