diff options
author | Keith Whitwell <[email protected]> | 2009-10-31 20:05:19 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2009-10-31 20:05:19 +0000 |
commit | e7b76000826ff4faf8bf6a834d55b50a2784c9f2 (patch) | |
tree | 271b98513650b01129e9b83e382874ba73da1586 /src/gallium/auxiliary/util | |
parent | f202a34cb1eca41cf5d12bd72016f284bc81ccf8 (diff) |
i965g: more work on compilation
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r-- | src/gallium/auxiliary/util/u_math.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h index 75b075f160d..c13bf96177d 100644 --- a/src/gallium/auxiliary/util/u_math.h +++ b/src/gallium/auxiliary/util/u_math.h @@ -539,6 +539,19 @@ do { \ #endif +static INLINE uint32_t util_unsigned_fixed(float value, unsigned frac_bits) +{ + value *= (1<<frac_bits); + return value < 0 ? 0 : value; +} + +static INLINE int32_t util_signed_fixed(float value, unsigned frac_bits) +{ + return value * (1<<frac_bits); +} + + + #ifdef __cplusplus } #endif |