summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/i965simple
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-03-12 10:39:25 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2008-03-12 10:42:49 +0000
commit98ae83d5cc73b61826823c915b5c59746c2e85c7 (patch)
treeeb1913d0641329b9b4a8618227af34f354eb71a8 /src/gallium/drivers/i965simple
parentfeb02084a88ca6e23c34fa06e963765c890f0b65 (diff)
gallium: Add TEX_FILTER_ANISO img filter
Hardware almost universally expects us to set a special filtering mode when anisotropic filtering is enabled, as opposed to varying a max-aniso values. Do this once in the state tracker & simplify the driver code.
Diffstat (limited to 'src/gallium/drivers/i965simple')
-rw-r--r--src/gallium/drivers/i965simple/brw_wm_sampler_state.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/gallium/drivers/i965simple/brw_wm_sampler_state.c b/src/gallium/drivers/i965simple/brw_wm_sampler_state.c
index ff5ba7e7c7..b9eaee56ee 100644
--- a/src/gallium/drivers/i965simple/brw_wm_sampler_state.c
+++ b/src/gallium/drivers/i965simple/brw_wm_sampler_state.c
@@ -136,6 +136,9 @@ static void brw_update_sampler_state( const struct pipe_sampler_state *pipe_samp
case PIPE_TEX_FILTER_LINEAR:
sampler->ss0.min_filter = BRW_MAPFILTER_LINEAR;
break;
+ case PIPE_TEX_FILTER_ANISO:
+ sampler->ss0.min_filter = BRW_MAPFILTER_ANISOTROPIC;
+ break;
default:
break;
}
@@ -155,26 +158,23 @@ static void brw_update_sampler_state( const struct pipe_sampler_state *pipe_samp
}
/* Set Anisotropy:
*/
- if (pipe_sampler->max_anisotropy > 1.0) {
- sampler->ss0.min_filter = BRW_MAPFILTER_ANISOTROPIC;
- sampler->ss0.mag_filter = BRW_MAPFILTER_ANISOTROPIC;
-
- if (pipe_sampler->max_anisotropy > 2.0) {
- sampler->ss3.max_aniso = MAX2((pipe_sampler->max_anisotropy - 2) / 2,
- BRW_ANISORATIO_16);
- }
+ switch (pipe_sampler->mag_img_filter) {
+ case PIPE_TEX_FILTER_NEAREST:
+ sampler->ss0.mag_filter = BRW_MAPFILTER_NEAREST;
+ break;
+ case PIPE_TEX_FILTER_LINEAR:
+ sampler->ss0.mag_filter = BRW_MAPFILTER_LINEAR;
+ break;
+ case PIPE_TEX_FILTER_ANISO:
+ sampler->ss0.mag_filter = BRW_MAPFILTER_LINEAR;
+ break;
+ default:
+ break;
}
- else {
- switch (pipe_sampler->mag_img_filter) {
- case PIPE_TEX_FILTER_NEAREST:
- sampler->ss0.mag_filter = BRW_MAPFILTER_NEAREST;
- break;
- case PIPE_TEX_FILTER_LINEAR:
- sampler->ss0.mag_filter = BRW_MAPFILTER_LINEAR;
- break;
- default:
- break;
- }
+
+ if (pipe_sampler->max_anisotropy > 2.0) {
+ sampler->ss3.max_aniso = MAX2((pipe_sampler->max_anisotropy - 2) / 2,
+ BRW_ANISORATIO_16);
}
sampler->ss1.s_wrap_mode = translate_wrap_mode(pipe_sampler->wrap_s);