[Piglit] [PATCH] generated tests: add large uints division test for GLSL 1.3

Paul Berry stereotype441 at gmail.com
Sun Sep 4 08:22:03 PDT 2011


On 4 September 2011 02:22, <christoph.bumiller at speed.at> wrote:

> From: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
>
> At least some of these divisions should fail on implementations
> that naively use 32 bit float division (without refinement).
> ---
>  generated_tests/builtin_function.py |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/generated_tests/builtin_function.py
> b/generated_tests/builtin_function.py
> index 4eca6c7..288aa75 100644
> --- a/generated_tests/builtin_function.py
> +++ b/generated_tests/builtin_function.py
> @@ -1003,6 +1003,7 @@ def
> _make_vector_or_matrix_test_vectors(test_suite_dict):
>        ]
>     uints = [np.uint32(x) for x in [0, 6, 12, 32, 74]]
>     small_uints = [np.uint32(x) for x in [0, 1, 2, 5, 25, 31]]
> +    large_uints = [np.uint32(x) for x in [0xdeadbeef, 0xaffeaffe,
> 0xbadbad]]
>     uvecs = [
>        np.array([38, 35], dtype=np.uint32),
>        np.array([64, 9], dtype=np.uint32),
> @@ -1132,6 +1133,7 @@ def
> _make_vector_or_matrix_test_vectors(test_suite_dict):
>     f('op-sub', 2, '1.10', lambda x, y: x - y, match_simple_binop,
> [floats+vecs+mats+ints+ivecs+uints+uvecs,
> floats+vecs+mats+ints+ivecs+uints+uvecs], template = '({0} - {1})')
>     f('op-mult', 2, '1.10', _multiply, match_multiply,
> [floats+vecs+mats+ints+ivecs+uints+uvecs,
> floats+vecs+mats+ints+ivecs+uints+uvecs], template = '({0} * {1})')
>     f('op-div', 2, '1.10', _divide, match_simple_binop,
> [floats+vecs+mats+ints+ivecs+uints+uvecs,
> floats+vecs+mats+ints+ivecs+uints+uvecs], template = '({0} / {1})')
> +    f('op-div-large', 2, '1.30', _divide, match_simple_binop,
> [large_uints, large_uints+small_uints], template = '({0} / {1})')
>     f('op-mod', 2, '1.30', _divide, match_simple_binop,
> [ints+ivecs+uints+uvecs, ints+ivecs+uints+uvecs], template = '({0} / {1})')
>     f('op-uplus', 1, '1.10', lambda x: +x, None,
> [floats+vecs+mats+ints+ivecs+uints+uvecs], template = '(+ {0})')
>     f('op-neg', 1, '1.10', lambda x: -x, None,
> [floats+vecs+mats+ints+ivecs+uints+uvecs], template = '(- {0})')
> --
> 1.7.3.4
>
>
This patch looks good to me.  I checked the new tests on my propriety nVidia
Linux system, and they pass.

Reviewed-by: Paul Berry <stereotype441 at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20110904/cd6f1652/attachment.html>


More information about the Piglit mailing list