Mesa (master): util/format: Fix bug in float to non-float conversion in u_format_pack.py.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Tue Nov 27 17:56:24 UTC 2012


Module: Mesa
Branch: master
Commit: 65016646e355c8266136abbb991006c8829a0bc3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=65016646e355c8266136abbb991006c8829a0bc3

Author: James Benton <jbenton at vmware.com>
Date:   Thu Sep 13 16:05:37 2012 +0100

util/format: Fix bug in float to non-float conversion in u_format_pack.py.

Signed-off-by: José Fonseca <jfonseca at vmware.com>

---

 src/gallium/auxiliary/util/u_format_pack.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_format_pack.py b/src/gallium/auxiliary/util/u_format_pack.py
index 0b3a890..565d059 100644
--- a/src/gallium/auxiliary/util/u_format_pack.py
+++ b/src/gallium/auxiliary/util/u_format_pack.py
@@ -383,7 +383,7 @@ def conversion_expr(src_channel,
         if dst_channel.norm or dst_channel.type == FIXED:
             dst_one = get_one(dst_channel)
             if dst_channel.size <= 23:
-                value = '(%s * 0x%x)' % (value, dst_one)
+                value = 'util_iround(%s * 0x%x)' % (value, dst_one)
             else:
                 # bigger than single precision mantissa, use double
                 value = '(%s * (double)0x%x)' % (value, dst_one)




More information about the mesa-commit mailing list