diff options
| author | Matt Turner <mattst88@gmail.com> | 2015-07-12 17:18:25 -0700 |
|---|---|---|
| committer | Matt Turner <mattst88@gmail.com> | 2015-08-06 15:32:15 -0700 |
| commit | dd6c7a2add9bf0cd53395bf3a069da957e44fa4c (patch) | |
| tree | 2fdc723d88fb0a27d2073901a69b0cedb798108d | |
| parent | 9514eae033e49561b17b1472e04846f8aa2b1045 (diff) | |
mesa: Optimize (UN)CLAMPED_FLOAT_TO_UBYTE macros.
| -rw-r--r-- | src/mesa/main/macros.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index 54df50c9cfe..f9546988041 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -156,14 +156,14 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256]; else if (__tmp.i >= IEEE_ONE) \ UB = (GLubyte) 255; \ else { \ - __tmp.f = __tmp.f * (255.0F/256.0F) + 32768.0F; \ + __tmp.f = __tmp.f + (1 << 23); \ UB = (GLubyte) __tmp.i; \ } \ } while (0) #define CLAMPED_FLOAT_TO_UBYTE(UB, FLT) \ do { \ fi_type __tmp; \ - __tmp.f = (FLT) * (255.0F/256.0F) + 32768.0F; \ + __tmp.f = (FLT) + (1 << 23); \ UB = (GLubyte) __tmp.i; \ } while (0) #else |
