From ebe12d50064370e4ddec21a1e087b24295940319 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Fri, 12 Feb 2010 00:43:38 +0100 Subject: gallium: make max_anisotropy a unsigned bitfield member saves us a dword in sampler state, hw can't do non-integer aniso degree anyway. To allow aniso 1x (which seems of dubious value but some hardware (radeons) have such a mode, and even d3d allows specifiying it) redefine anisotropic filtering as disabled only if max_anistropy is 0. --- src/gallium/drivers/r300/r300_state_inlines.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/gallium/drivers/r300/r300_state_inlines.h') diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h index 5df6815221..779ba2c7be 100644 --- a/src/gallium/drivers/r300/r300_state_inlines.h +++ b/src/gallium/drivers/r300/r300_state_inlines.h @@ -312,15 +312,15 @@ static INLINE uint32_t r300_translate_tex_filters(int min, int mag, int mip, return retval; } -static INLINE uint32_t r300_anisotropy(float max_aniso) +static INLINE uint32_t r300_anisotropy(unsigned max_aniso) { - if (max_aniso >= 16.0f) { + if (max_aniso >= 16) { return R300_TX_MAX_ANISO_16_TO_1; - } else if (max_aniso >= 8.0f) { + } else if (max_aniso >= 8) { return R300_TX_MAX_ANISO_8_TO_1; - } else if (max_aniso >= 4.0f) { + } else if (max_aniso >= 4) { return R300_TX_MAX_ANISO_4_TO_1; - } else if (max_aniso >= 2.0f) { + } else if (max_aniso >= 2) { return R300_TX_MAX_ANISO_2_TO_1; } else { return R300_TX_MAX_ANISO_1_TO_1; -- cgit v1.2.3