diff options
author | Marek Olšák <[email protected]> | 2011-01-09 12:15:15 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-01-09 22:43:41 +0100 |
commit | ac6306e9ca904ae9674bf2a15222efe4cb861bf5 (patch) | |
tree | 030fa5fdf3a3f324af41d5d83409c96fea594380 | |
parent | b3d8e1fb3bd9b6e5d7a9fc1e710a12547893c487 (diff) |
r300g: do not upload the same user buffer several times
Performance++.
-rw-r--r-- | src/gallium/drivers/r300/r300_screen_buffer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c index e3cf45479fd..b349849cf37 100644 --- a/src/gallium/drivers/r300/r300_screen_buffer.c +++ b/src/gallium/drivers/r300/r300_screen_buffer.c @@ -87,13 +87,14 @@ void r300_upload_user_buffers(struct r300_context *r300, int i, nr = r300->velems->count; unsigned count = max_index + 1 - min_index; boolean flushed; + boolean uploaded[16] = {0}; for (i = 0; i < nr; i++) { unsigned index = r300->velems->velem[i].vertex_buffer_index; struct pipe_vertex_buffer *vb = &r300->vertex_buffer[index]; struct r300_buffer *userbuf = r300_buffer(vb->buffer); - if (userbuf && userbuf->user_buffer) { + if (userbuf && userbuf->user_buffer && !uploaded[index]) { unsigned first, size; if (vb->stride) { @@ -118,6 +119,7 @@ void r300_upload_user_buffers(struct r300_context *r300, r300->upload_vb_validated = FALSE; r300->validate_buffers = TRUE; } + uploaded[index] = TRUE; } else { assert(r300->valid_vertex_buffer[index]); } |