From e9d993e9b9d7ea2b4a9be7caa4e5a73fe5126cbe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 14 Feb 2011 06:59:00 +0100 Subject: [PATCH] r600g: do not destroy the original index buffer when translating indices Because we only translate a subrange of the buffer. --- src/gallium/drivers/r600/r600_state_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.30.2