diff options
author | Corbin Simpson <[email protected]> | 2009-03-11 15:20:16 -0700 |
---|---|---|
committer | Corbin Simpson <[email protected]> | 2009-03-11 15:23:10 -0700 |
commit | d375a3bdda68a22972f18e9ee2ba5786c5e6757d (patch) | |
tree | 582c78ff03cd9964aeb444b2203a653839bdb55d /src/gallium/drivers/r300/r300_emit.c | |
parent | f78bd5922db220b1b5e21c92e6a0cb78189a77f3 (diff) |
r300-gallium: Don't flush textures more than necessary.
Diffstat (limited to 'src/gallium/drivers/r300/r300_emit.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_emit.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 68741e9f084..c2ad3ac6f5d 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -327,6 +327,7 @@ void r300_emit_dirty_state(struct r300_context* r300) { struct r300_screen* r300screen = r300_screen(r300->context.screen); int i; + int dirty_tex = 0; if (!(r300->dirty_state) && !(r300->dirty_hw)) { return; @@ -382,8 +383,8 @@ void r300_emit_dirty_state(struct r300_context* r300) if (r300->dirty_state & (R300_NEW_SAMPLER << i)) { r300_emit_sampler(r300, r300->sampler_states[i], i); r300->dirty_state &= ~(R300_NEW_SAMPLER << i); + dirty_tex++; } - r300_flush_textures(r300); } } @@ -397,11 +398,15 @@ void r300_emit_dirty_state(struct r300_context* r300) if (r300->dirty_state & (R300_NEW_TEXTURE << i)) { r300_emit_texture(r300, r300->textures[i], i); r300->dirty_state &= ~(R300_NEW_TEXTURE << i); + dirty_tex++; } - r300_flush_textures(r300); } } + if (dirty_tex) { + r300_flush_textures(r300); + } + if (r300->dirty_state & R300_NEW_VERTEX_FORMAT) { r300_emit_vertex_format_state(r300); r300->dirty_state &= ~R300_NEW_VERTEX_FORMAT; |