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/nv40/nv40_state.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/gallium/drivers/nv40') diff --git a/src/gallium/drivers/nv40/nv40_state.c b/src/gallium/drivers/nv40/nv40_state.c index d068be6243a..2073bf07353 100644 --- a/src/gallium/drivers/nv40/nv40_state.c +++ b/src/gallium/drivers/nv40/nv40_state.c @@ -132,26 +132,26 @@ nv40_sampler_state_create(struct pipe_context *pipe, (wrap_mode(cso->wrap_r) << NV40TCL_TEX_WRAP_R_SHIFT)); ps->en = 0; - if (cso->max_anisotropy >= 2.0) { + if (cso->max_anisotropy >= 2) { /* no idea, binary driver sets it, works without it.. meh.. */ ps->wrap |= (1 << 5); - if (cso->max_anisotropy >= 16.0) { + if (cso->max_anisotropy >= 16) { ps->en |= NV40TCL_TEX_ENABLE_ANISO_16X; } else - if (cso->max_anisotropy >= 12.0) { + if (cso->max_anisotropy >= 12) { ps->en |= NV40TCL_TEX_ENABLE_ANISO_12X; } else - if (cso->max_anisotropy >= 10.0) { + if (cso->max_anisotropy >= 10) { ps->en |= NV40TCL_TEX_ENABLE_ANISO_10X; } else - if (cso->max_anisotropy >= 8.0) { + if (cso->max_anisotropy >= 8) { ps->en |= NV40TCL_TEX_ENABLE_ANISO_8X; } else - if (cso->max_anisotropy >= 6.0) { + if (cso->max_anisotropy >= 6) { ps->en |= NV40TCL_TEX_ENABLE_ANISO_6X; } else - if (cso->max_anisotropy >= 4.0) { + if (cso->max_anisotropy >= 4) { ps->en |= NV40TCL_TEX_ENABLE_ANISO_4X; } else { ps->en |= NV40TCL_TEX_ENABLE_ANISO_2X; -- cgit v1.2.3