diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-02-11 19:40:08 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-02-21 12:59:36 +0000 |
commit | 3630d5b69afcecc3142d2c4897835175886f4bd8 (patch) | |
tree | e2d71c52a66f6f674d022b7007a3cba82df0aeae /src/mesa/drivers/dri/i965 | |
parent | dfc6c96e5c470f6136cad26b753c024538fd09a0 (diff) |
intel: combine short memcpy using a temporary allocated buffer
Using a temporary buffer for large discontiguous uploads into the common
buffer and a single buffered upload is faster than performing the
discontiguous copies through a mapping into the GTT.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_draw_upload.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 8952e97674..62e43e83bb 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -253,8 +253,7 @@ copy_array_to_vbo_array( struct brw_context *brw, &buffer->bo, &buffer->offset); } else { const unsigned char *src = element->glarray->Ptr; - char *dst = intel_upload_map(&brw->intel, size, - &buffer->bo, &buffer->offset); + char *dst = intel_upload_map(&brw->intel, size); int i; for (i = 0; i < element->count; i++) { @@ -262,6 +261,8 @@ copy_array_to_vbo_array( struct brw_context *brw, src += element->glarray->StrideB; dst += dst_stride; } + intel_upload_unmap(&brw->intel, dst, size, + &buffer->bo, &buffer->offset); } } @@ -421,9 +422,7 @@ static void brw_prepare_vertices(struct brw_context *brw) int count = upload[0]->count, offset; char *map; - map = intel_upload_map(&brw->intel, total_size * count, - &buffer->bo, &buffer->offset); - + map = intel_upload_map(&brw->intel, total_size * count); for (i = offset = 0; i < nr_uploads; i++) { const unsigned char *src = upload[i]->glarray->Ptr; int size = upload[i]->element_size; @@ -442,6 +441,8 @@ static void brw_prepare_vertices(struct brw_context *brw) offset += size; } + intel_upload_unmap(&brw->intel, map, total_size * count, + &buffer->bo, &buffer->offset); buffer->stride = offset; j++; |