Re: [Mesa-dev] [PATCH] util/format: Generate floating point constants for clamping.

2014-11-07 Thread Roland Scheidegger
; ________ > From: Chris Forbes > Sent: 07 November 2014 15:12 > To: Jose Fonseca > Cc: mesa-dev@lists.freedesktop.org; Roland Scheidegger; Brian Paul > Subject: Re: [Mesa-dev] [PATCH] util/format: Generate floating point > constants for clamping.

Re: [Mesa-dev] [PATCH] util/format: Generate floating point constants for clamping.

2014-11-07 Thread Roland Scheidegger
Surprising indeed... Reviewed-by: Roland Scheidegger Am 07.11.2014 um 15:32 schrieb jfons...@vmware.com: > From: José Fonseca > > This commit causes the generated C code to change as > > union util_format_r32g32b32a32_sscaled pixel; > - pixel.chan.r = (int32_t)CLAMP(src[

Re: [Mesa-dev] [PATCH] util/format: Generate floating point constants for clamping.

2014-11-07 Thread Jose Fonseca
s we need to add test cases for these... Jose From: Chris Forbes Sent: 07 November 2014 15:12 To: Jose Fonseca Cc: mesa-dev@lists.freedesktop.org; Roland Scheidegger; Brian Paul Subject: Re: [Mesa-dev] [PATCH] util/format: Generate floating point constants for clamping. A possible

Re: [Mesa-dev] [PATCH] util/format: Generate floating point constants for clamping.

2014-11-07 Thread Chris Forbes
A possible wrinkle here is that 2147483647 isn't exactly representable as a float (the adjacent floats are 2147483520 and 2147483648). Is the clamp actually doing the right thing at the top end? On Sat, Nov 8, 2014 at 3:32 AM, wrote: > From: José Fonseca > > This commit causes the generated C c

[Mesa-dev] [PATCH] util/format: Generate floating point constants for clamping.

2014-11-07 Thread jfonseca
From: José Fonseca This commit causes the generated C code to change as union util_format_r32g32b32a32_sscaled pixel; - pixel.chan.r = (int32_t)CLAMP(src[0], -2147483648, 2147483647); - pixel.chan.g = (int32_t)CLAMP(src[1], -2147483648, 2147483647); - pi