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/i965/brw_pipe_sampler.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/gallium/drivers/i965') diff --git a/src/gallium/drivers/i965/brw_pipe_sampler.c b/src/gallium/drivers/i965/brw_pipe_sampler.c index 6aab561004..c7c0e2ae95 100644 --- a/src/gallium/drivers/i965/brw_pipe_sampler.c +++ b/src/gallium/drivers/i965/brw_pipe_sampler.c @@ -114,14 +114,12 @@ brw_create_sampler_state( struct pipe_context *pipe, /* XXX: anisotropy logic slightly changed: */ - if (template->max_anisotropy > 1.0) { + if (template->max_anisotropy > 1) { sampler->ss0.min_filter = BRW_MAPFILTER_ANISOTROPIC; sampler->ss0.mag_filter = BRW_MAPFILTER_ANISOTROPIC; - if (template->max_anisotropy > 2.0) { - sampler->ss3.max_aniso = MIN2((template->max_anisotropy - 2) / 2, - BRW_ANISORATIO_16); - } + sampler->ss3.max_aniso = MIN2((template->max_anisotropy - 2) / 2, + BRW_ANISORATIO_16); } sampler->ss1.r_wrap_mode = translate_wrap_mode(template->wrap_r); -- cgit v1.2.3