diff options
author | marha <marha@users.sourceforge.net> | 2014-09-08 23:30:36 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-09-08 23:30:36 +0200 |
commit | e16399e57caac9e859a7d28921c73ef9839b571e (patch) | |
tree | b86ed43f749ebfe0bb3842fcd76a34e386011fcc /mesalib/src/mesa/main/macros.h | |
parent | 166caebfaa2b217332a345ffb02c5b9e52f65a3d (diff) | |
parent | cb346e228aeb500cd61ec86644c034c238332d3b (diff) | |
download | vcxsrv-e16399e57caac9e859a7d28921c73ef9839b571e.tar.gz vcxsrv-e16399e57caac9e859a7d28921c73ef9839b571e.tar.bz2 vcxsrv-e16399e57caac9e859a7d28921c73ef9839b571e.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/main/macros.h')
-rw-r--r-- | mesalib/src/mesa/main/macros.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mesalib/src/mesa/main/macros.h b/mesalib/src/mesa/main/macros.h index 947efac1f..e1880f59b 100644 --- a/mesalib/src/mesa/main/macros.h +++ b/mesalib/src/mesa/main/macros.h @@ -184,12 +184,19 @@ static inline GLfloat UINT_AS_FLT(GLuint u) return tmp.f; } +static inline unsigned FLT_AS_UINT(float f) +{ + fi_type tmp; + tmp.f = f; + return tmp.u; +} + /** * Convert a floating point value to an unsigned fixed point value. * * \param frac_bits The number of bits used to store the fractional part. */ -static INLINE uint32_t +static inline uint32_t U_FIXED(float value, uint32_t frac_bits) { value *= (1 << frac_bits); @@ -201,7 +208,7 @@ U_FIXED(float value, uint32_t frac_bits) * * \param frac_bits The number of bits used to store the fractional part. */ -static INLINE int32_t +static inline int32_t S_FIXED(float value, uint32_t frac_bits) { return (int32_t) (value * (1 << frac_bits)); |