goto done;
}
draw->index_buffer_offset = index_offset;
- draw->index_buffer = upload_buffer;
+
+ /* Transfer ownership. */
+ pipe_resource_reference(&draw->index_buffer, upload_buffer);
+ pipe_resource_reference(&upload_buffer, NULL);
}
done:
info->count);
draw.index_size = rctx->index_buffer.index_size;
- draw.index_buffer = rctx->index_buffer.buffer;
+ pipe_resource_reference(&draw.index_buffer, rctx->index_buffer.buffer);
draw.index_buffer_offset = draw.start * draw.index_size;
draw.start = 0;
r600_upload_index_buffer(rctx, &draw);
r = r600_draw_common(&draw);
if (r)
fprintf(stderr,"draw common failed %d\n", r);
+
+ pipe_resource_reference(&draw.index_buffer, NULL);
}
info->count);
draw.index_size = rctx->index_buffer.index_size;
- draw.index_buffer = rctx->index_buffer.buffer;
+ pipe_resource_reference(&draw.index_buffer, rctx->index_buffer.buffer);
draw.index_buffer_offset = draw.start * draw.index_size;
draw.start = 0;
r600_upload_index_buffer2(rctx, &draw);
draw.index_bias = info->start;
}
r600_draw_common(&draw);
+
+ pipe_resource_reference(&draw.index_buffer, NULL);
}
static void r600_flush2(struct pipe_context *ctx, unsigned flags,
goto done;
}
draw->index_buffer_offset = index_offset;
- draw->index_buffer = upload_buffer;
+
+ /* Transfer ownership. */
+ pipe_resource_reference(&draw->index_buffer, upload_buffer);
+ pipe_resource_reference(&upload_buffer, NULL);
}
done: