summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_state_inlines.h
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2010-02-12 00:43:38 +0100
committerRoland Scheidegger <sroland@vmware.com>2010-02-12 00:43:38 +0100
commitebe12d50064370e4ddec21a1e087b24295940319 (patch)
treed686eb379bbb2b6bae32888be1215b74f32b692e /src/gallium/drivers/r300/r300_state_inlines.h
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/r300/r300_state_inlines.h')
-rw-r--r--src/gallium/drivers/r300/r300_state_inlines.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h
index 5df6815221..779ba2c7be 100644
--- a/src/gallium/drivers/r300/r300_state_inlines.h
+++ b/src/gallium/drivers/r300/r300_state_inlines.h
@@ -312,15 +312,15 @@ static INLINE uint32_t r300_translate_tex_filters(int min, int mag, int mip,
return retval;
}
-static INLINE uint32_t r300_anisotropy(float max_aniso)
+static INLINE uint32_t r300_anisotropy(unsigned max_aniso)
{
- if (max_aniso >= 16.0f) {
+ if (max_aniso >= 16) {
return R300_TX_MAX_ANISO_16_TO_1;
- } else if (max_aniso >= 8.0f) {
+ } else if (max_aniso >= 8) {
return R300_TX_MAX_ANISO_8_TO_1;
- } else if (max_aniso >= 4.0f) {
+ } else if (max_aniso >= 4) {
return R300_TX_MAX_ANISO_4_TO_1;
- } else if (max_aniso >= 2.0f) {
+ } else if (max_aniso >= 2) {
return R300_TX_MAX_ANISO_2_TO_1;
} else {
return R300_TX_MAX_ANISO_1_TO_1;