X-Git-Url: https://git.libre-soc.org/?p=mesa.git;a=blobdiff_plain;f=src%2Futil%2Fformat_r11g11b10f.h;h=5fe2e510d223cc22bc61600c8e1fc132d21a3d62;hp=218822b16e6bd05834c99af37e4b262798e11105;hb=ffcf8e1049f300b3a890bdd1ce778c8436aee049;hpb=c7eb9a75653c1df54e6c36873c8c4ddd142b98d6 diff --git a/src/util/format_r11g11b10f.h b/src/util/format_r11g11b10f.h index 218822b16e6..5fe2e510d22 100644 --- a/src/util/format_r11g11b10f.h +++ b/src/util/format_r11g11b10f.h @@ -27,6 +27,8 @@ * below. */ +#include + #define UF11(e, m) ((e << 6) | (m)) #define UF11_EXPONENT_BIAS 15 #define UF11_EXPONENT_BITS 0x1F @@ -45,7 +47,7 @@ #define F32_INFINITY 0x7f800000 -static inline unsigned f32_to_uf11(float val) +static inline uint32_t f32_to_uf11(float val) { union { float f; @@ -131,7 +133,7 @@ static inline float uf11_to_f32(uint16_t val) return f32.f; } -static inline unsigned f32_to_uf10(float val) +static inline uint32_t f32_to_uf10(float val) { union { float f; @@ -217,14 +219,14 @@ static inline float uf10_to_f32(uint16_t val) return f32.f; } -static inline unsigned float3_to_r11g11b10f(const float rgb[3]) +static inline uint32_t float3_to_r11g11b10f(const float rgb[3]) { return ( f32_to_uf11(rgb[0]) & 0x7ff) | ((f32_to_uf11(rgb[1]) & 0x7ff) << 11) | ((f32_to_uf10(rgb[2]) & 0x3ff) << 22); } -static inline void r11g11b10f_to_float3(unsigned rgb, float retval[3]) +static inline void r11g11b10f_to_float3(uint32_t rgb, float retval[3]) { retval[0] = uf11_to_f32( rgb & 0x7ff); retval[1] = uf11_to_f32((rgb >> 11) & 0x7ff);