diff options
author | Marek Olšák <[email protected]> | 2012-10-08 04:06:42 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-10-11 21:12:16 +0200 |
commit | 369e46888904c6d379b8b477d9242cff1608e30e (patch) | |
tree | 528b10f900f23af3acd22a0edcf50fde0eeee86e /src/gallium/drivers/trace/tr_texture.c | |
parent | ec4c74a9dc10039d97ad24c4f16bd2400517991d (diff) |
gallium: unify transfer functions
"get_transfer + transfer_map" becomes "transfer_map".
"transfer_unmap + transfer_destroy" becomes "transfer_unmap".
transfer_map must create and return the transfer object and transfer_unmap
must destroy it.
transfer_map is successful if the returned buffer pointer is not NULL.
If transfer_map fails, the pointer to the transfer object remains unchanged
(i.e. doesn't have to be NULL).
Acked-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/trace/tr_texture.c')
-rw-r--r-- | src/gallium/drivers/trace/tr_texture.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/gallium/drivers/trace/tr_texture.c b/src/gallium/drivers/trace/tr_texture.c index 648b7a4f1cc..81ebc9ee770 100644 --- a/src/gallium/drivers/trace/tr_texture.c +++ b/src/gallium/drivers/trace/tr_texture.c @@ -139,7 +139,7 @@ trace_transfer_create(struct trace_context *tr_ctx, return &tr_trans->base; error: - tr_ctx->pipe->transfer_destroy(tr_ctx->pipe, transfer); + tr_ctx->pipe->transfer_unmap(tr_ctx->pipe, transfer); return NULL; } @@ -148,11 +148,7 @@ void trace_transfer_destroy(struct trace_context *tr_context, struct trace_transfer *tr_trans) { - struct pipe_context *context = tr_context->pipe; - struct pipe_transfer *transfer = tr_trans->transfer; - pipe_resource_reference(&tr_trans->base.resource, NULL); - context->transfer_destroy(context, transfer); FREE(tr_trans); } |