diff options
author | Marek Olšák <[email protected]> | 2010-04-15 09:52:26 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-04-15 10:15:34 +0200 |
commit | 948ce60a267e8d4ef025816eeb7110d3e363c41a (patch) | |
tree | 15c968b44c6cebbf71e938b6b198dc911d197a1c /src/gallium | |
parent | 6bd6f4cd4984e7afe7969e5dfe9796079c07b6bc (diff) |
r300g: do not use NPOT fallback for CLAMP wrap modes
These work just fine.
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/r300/r300_fs.c | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c index ecba8b0d804..5652faf855f 100644 --- a/src/gallium/drivers/r300/r300_fs.c +++ b/src/gallium/drivers/r300/r300_fs.c @@ -154,33 +154,39 @@ static void get_external_state( state->unit[i].texture_compare_func = s->state.compare_func; } + state->unit[i].non_normalized_coords = !s->state.normalized_coords; + if (texstate->sampler_views[i]) { struct r300_texture *t; t = (struct r300_texture*)texstate->sampler_views[i]->base.texture; - state->unit[i].fake_npot = t->uses_pitch; - } - state->unit[i].non_normalized_coords = !s->state.normalized_coords; - - /* XXX this should probably take into account STR, not just S. */ - switch (s->state.wrap_s) { - case PIPE_TEX_WRAP_REPEAT: - state->unit[i].wrap_mode = RC_WRAP_REPEAT; - break; - case PIPE_TEX_WRAP_CLAMP: - case PIPE_TEX_WRAP_CLAMP_TO_EDGE: - case PIPE_TEX_WRAP_CLAMP_TO_BORDER: - state->unit[i].wrap_mode = RC_WRAP_CLAMP; - break; - case PIPE_TEX_WRAP_MIRROR_REPEAT: - case PIPE_TEX_WRAP_MIRROR_CLAMP: - case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE: - case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER: - state->unit[i].wrap_mode = RC_WRAP_MIRROR; - break; - default: - state->unit[i].wrap_mode = RC_WRAP_NONE; - break; + /* XXX this should probably take into account STR, not just S. */ + if (t->uses_pitch) { + switch (s->state.wrap_s) { + case PIPE_TEX_WRAP_REPEAT: + state->unit[i].wrap_mode = RC_WRAP_REPEAT; + state->unit[i].fake_npot = TRUE; + break; + + case PIPE_TEX_WRAP_CLAMP: + case PIPE_TEX_WRAP_CLAMP_TO_EDGE: + case PIPE_TEX_WRAP_CLAMP_TO_BORDER: + state->unit[i].wrap_mode = RC_WRAP_CLAMP; + break; + + case PIPE_TEX_WRAP_MIRROR_REPEAT: + case PIPE_TEX_WRAP_MIRROR_CLAMP: + case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE: + case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER: + state->unit[i].wrap_mode = RC_WRAP_MIRROR; + state->unit[i].fake_npot = TRUE; + break; + + default: + state->unit[i].wrap_mode = RC_WRAP_NONE; + break; + } + } } } } |