summaryrefslogtreecommitdiff
path: root/generated_tests
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2013-02-19 08:15:42 -0800
committerPaul Berry <stereotype441@gmail.com>2013-02-20 13:38:09 -0800
commitc4993595d0c1445ffdea5c601468aa8040e4e141 (patch)
tree444ba5593bd87bcf8b2823ede29ce9a8907a5167 /generated_tests
parent6bb8c301fb0669da7887a574fd0c2ecb34d497cf (diff)
ARB_shading_language_packing: fix exact tests
Commit 78435fe (ARB_shading_language_packing: Allow some imprecision in unpackUnorm4x8) inadvertently introduced a regression to the unpackHalf2x16 tests. In those tests, the "exact" uniform wasn't being initialized, resulting in the tests being run in inexact fashion. Surprisingly, this actually produced a failure, because inexact testing uses "distance(actual, expect) < 0.00001" as the pass/fail criterion, and this doesn't work when actual == expect == Infinity (because distance(Inf, Inf) == NaN). We always intended to test unpackHalf2x16 in exact fashion anyhow, so the fix is to go ahead and initialize the "exact" uniform to 1 for this case. Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'generated_tests')
-rw-r--r--generated_tests/gen_builtin_packing_tests.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/generated_tests/gen_builtin_packing_tests.py b/generated_tests/gen_builtin_packing_tests.py
index 706ba1f31..5eeea62a1 100644
--- a/generated_tests/gen_builtin_packing_tests.py
+++ b/generated_tests/gen_builtin_packing_tests.py
@@ -277,7 +277,9 @@ vs_unpack_template = Template(dedent("""\
[test]
% for io in func.inout_seq:
uniform uint func_input ${io.input}
- % if not func.exact:
+ % if func.exact:
+ uniform int exact 1
+ % else:
uniform int exact ${int(int(io.input[:-1]) in (0x0, 0xffffffff, 0x80808080, 0x81818181))}
% endif
% for j in range(func.num_valid_outputs):
@@ -410,7 +412,9 @@ fs_unpack_template = Template(dedent("""\
[test]
% for io in func.inout_seq:
uniform uint func_input ${io.input}
- % if not func.exact:
+ % if func.exact:
+ uniform int exact 1
+ % else:
uniform int exact ${int(int(io.input[:-1]) in (0x0, 0xffffffff, 0x80808080, 0x81818181))}
% endif
% for i in range(func.num_valid_outputs):