summaryrefslogtreecommitdiff
authorMarek Olšák <maraeo@gmail.com>2011-01-09 11:15:15 (GMT)
committer Marek Olšák <maraeo@gmail.com>2011-01-09 21:43:41 (GMT)
commitac6306e9ca904ae9674bf2a15222efe4cb861bf5 (patch) (side-by-side diff)
tree030fa5fdf3a3f324af41d5d83409c96fea594380
parentb3d8e1fb3bd9b6e5d7a9fc1e710a12547893c487 (diff)
downloadmesa-ac6306e9ca904ae9674bf2a15222efe4cb861bf5.zip
mesa-ac6306e9ca904ae9674bf2a15222efe4cb861bf5.tar.gz
r300g: do not upload the same user buffer several times
Performance++.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/gallium/drivers/r300/r300_screen_buffer.c4
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 e3cf454..b349849 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]);
}