diff options
author | Eric Anholt <[email protected]> | 2009-10-29 11:52:28 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2009-10-29 12:06:04 -0700 |
commit | f8f40b53a6a4551630e25bfd7f6e12334bb0f3f8 (patch) | |
tree | 439a6e62c435a4b9594a20ca6d34009f5ffe9895 /src/mesa/drivers/dri/intel/intel_context.h | |
parent | 374447244165b3b79892cb6840a76ea4c2f21f1e (diff) |
i915: Implement min/max LOD clamping with the hardware.
This gets us expected behavior for clamping between mipmap levels, and
avoids relayout of textures for doing clamping.
Fixes piglit lodclamp-between.
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_context.h')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_context.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 2778cc0136d..356fa4d1e58 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -353,6 +353,19 @@ extern char *__progname; #define ALIGN(value, alignment) ((value + alignment - 1) & ~(alignment - 1)) #define IS_POWER_OF_TWO(val) (((val) & (val - 1)) == 0) +static inline uint32_t +U_FIXED(float value, uint32_t frac_bits) +{ + value *= (1 << frac_bits); + return value < 0 ? 0 : value; +} + +static inline uint32_t +S_FIXED(float value, uint32_t frac_bits) +{ + return value * (1 << frac_bits); +} + #define INTEL_FIREVERTICES(intel) \ do { \ if ((intel)->prim.flush) \ |