summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_state.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-03-13 17:38:43 +0100
committerMarek Olšák <[email protected]>2010-03-13 18:23:27 +0100
commit3996e493693d5aa048fed1c2fd6db4027cb47df4 (patch)
tree41ded656e7af8bb40b4772b696015c6e63513535 /src/gallium/drivers/r300/r300_state.c
parentd5749fb6fc9b7bb3c8a8b1632eee6db28678b3ba (diff)
r300g: add high quality anisotropic filtering for R5xx (disabled by default)
Oh look, an undocumented feature. It's a nice tool for benchmarking texturing.
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r--src/gallium/drivers/r300/r300_state.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index bcd75a4225e..3098145dfbe 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -849,6 +849,7 @@ static void*
{
struct r300_context* r300 = r300_context(pipe);
struct r300_sampler_state* sampler = CALLOC_STRUCT(r300_sampler_state);
+ boolean is_r500 = r300_screen(pipe->screen)->caps->is_r500;
int lod_bias;
union util_color uc;
@@ -875,6 +876,14 @@ static void*
sampler->filter1 |= lod_bias << R300_LOD_BIAS_SHIFT;
+ /* This is very high quality anisotropic filtering for R5xx.
+ * It's good for benchmarking the performance of texturing but
+ * in practice we don't want to slow down the driver because it's
+ * a pretty good performance killer. Feel free to play with it. */
+ if (DBG_ON(r300, DBG_ANISOHQ) && is_r500) {
+ sampler->filter1 |= r500_anisotropy(state->max_anisotropy);
+ }
+
util_pack_color(state->border_color, PIPE_FORMAT_B8G8R8A8_UNORM, &uc);
sampler->border_color = uc.ui;