struct r600_common_context *rctx = (struct r600_common_context*)ctx;
struct r600_transfer *transfer = slab_alloc(&rctx->pool_transfers);
- transfer->transfer.resource = resource;
+ transfer->transfer.resource = NULL;
+ pipe_resource_reference(&transfer->transfer.resource, resource);
transfer->transfer.level = 0;
transfer->transfer.usage = usage;
transfer->transfer.box = *box;
if (rtransfer->staging)
r600_resource_reference(&rtransfer->staging, NULL);
+ pipe_resource_reference(&transfer->resource, NULL);
slab_free(&rctx->pool_transfers, transfer);
}
trans = CALLOC_STRUCT(r600_transfer);
if (!trans)
return NULL;
- trans->transfer.resource = texture;
+ pipe_resource_reference(&trans->transfer.resource, texture);
trans->transfer.level = level;
trans->transfer.usage = usage;
trans->transfer.box = *box;
rctx->num_alloc_tex_transfer_bytes = 0;
}
+ pipe_resource_reference(&transfer->resource, NULL);
FREE(transfer);
}