From: Marek Olšák Date: Mon, 14 Feb 2011 05:59:00 +0000 (+0100) Subject: r600g: do not destroy the original index buffer when translating indices X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e9d993e9b9d7ea2b4a9be7caa4e5a73fe5126cbe;p=mesa.git r600g: do not destroy the original index buffer when translating indices Because we only translate a subrange of the buffer. --- diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index bcaf2b9e45e..72707fbd8b8 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -449,14 +449,14 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info) draw.ctx = ctx; if (info->indexed && rctx->index_buffer.buffer) { draw.info.start += rctx->index_buffer.offset / rctx->index_buffer.index_size; + pipe_resource_reference(&draw.index_buffer, rctx->index_buffer.buffer); - r600_translate_index_buffer(rctx, &rctx->index_buffer.buffer, + r600_translate_index_buffer(rctx, &draw.index_buffer, &rctx->index_buffer.index_size, &draw.info.start, info->count); draw.index_size = rctx->index_buffer.index_size; - pipe_resource_reference(&draw.index_buffer, rctx->index_buffer.buffer); draw.index_buffer_offset = draw.info.start * draw.index_size; draw.info.start = 0;