diff options
Diffstat (limited to 'src/gallium/drivers/i915')
-rw-r--r-- | src/gallium/drivers/i915/i915_context.c | 10 | ||||
-rw-r--r-- | src/gallium/drivers/i915/i915_context.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/i915/i915_state.c | 12 |
3 files changed, 5 insertions, 18 deletions
diff --git a/src/gallium/drivers/i915/i915_context.c b/src/gallium/drivers/i915/i915_context.c index d2297006cb5..8ea944003f2 100644 --- a/src/gallium/drivers/i915/i915_context.c +++ b/src/gallium/drivers/i915/i915_context.c @@ -83,13 +83,13 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) /* * Map index buffer, if present */ - if (info->indexed) { - mapped_indices = i915->index_buffer.user_buffer; + if (info->index_size) { + mapped_indices = info->has_user_indices ? info->index.user : NULL; if (!mapped_indices) - mapped_indices = i915_buffer(i915->index_buffer.buffer)->data; + mapped_indices = i915_buffer(info->index.resource)->data; draw_set_indexes(draw, - (ubyte *) mapped_indices + i915->index_buffer.offset, - i915->index_buffer.index_size, ~0); + (ubyte *) mapped_indices, + info->index_size, ~0); } if (i915->constants[PIPE_SHADER_VERTEX]) diff --git a/src/gallium/drivers/i915/i915_context.h b/src/gallium/drivers/i915/i915_context.h index ea13834c15a..626a17f5606 100644 --- a/src/gallium/drivers/i915/i915_context.h +++ b/src/gallium/drivers/i915/i915_context.h @@ -249,7 +249,6 @@ struct i915_context { struct pipe_sampler_view *fragment_sampler_views[PIPE_MAX_SAMPLERS]; struct pipe_sampler_view *vertex_sampler_views[PIPE_MAX_SAMPLERS]; struct pipe_viewport_state viewport; - struct pipe_index_buffer index_buffer; unsigned dirty; diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index 3747922ba80..ddc27098de2 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -1060,17 +1060,6 @@ i915_delete_vertex_elements_state(struct pipe_context *pipe, void *velems) FREE( velems ); } -static void i915_set_index_buffer(struct pipe_context *pipe, - const struct pipe_index_buffer *ib) -{ - struct i915_context *i915 = i915_context(pipe); - - if (ib) - memcpy(&i915->index_buffer, ib, sizeof(i915->index_buffer)); - else - memset(&i915->index_buffer, 0, sizeof(i915->index_buffer)); -} - static void i915_set_sample_mask(struct pipe_context *pipe, unsigned sample_mask) @@ -1119,5 +1108,4 @@ i915_init_state_functions( struct i915_context *i915 ) i915->base.sampler_view_destroy = i915_sampler_view_destroy; i915->base.set_viewport_states = i915_set_viewport_states; i915->base.set_vertex_buffers = i915_set_vertex_buffers; - i915->base.set_index_buffer = i915_set_index_buffer; } |