[Piglit] [PATCH] ARB_shading_language_packing: fix exact tests

Matt Turner mattst88 at gmail.com
Tue Feb 19 10:32:59 PST 2013


On Tue, Feb 19, 2013 at 8:44 AM, Paul Berry <stereotype441 at gmail.com> wrote:
> 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.
> ---
>  generated_tests/gen_builtin_packing_tests.py | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/generated_tests/gen_builtin_packing_tests.py b/generated_tests/gen_builtin_packing_tests.py
> index 706ba1f..5eeea62 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):
> --
> 1.8.1.3
>

Crap. Sorry for not getting to this.

Reviewed-by: Matt Turner <mattst88 at gmail.com>


More information about the Piglit mailing list