diff options
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_context.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_draw_arrays.c | 16 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_state_vertex.c | 13 |
3 files changed, 6 insertions, 24 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h index d4bd02d0225..6f1c7d929eb 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.h +++ b/src/gallium/drivers/llvmpipe/lp_context.h @@ -81,7 +81,6 @@ struct llvmpipe_context { struct pipe_viewport_state viewports[PIPE_MAX_VIEWPORTS]; struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS]; - struct pipe_index_buffer index_buffer; unsigned num_samplers[PIPE_SHADER_TYPES]; unsigned num_sampler_views[PIPE_SHADER_TYPES]; diff --git a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c index 9a9c2f7ce76..2efe3ef5bb8 100644 --- a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c +++ b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c @@ -87,20 +87,16 @@ llvmpipe_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) } /* Map index buffer, if present */ - if (info->indexed) { + if (info->index_size) { unsigned available_space = ~0; - mapped_indices = lp->index_buffer.user_buffer; + mapped_indices = info->has_user_indices ? info->index.user : NULL; 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; + mapped_indices = llvmpipe_resource_data(info->index.resource); + available_space = info->index.resource->width0; } draw_set_indexes(draw, - (ubyte *) mapped_indices + lp->index_buffer.offset, - lp->index_buffer.index_size, available_space); + (ubyte *) mapped_indices, + info->index_size, available_space); } for (i = 0; i < lp->num_so_targets; i++) { diff --git a/src/gallium/drivers/llvmpipe/lp_state_vertex.c b/src/gallium/drivers/llvmpipe/lp_state_vertex.c index 1e93fd86734..702ecf96a9e 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_vertex.c +++ b/src/gallium/drivers/llvmpipe/lp_state_vertex.c @@ -93,18 +93,6 @@ llvmpipe_set_vertex_buffers(struct pipe_context *pipe, } -static void -llvmpipe_set_index_buffer(struct pipe_context *pipe, - const struct pipe_index_buffer *ib) -{ - struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe); - - if (ib) - memcpy(&llvmpipe->index_buffer, ib, sizeof(llvmpipe->index_buffer)); - else - memset(&llvmpipe->index_buffer, 0, sizeof(llvmpipe->index_buffer)); -} - void llvmpipe_init_vertex_funcs(struct llvmpipe_context *llvmpipe) { @@ -113,5 +101,4 @@ llvmpipe_init_vertex_funcs(struct llvmpipe_context *llvmpipe) llvmpipe->pipe.delete_vertex_elements_state = llvmpipe_delete_vertex_elements_state; llvmpipe->pipe.set_vertex_buffers = llvmpipe_set_vertex_buffers; - llvmpipe->pipe.set_index_buffer = llvmpipe_set_index_buffer; } |