summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/auxiliary/util/u_math.h3
-rw-r--r--src/mesa/main/macros.h3
2 files changed, 2 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
index 607fbecb02f..64d16cbe715 100644
--- a/src/gallium/auxiliary/util/u_math.h
+++ b/src/gallium/auxiliary/util/u_math.h
@@ -540,14 +540,13 @@ ubyte_to_float(ubyte ub)
static INLINE ubyte
float_to_ubyte(float f)
{
- const int ieee_0996 = 0x3f7f0000; /* 0.996 or so */
union fi tmp;
tmp.f = f;
if (tmp.i < 0) {
return (ubyte) 0;
}
- else if (tmp.i >= ieee_0996) {
+ else if (tmp.i >= 0x3f800000 /* 1.0f */) {
return (ubyte) 255;
}
else {
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
index ac0243871f0..ddfeee22622 100644
--- a/src/mesa/main/macros.h
+++ b/src/mesa/main/macros.h
@@ -141,7 +141,6 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256];
*** CLAMPED_FLOAT_TO_UBYTE: map float known to be in [0,1] to ubyte in [0,255]
***/
#if defined(USE_IEEE) && !defined(DEBUG)
-#define IEEE_0996 0x3f7f0000 /* 0.996 or so */
/* This function/macro is sensitive to precision. Test very carefully
* if you change it!
*/
@@ -151,7 +150,7 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256];
__tmp.f = (F); \
if (__tmp.i < 0) \
UB = (GLubyte) 0; \
- else if (__tmp.i >= IEEE_0996) \
+ else if (__tmp.i >= IEEE_ONE) \
UB = (GLubyte) 255; \
else { \
__tmp.f = __tmp.f * (255.0F/256.0F) + 32768.0F; \