From 330d0607ed60fd3edca192e54b4246310f06652f Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 2 Apr 2017 16:24:39 +0200 Subject: gallium: remove pipe_index_buffer and set_index_buffer pipe_draw_info::indexed is replaced with index_size. index_size == 0 means non-indexed. Instead of pipe_index_buffer::offset, pipe_draw_info::start is used. For indexed indirect draws, pipe_draw_info::start is added to the indirect start. This is the only case when "start" affects indirect draws. pipe_draw_info::index is a union. Use either index::resource or index::user depending on the value of pipe_draw_info::has_user_indices. v2: fixes for nine, svga --- src/gallium/drivers/i915/i915_context.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/gallium/drivers/i915/i915_context.c') 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]) -- cgit v1.2.3