summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-02-14 06:59:00 +0100
committerMarek Olšák <[email protected]>2011-02-14 07:45:14 +0100
commite9d993e9b9d7ea2b4a9be7caa4e5a73fe5126cbe (patch)
treeb7d5052dbcf8c45bf9621fc12e67941e6893eb3a /src/gallium
parent5a6ba08c21f24b14458a2084a170ddfbe8f5d793 (diff)
r600g: do not destroy the original index buffer when translating indices
Because we only translate a subrange of the buffer.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/r600/r600_state_common.c4
1 files 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;