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/nv50/nv50_state.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/gallium/drivers/nv50') diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c index 05d519a2f9..7d304907b6 100644 --- a/src/gallium/drivers/nv50/nv50_state.c +++ b/src/gallium/drivers/nv50/nv50_state.c @@ -202,18 +202,18 @@ nv50_sampler_state_create(struct pipe_context *pipe, break; } - if (cso->max_anisotropy >= 16.0) + if (cso->max_anisotropy >= 16) tsc[0] |= (7 << 20); else - if (cso->max_anisotropy >= 12.0) + if (cso->max_anisotropy >= 12) tsc[0] |= (6 << 20); else { - tsc[0] |= (int)(cso->max_anisotropy * 0.5f) << 20; + tsc[0] |= (cso->max_anisotropy >> 1) << 20; - if (cso->max_anisotropy >= 4.0) + if (cso->max_anisotropy >= 4) tsc[1] |= NV50TSC_1_1_UNKN_ANISO_35; else - if (cso->max_anisotropy >= 2.0) + if (cso->max_anisotropy >= 2) tsc[1] |= NV50TSC_1_1_UNKN_ANISO_15; } -- cgit v1.2.3