diff options
author | Marek Olšák <maraeo@gmail.com> | 2011-02-14 10:08:59 +0100 |
---|---|---|
committer | Marek Olšák <maraeo@gmail.com> | 2011-02-14 11:43:14 +0100 |
commit | 476cec37d615df7c7329ef74d4a7ea7200b2d8fb (patch) | |
tree | 0339abf12a55bf539d74996ccde929f5f0f2f5a6 /src/gallium/drivers/r300/r300_render.c | |
parent | d173f1ba8a3d77e46f73ecb00378ea9598fe2c68 (diff) |
r300g: do not create a user buffer struct for misaligned ushort indices fallback
Diffstat (limited to 'src/gallium/drivers/r300/r300_render.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_render.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 051f434d42..37b9934a61 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -578,7 +578,6 @@ static void r300_draw_range_elements(struct pipe_context* pipe, if (indexSize == 2 && (start & 1) && !r300_resource(indexBuffer)->b.user_ptr) { struct pipe_transfer *transfer; - struct pipe_resource *userbuf; uint16_t *ptr = pipe_buffer_map(pipe, indexBuffer, PIPE_TRANSFER_READ | @@ -590,18 +589,16 @@ static void r300_draw_range_elements(struct pipe_context* pipe, } else { /* Copy the mapped index buffer directly to the upload buffer. * The start index will be aligned simply from the fact that - * every sub-buffer in u_upload_mgr is aligned. */ - userbuf = pipe->screen->user_buffer_create(pipe->screen, - ptr, 0, - PIPE_BIND_INDEX_BUFFER); - indexBuffer = userbuf; - r300_upload_index_buffer(r300, &indexBuffer, indexSize, &start, count); - pipe_resource_reference(&userbuf, NULL); + * every sub-buffer in the upload buffer is aligned. */ + r300_upload_index_buffer(r300, &indexBuffer, indexSize, &start, + count, (uint8_t*)ptr); } pipe_buffer_unmap(pipe, transfer); } else { if (r300_resource(indexBuffer)->b.user_ptr) - r300_upload_index_buffer(r300, &indexBuffer, indexSize, &start, count); + r300_upload_index_buffer(r300, &indexBuffer, indexSize, + &start, count, + r300_resource(indexBuffer)->b.user_ptr); } /* 19 dwords for emit_draw_elements. Give up if the function fails. */ |