<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 3, 2014 at 2:15 PM, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This patch is<br>
<br>
Reviewed-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
<br>
Should it also be tagged for 10.4?<br></blockquote><div> <br></div><div>Yes, it should.<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="im HOEnZb"><br>
On 12/01/2014 03:04 AM, Iago Toral Quiroga wrote:<br>
> From: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a>><br>
><br>
> This patch fixes the return of a wrong value when x is lower than<br>
> -MAX_INT(src_bits) as the result would not be between [-1.0 1.0].<br>
><br>
> v2 by Samuel Iglesias <<a href="mailto:siglesias@igalia.com">siglesias@igalia.com</a>>:<br>
> - Modify unorm_to_float() to avoid doing the division when<br>
> x == -MAX_INT(src_bits)<br>
> ---<br>
> src/mesa/main/format_utils.c | 2 +-<br>
> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
><br>
> diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c<br>
> index 93a0cea..5dd0848 100644<br>
> --- a/src/mesa/main/format_utils.c<br>
> +++ b/src/mesa/main/format_utils.c<br>
> @@ -152,7 +152,7 @@ unorm_to_float(unsigned x, unsigned src_bits)<br>
> static inline float<br>
> snorm_to_float(int x, unsigned src_bits)<br>
> {<br>
> - if (x == -MAX_INT(src_bits))<br>
> + if (x <= -MAX_INT(src_bits))<br>
> return -1.0f;<br>
> else<br>
> return x * (1.0f / (float)MAX_INT(src_bits));<br>
><br>
<br>
</span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div></div>