Can't get away from referencing upload buffer as after flush a vertex buffer
using the upload buffer might still be active. Likely need to simplify the
pipe_refence a bit so we don't waste so much cpu time in it.
candidates for 7.10 branch
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
{
struct r600_resource_buffer *rbuffer = r600_buffer(buf);
- if (!rbuffer->uploaded && rbuffer->r.bo) {
+ if (rbuffer->r.bo) {
r600_bo_reference((struct radeon*)screen->winsys, &rbuffer->r.bo, NULL);
}
rbuffer->r.bo = NULL;
upload->default_size = MAX2(upload->total_alloc_size, upload->default_size);
upload->total_alloc_size = 0;
upload->size = 0;
+ upload->offset = 0;
upload->ptr = NULL;
upload->buffer = NULL;
}
memcpy(upload->ptr + upload->offset, (uint8_t *) in_ptr + offset, size);
*out_offset = upload->offset;
*out_size = upload->size;
- *out_buffer = upload->buffer;
+ *out_buffer = NULL;
+ r600_bo_reference(upload->rctx->radeon, out_buffer, upload->buffer);
upload->offset += alloc_size;
return 0;