From 3996e493693d5aa048fed1c2fd6db4027cb47df4 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 13 Mar 2010 17:38:43 +0100 Subject: r300g: add high quality anisotropic filtering for R5xx (disabled by default) Oh look, an undocumented feature. It's a nice tool for benchmarking texturing. --- src/gallium/drivers/r300/r300_state_inlines.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/gallium/drivers/r300/r300_state_inlines.h') diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h index a32924ed0a..8485d4f8f9 100644 --- a/src/gallium/drivers/r300/r300_state_inlines.h +++ b/src/gallium/drivers/r300/r300_state_inlines.h @@ -327,6 +327,18 @@ static INLINE uint32_t r300_anisotropy(unsigned max_aniso) } } +static INLINE uint32_t r500_anisotropy(unsigned max_aniso) +{ + if (!max_aniso) { + return 0; + } + max_aniso -= 1; + + // Map the range [0, 15] to [0, 63]. + return R500_TX_MAX_ANISO(MIN2((unsigned)(max_aniso*4.2001), 63)) | + R500_TX_ANISO_HIGH_QUALITY;; +} + /* Non-CSO state. (For now.) */ static INLINE uint32_t r300_translate_gb_pipes(int pipe_count) -- cgit v1.2.3