summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-02-18 12:30:37 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-02-21 12:59:36 +0000
commita07e4811794051dc65187d17b7f85e340e61854e (patch)
treeb743fcc67cfb1cb0834b4f59f5d8440436ec62a7 /src/mesa/drivers/dri/i965
parentd9e591391d490c83ce301aa568a2e0afe4cc3c0a (diff)
intel: Use specified alignment for writes into the upload buffer
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.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index daae136a14..d4841226bf 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -249,11 +249,11 @@ copy_array_to_vbo_array( struct brw_context *brw,
buffer->stride = dst_stride;
if (dst_stride == element->glarray->StrideB) {
- intel_upload_data(&brw->intel, element->glarray->Ptr, size,
+ intel_upload_data(&brw->intel, element->glarray->Ptr, size, dst_stride,
&buffer->bo, &buffer->offset);
} else {
const unsigned char *src = element->glarray->Ptr;
- char *dst = intel_upload_map(&brw->intel, size);
+ char *dst = intel_upload_map(&brw->intel, size, dst_stride);
int i;
for (i = 0; i < element->count; i++) {
@@ -261,7 +261,7 @@ copy_array_to_vbo_array( struct brw_context *brw,
src += element->glarray->StrideB;
dst += dst_stride;
}
- intel_upload_unmap(&brw->intel, dst, size,
+ intel_upload_unmap(&brw->intel, dst, size, dst_stride,
&buffer->bo, &buffer->offset);
}
}
@@ -421,7 +421,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);
+ map = intel_upload_map(&brw->intel, total_size * count, total_size);
for (i = offset = 0; i < nr_uploads; i++) {
const unsigned char *src = upload[i]->glarray->Ptr;
int size = upload[i]->element_size;
@@ -440,7 +440,7 @@ static void brw_prepare_vertices(struct brw_context *brw)
offset += size;
}
- intel_upload_unmap(&brw->intel, map, total_size * count,
+ intel_upload_unmap(&brw->intel, map, total_size * count, total_size,
&buffer->bo, &buffer->offset);
buffer->stride = offset;
j++;
@@ -608,7 +608,8 @@ static void brw_prepare_indices(struct brw_context *brw)
/* Get new bufferobj, offset:
*/
- intel_upload_data(&brw->intel, index_buffer->ptr, ib_size, &bo, &offset);
+ intel_upload_data(&brw->intel, index_buffer->ptr, ib_size, ib_type_size,
+ &bo, &offset);
brw->ib.start_vertex_offset = offset / ib_type_size;
offset = 0;
} else {
@@ -624,7 +625,8 @@ static void brw_prepare_indices(struct brw_context *brw)
bufferobj);
map += offset;
- intel_upload_data(&brw->intel, map, ib_size, &bo, &offset);
+ intel_upload_data(&brw->intel, map, ib_size, ib_type_size,
+ &bo, &offset);
brw->ib.start_vertex_offset = offset / ib_type_size;
offset = 0;