From ac6306e9ca904ae9674bf2a15222efe4cb861bf5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 9 Jan 2011 12:15:15 +0100 Subject: [PATCH] r300g: do not upload the same user buffer several times Performance++. --- src/gallium/drivers/r300/r300_screen_buffer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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]); } -- 2.30.2