diff options
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_context.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_draw_arrays.c | 16 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_state_vertex.c | 14 |
3 files changed, 6 insertions, 25 deletions
diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h index a57f5875537..7ce4dc3560d 100644 --- a/src/gallium/drivers/softpipe/sp_context.h +++ b/src/gallium/drivers/softpipe/sp_context.h @@ -88,7 +88,6 @@ struct softpipe_context { struct pipe_shader_buffer buffers[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_BUFFERS]; struct pipe_viewport_state viewports[PIPE_MAX_VIEWPORTS]; struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS]; - struct pipe_index_buffer index_buffer; struct pipe_resource *mapped_vs_tex[PIPE_MAX_SHADER_SAMPLER_VIEWS]; struct pipe_resource *mapped_gs_tex[PIPE_MAX_SHADER_SAMPLER_VIEWS]; 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); } diff --git a/src/gallium/drivers/softpipe/sp_state_vertex.c b/src/gallium/drivers/softpipe/sp_state_vertex.c index 48c8d2cb39f..a7a8736390d 100644 --- a/src/gallium/drivers/softpipe/sp_state_vertex.c +++ b/src/gallium/drivers/softpipe/sp_state_vertex.c @@ -97,19 +97,6 @@ softpipe_set_vertex_buffers(struct pipe_context *pipe, } -static void -softpipe_set_index_buffer(struct pipe_context *pipe, - const struct pipe_index_buffer *ib) -{ - struct softpipe_context *softpipe = softpipe_context(pipe); - - if (ib) - memcpy(&softpipe->index_buffer, ib, sizeof(softpipe->index_buffer)); - else - memset(&softpipe->index_buffer, 0, sizeof(softpipe->index_buffer)); -} - - void softpipe_init_vertex_funcs(struct pipe_context *pipe) { @@ -118,5 +105,4 @@ softpipe_init_vertex_funcs(struct pipe_context *pipe) pipe->delete_vertex_elements_state = softpipe_delete_vertex_elements_state; pipe->set_vertex_buffers = softpipe_set_vertex_buffers; - pipe->set_index_buffer = softpipe_set_index_buffer; } |