diff options
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_draw_arrays.c')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_draw_arrays.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c index 137ad0565b3..6363701cf92 100644 --- a/src/gallium/drivers/softpipe/sp_draw_arrays.c +++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c @@ -96,21 +96,17 @@ softpipe_draw_vbo(struct pipe_context *pipe, } /* Map index buffer, if present */ - if (info->indexed) { + if (info->index_size) { unsigned available_space = ~0; - mapped_indices = sp->index_buffer.user_buffer; + mapped_indices = info->has_user_indices ? info->index.user : NULL; if (!mapped_indices) { - mapped_indices = softpipe_resource_data(sp->index_buffer.buffer); - if (sp->index_buffer.buffer->width0 > sp->index_buffer.offset) - available_space = - (sp->index_buffer.buffer->width0 - sp->index_buffer.offset); - else - available_space = 0; + mapped_indices = softpipe_resource_data(info->index.resource); + available_space = info->index.resource->width0; } draw_set_indexes(draw, - (ubyte *) mapped_indices + sp->index_buffer.offset, - sp->index_buffer.index_size, available_space); + (ubyte *) mapped_indices, + info->index_size, available_space); } |