From: Marek Olšák Date: Sun, 9 Jan 2011 11:15:15 +0000 (+0100) Subject: r300g: do not upload the same user buffer several times X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ac6306e9ca904ae9674bf2a15222efe4cb861bf5;p=mesa.git r300g: do not upload the same user buffer several times Performance++. --- 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]); }