summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_render.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-12-25 14:46:45 +0100
committerMarek Olšák <maraeo@gmail.com>2010-12-25 16:07:13 +0100
commit7e752760d410e72cc766691bee207729f28a920a (patch)
tree44b9a60698909a5bb8846240f158081572e99c5b /src/gallium/drivers/r300/r300_render.c
parent9c448817f7d62ae885019d816a7ecbc2c7bc34c1 (diff)
downloadexternal_mesa3d-7e752760d410e72cc766691bee207729f28a920a.zip
external_mesa3d-7e752760d410e72cc766691bee207729f28a920a.tar.gz
external_mesa3d-7e752760d410e72cc766691bee207729f28a920a.tar.bz2
r300g: simplify the code for buffer uploads
Diffstat (limited to 'src/gallium/drivers/r300/r300_render.c')
-rw-r--r--src/gallium/drivers/r300/r300_render.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index 142538b..92d1274 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -592,15 +592,16 @@ static void r300_draw_range_elements(struct pipe_context* pipe,
* 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 + start, count * 2,
+ ptr, count * 2,
PIPE_BIND_INDEX_BUFFER);
indexBuffer = userbuf;
- r300_upload_index_buffer(r300, &indexBuffer, indexSize, 0, count, &start);
+ r300_upload_index_buffer(r300, &indexBuffer, indexSize, &start, count);
pipe_resource_reference(&userbuf, NULL);
}
pipe_buffer_unmap(pipe, transfer);
} else {
- r300_upload_index_buffer(r300, &indexBuffer, indexSize, start, count, &start);
+ if (r300_buffer_is_user_buffer(indexBuffer))
+ r300_upload_index_buffer(r300, &indexBuffer, indexSize, &start, count);
}
/* 19 dwords for emit_draw_elements. Give up if the function fails. */