summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_draw_arrays.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
index 63c22c31304..4e239043ec4 100644
--- a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
+++ b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
@@ -81,13 +81,19 @@ llvmpipe_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
/* Map index buffer, if present */
if (info->indexed) {
+ unsigned available_space = ~0;
mapped_indices = lp->index_buffer.user_buffer;
- if (!mapped_indices)
+ if (!mapped_indices) {
mapped_indices = llvmpipe_resource_data(lp->index_buffer.buffer);
-
+ if (lp->index_buffer.buffer->width0 > lp->index_buffer.offset)
+ available_space =
+ (lp->index_buffer.buffer->width0 - lp->index_buffer.offset);
+ else
+ available_space = 0;
+ }
draw_set_indexes(draw,
(ubyte *) mapped_indices + lp->index_buffer.offset,
- lp->index_buffer.index_size);
+ lp->index_buffer.index_size, available_space);
}
for (i = 0; i < lp->num_so_targets; i++) {
@@ -126,7 +132,7 @@ llvmpipe_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
draw_set_mapped_vertex_buffer(draw, i, NULL, 0);
}
if (mapped_indices) {
- draw_set_indexes(draw, NULL, 0);
+ draw_set_indexes(draw, NULL, 0, 0);
}
draw_set_mapped_so_targets(draw, 0, NULL);