[Mesa-dev] [PATCH 01/20] mesa/format_utils: Fix a bug in one of the format helper functions

Iago Toral Quiroga itoral at igalia.com
Tue Nov 18 00:43:49 PST 2014


From: Jason Ekstrand <jason.ekstrand at intel.com>

---
 src/mesa/main/format_utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c
index 93a0cea..b6d0fbc 100644
--- a/src/mesa/main/format_utils.c
+++ b/src/mesa/main/format_utils.c
@@ -152,7 +152,7 @@ unorm_to_float(unsigned x, unsigned src_bits)
 static inline float
 snorm_to_float(int x, unsigned src_bits)
 {
-   if (x == -MAX_INT(src_bits))
+   if (x < -MAX_INT(src_bits))
       return -1.0f;
    else
       return x * (1.0f / (float)MAX_INT(src_bits));
-- 
1.9.1



More information about the mesa-dev mailing list