Mesa (master): u_format: Fix bitshifting for unpacking from 10F.
Eric Anholt
anholt at kemper.freedesktop.org
Fri Oct 28 19:10:34 UTC 2011
Module: Mesa
Branch: master
Commit: 3d7477206d7a345eb53df5c1288a5b34e83bc2d8
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3d7477206d7a345eb53df5c1288a5b34e83bc2d8
Author: Eric Anholt <eric at anholt.net>
Date: Tue Oct 25 16:53:00 2011 -0700
u_format: Fix bitshifting for unpacking from 10F.
This code was copy and pasted from the 11F unpacking, but not updated
for actually being 10 bits instead of 11.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41206
Reviewed-by: Marek Ol ák <maraeo at gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/gallium/auxiliary/util/u_format_r11g11b10f.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_format_r11g11b10f.h b/src/gallium/auxiliary/util/u_format_r11g11b10f.h
index b1946f8..5c05b79 100644
--- a/src/gallium/auxiliary/util/u_format_r11g11b10f.h
+++ b/src/gallium/auxiliary/util/u_format_r11g11b10f.h
@@ -153,8 +153,8 @@ static INLINE float uf10_to_f32(uint16_t val)
uint32_t ui;
} f32;
- int exponent = (val & 0x07c0) >> UF10_EXPONENT_SHIFT;
- int mantissa = (val & 0x003f);
+ int exponent = (val & 0x03e0) >> UF10_EXPONENT_SHIFT;
+ int mantissa = (val & 0x001f);
f32.f = 0.0;
More information about the mesa-commit
mailing list