summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-05-25 09:44:53 -0600
committerBrian Paul <[email protected]>2012-05-31 09:40:35 -0600
commit185ed2105829d6f5eb19edb9abbf0d7977e157c3 (patch)
tree91716430893902305c60756e64b2ec8328895640 /src/gallium/drivers/softpipe
parent151bf6e6cf8f9de4067cfcf15f6ac448ff295533 (diff)
draw: simplify index buffer specification
Replace draw_set_index_buffer() and draw_set_mapped_index_buffer() with draw_set_indexes() which simply takes a pointer and an index size.
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r--src/gallium/drivers/softpipe/sp_draw_arrays.c7
-rw-r--r--src/gallium/drivers/softpipe/sp_state_vertex.c2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c
index 7a2274565d5..f9fc923a184 100644
--- a/src/gallium/drivers/softpipe/sp_draw_arrays.c
+++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c
@@ -88,9 +88,12 @@ softpipe_draw_vbo(struct pipe_context *pipe,
mapped_indices = sp->index_buffer.user_buffer;
if (!mapped_indices)
mapped_indices = softpipe_resource(sp->index_buffer.buffer)->data;
+
+ draw_set_indexes(draw,
+ (ubyte *) mapped_indices + sp->index_buffer.offset,
+ sp->index_buffer.index_size);
}
- draw_set_mapped_index_buffer(draw, mapped_indices);
for (i = 0; i < sp->num_so_targets; i++) {
void *buf = softpipe_resource(sp->so_targets[i]->target.buffer)->data;
@@ -108,7 +111,7 @@ softpipe_draw_vbo(struct pipe_context *pipe,
draw_set_mapped_vertex_buffer(draw, i, NULL);
}
if (mapped_indices) {
- draw_set_mapped_index_buffer(draw, NULL);
+ draw_set_indexes(draw, NULL, 0);
}
draw_set_mapped_so_targets(draw, 0, NULL);
diff --git a/src/gallium/drivers/softpipe/sp_state_vertex.c b/src/gallium/drivers/softpipe/sp_state_vertex.c
index 1dbd79807d0..95acecd3be4 100644
--- a/src/gallium/drivers/softpipe/sp_state_vertex.c
+++ b/src/gallium/drivers/softpipe/sp_state_vertex.c
@@ -106,8 +106,6 @@ softpipe_set_index_buffer(struct pipe_context *pipe,
memcpy(&softpipe->index_buffer, ib, sizeof(softpipe->index_buffer));
else
memset(&softpipe->index_buffer, 0, sizeof(softpipe->index_buffer));
-
- draw_set_index_buffer(softpipe->draw, ib);
}