summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i965
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2010-02-12 00:43:38 +0100
committerRoland Scheidegger <[email protected]>2010-02-12 00:43:38 +0100
commitebe12d50064370e4ddec21a1e087b24295940319 (patch)
treed686eb379bbb2b6bae32888be1215b74f32b692e /src/gallium/drivers/i965
parent16d520f6d69edb112887d8db1e014a521a34f532 (diff)
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.
Diffstat (limited to 'src/gallium/drivers/i965')
-rw-r--r--src/gallium/drivers/i965/brw_pipe_sampler.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gallium/drivers/i965/brw_pipe_sampler.c b/src/gallium/drivers/i965/brw_pipe_sampler.c
index 6aab5610043..c7c0e2ae95e 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);