[Piglit] [PATCH 2/2] Add generated tests for AMD_shader_trinary_minmax.

Ian Romanick idr at freedesktop.org
Tue Jan 28 15:32:51 PST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/24/2014 05:21 PM, Kenneth Graunke wrote:
> On 01/24/2014 02:56 PM, Ian Romanick wrote:
>> On 01/24/2014 01:59 PM, Kenneth Graunke wrote:
>>> --- generated_tests/builtin_function.py | 26
>>> ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
>>> 
>>> diff --git a/generated_tests/builtin_function.py
>>> b/generated_tests/builtin_function.py index d2fdf41..30f5897
>>> 100644 --- a/generated_tests/builtin_function.py +++
>>> b/generated_tests/builtin_function.py @@ -444,6 +444,8 @@ def
>>> _clamp(x, minVal, maxVal): return None return min(max(x,
>>> minVal), maxVal)
>>> 
>>> +def _mid3(x, y, z): +    return max(min(x, y), max(min(x, z),
>>> min(y, z)))
>> 
>> I think this is correct, but I'd rather not have to think about
>> it... especially since I believe this is the same algorithm Mesa
>> uses, and that's what we're trying to test. :)
>> 
>> Could we do this as a sort, then pick the middle element?
>> 
>> # Inefficient, but obvious def _mid3(x, y, z): return np.sort([x,
>> y, z])[1]
> 
> I like that better - it's nice to have a different implementation
> in the test case.  I've replaced the Mesa algorithm with your
> obvious one. There's no change in behavior, so the old code was
> correct.

Okay.  With that change, the series is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)

iEYEARECAAYFAlLoPiMACgkQX1gOwKyEAw8HsgCfbRI23qlouFdKWp6QWPZJdc59
hY8AnAmtMl01ItVYaBeBS3SVOdPkTSkb
=ljrH
-----END PGP SIGNATURE-----


More information about the Piglit mailing list