OSDN Git Service

util/format: Fix bug in float to non-float conversion in u_format_pack.py.
authorJames Benton <jbenton@vmware.com>
Thu, 13 Sep 2012 15:05:37 +0000 (16:05 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Tue, 27 Nov 2012 16:24:02 +0000 (16:24 +0000)
Signed-off-by: José Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/util/u_format_pack.py

index 0b3a890..565d059 100644 (file)
@@ -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)