Mesa (master): llvmpipe: fix unswizzle of packed float types.

Dave Airlie airlied at kemper.freedesktop.org
Mon Nov 14 09:36:23 UTC 2011


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Nov 14 09:34:07 2011 +0000

llvmpipe: fix unswizzle of packed float types.

I messed up adding the ubyte->float conversion.

This fixes getteximage-formats

https://bugs.freedesktop.org/show_bug.cgi?id=42837

Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/gallium/drivers/llvmpipe/lp_tile_soa.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_tile_soa.py b/src/gallium/drivers/llvmpipe/lp_tile_soa.py
index bbceb9f..d548ad8 100644
--- a/src/gallium/drivers/llvmpipe/lp_tile_soa.py
+++ b/src/gallium/drivers/llvmpipe/lp_tile_soa.py
@@ -256,12 +256,12 @@ def emit_tile_pixel_unswizzle_code(format, src_channel):
     if format.name == 'PIPE_FORMAT_R11G11B10_FLOAT':
         print '         float tmp[3];'
         for i in range(3):
-            print '         tmp[%d] = (float)TILE_PIXEL(src, x, y, %u);' % (i, inv_swizzle[i])
+            print '         tmp[%d] = ubyte_to_float(TILE_PIXEL(src, x, y, %u));' % (i, inv_swizzle[i])
         print '         *dst_pixel++ = float3_to_r11g11b10f(tmp);'
     elif format.name == 'PIPE_FORMAT_R9G9B9E5_FLOAT':
         print '         float tmp[3];'
         for i in range(3):
-            print '         tmp[%d] = (float)TILE_PIXEL(src, x, y, %u);' % (i, inv_swizzle[i])
+            print '         tmp[%d] = ubyte_to_float(TILE_PIXEL(src, x, y, %u));' % (i, inv_swizzle[i])
         print '         *dst_pixel++ = float3_to_rgb9e5(tmp);'
     elif format.layout == PLAIN:
         if not format.is_array():




More information about the mesa-commit mailing list