summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_state_inlines.h
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-01-06 10:35:47 +0000
committerKeith Whitwell <keithw@vmware.com>2010-01-06 10:35:47 +0000
commitf02347374819a9b145a3e26c625709aea0c6f61b (patch)
treeb10aeef5dad623aa3c2afec070e601b68e2199ce /src/gallium/drivers/r300/r300_state_inlines.h
parenta6975507adb12e2147ede43224b2e21b4e7fc3ae (diff)
gallium: remove PIPE_TEX_FILTER_ANISO
This patch removes PIPE_TEX_FILTER_ANISO. Anisotropic filtering is enabled if and only if max_anisotropy > 1.0. Values between 0.0 and 1.0, inclusive, of max_anisotropy are to be considered equivalent, and meaning to turn off anisotropic filtering. This approach has the small drawback of eliminating the possibility of enabling anisotropic filter on either minification or magnification separately, which Radeon hardware seems to support, is currently support by Gallium but not exposed to OpenGL. If this is actually useful it could be handled by splitting max_anisotropy in two values and adding an appropriate OpenGL extension. NOTE: some fiddling & reformatting by keithw to get this patch to apply. Hopefully nothing broken in the process.
Diffstat (limited to 'src/gallium/drivers/r300/r300_state_inlines.h')
-rw-r--r--src/gallium/drivers/r300/r300_state_inlines.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h
index dbe42edd91..02adee2701 100644
--- a/src/gallium/drivers/r300/r300_state_inlines.h
+++ b/src/gallium/drivers/r300/r300_state_inlines.h
@@ -260,35 +260,33 @@ static INLINE uint32_t r300_translate_wrap(int wrap)
static INLINE uint32_t r300_translate_tex_filters(int min, int mag, int mip)
{
uint32_t retval = 0;
- switch (min) {
+ if (is_anisotropic)
+ retval |= R300_TX_MIN_FILTER_ANISO | R300_TX_MAG_FILTER_ANISO;
+ else {
+ switch (min) {
case PIPE_TEX_FILTER_NEAREST:
retval |= R300_TX_MIN_FILTER_NEAREST;
break;
case PIPE_TEX_FILTER_LINEAR:
retval |= R300_TX_MIN_FILTER_LINEAR;
break;
- case PIPE_TEX_FILTER_ANISO:
- retval |= R300_TX_MIN_FILTER_ANISO;
- break;
default:
debug_printf("r300: Unknown texture filter %d\n", min);
assert(0);
break;
- }
- switch (mag) {
+ }
+ switch (mag) {
case PIPE_TEX_FILTER_NEAREST:
retval |= R300_TX_MAG_FILTER_NEAREST;
break;
case PIPE_TEX_FILTER_LINEAR:
retval |= R300_TX_MAG_FILTER_LINEAR;
break;
- case PIPE_TEX_FILTER_ANISO:
- retval |= R300_TX_MAG_FILTER_ANISO;
- break;
default:
debug_printf("r300: Unknown texture filter %d\n", mag);
assert(0);
break;
+ }
}
switch (mip) {
case PIPE_TEX_MIPFILTER_NONE: