summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_state.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-02-14 10:11:50 +0100
committerMarek Olšák <[email protected]>2011-02-14 11:43:14 +0100
commit437583ea637ab402a06ae6683af6df35d52512d4 (patch)
treec40bc08400deb0c485376a1aa31f396de5c12d52 /src/gallium/drivers/r300/r300_state.c
parent476cec37d615df7c7329ef74d4a7ea7200b2d8fb (diff)
r300g: cleanup the draw functions
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r--src/gallium/drivers/r300/r300_state.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 2ec96003795..242f883314e 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -1510,9 +1510,12 @@ static void r300_set_index_buffer(struct pipe_context* pipe,
{
struct r300_context* r300 = r300_context(pipe);
+ assert(ib->offset % ib->index_size == 0);
+
if (ib && ib->buffer) {
pipe_resource_reference(&r300->index_buffer.buffer, ib->buffer);
memcpy(&r300->index_buffer, ib, sizeof(r300->index_buffer));
+ r300->index_buffer.offset /= r300->index_buffer.index_size;
if (r300->screen->caps.has_tcl &&
!r300_resource(ib->buffer)->b.user_ptr) {