4 % for extension in extensions:
9 % if execution_stage == 'vs':
10 % for extension in extensions:
11 #extension ${extension}: enable
14 uniform ${input_type} given;
15 uniform ${output_type} expected;
24 % if execution_stage == 'vs':
25 color = vec4(0.0, 1.0, 0.0, 1.0);
27 if (expected.x != ${func}(${in_modifier_func}(given.x)))
29 if (expected.xy != ${func}(${in_modifier_func}(given.xy)))
31 if (expected.xyz != ${func}(${in_modifier_func}(given.xyz)))
33 if (expected != ${func}(${in_modifier_func}(given)))
39 % if execution_stage == 'fs':
40 % for extension in extensions:
41 #extension ${extension}: enable
44 uniform ${input_type} given;
45 uniform ${output_type} expected;
53 % if execution_stage == 'fs':
54 frag_color = vec4(0.0, 1.0, 0.0, 1.0);
56 if (expected.x != ${func}(${in_modifier_func}(given.x)))
58 if (expected.xy != ${func}(${in_modifier_func}(given.xy)))
60 if (expected.xyz != ${func}(${in_modifier_func}(given.xyz)))
62 if (expected != ${func}(${in_modifier_func}(given)))
77 % for name, data in sorted(six.iteritems(test_data)):
78 % if name == '-0.0' and in_modifier_func != '' and func == 'intBitsToFloat':
79 # ${in_modifier_func}(INT_MIN) doesn't fit in a 32-bit int. Cannot test.
82 uniform ${input_type} given ${' '.join(str(in_func(d)) for d in data)}
83 uniform ${output_type} expected ${' '.join(str(out_func(modifier_func(in_func(d)))) for d in data)}
84 draw arrays GL_TRIANGLE_FAN 0 4
85 probe all rgba 0.0 1.0 0.0 1.0