summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/auxiliary/driver_trace/tr_texture.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/driver_trace/tr_texture.c')
-rw-r--r--lib/mesa/src/gallium/auxiliary/driver_trace/tr_texture.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/driver_trace/tr_texture.c b/lib/mesa/src/gallium/auxiliary/driver_trace/tr_texture.c
index d644e1b08..d9fba6d46 100644
--- a/lib/mesa/src/gallium/auxiliary/driver_trace/tr_texture.c
+++ b/lib/mesa/src/gallium/auxiliary/driver_trace/tr_texture.c
@@ -70,7 +70,6 @@ error:
void
trace_surf_destroy(struct trace_surface *tr_surf)
{
- trace_context_check(tr_surf->base.context);
pipe_resource_reference(&tr_surf->base.texture, NULL);
pipe_surface_reference(&tr_surf->surface, NULL);
FREE(tr_surf);
@@ -91,18 +90,21 @@ trace_transfer_create(struct trace_context *tr_ctx,
if (!tr_trans)
goto error;
- memcpy(&tr_trans->base, transfer, sizeof(struct pipe_transfer));
+ memcpy(&tr_trans->base, transfer, tr_ctx->threaded ? sizeof(struct threaded_transfer) : sizeof(struct pipe_transfer));
- tr_trans->base.resource = NULL;
+ tr_trans->base.b.resource = NULL;
tr_trans->transfer = transfer;
- pipe_resource_reference(&tr_trans->base.resource, res);
- assert(tr_trans->base.resource == res);
+ pipe_resource_reference(&tr_trans->base.b.resource, res);
+ assert(tr_trans->base.b.resource == res);
- return &tr_trans->base;
+ return &tr_trans->base.b;
error:
- tr_ctx->pipe->transfer_unmap(tr_ctx->pipe, transfer);
+ if (res->target == PIPE_BUFFER)
+ tr_ctx->pipe->buffer_unmap(tr_ctx->pipe, transfer);
+ else
+ tr_ctx->pipe->texture_unmap(tr_ctx->pipe, transfer);
return NULL;
}
@@ -111,7 +113,7 @@ void
trace_transfer_destroy(struct trace_context *tr_context,
struct trace_transfer *tr_trans)
{
- pipe_resource_reference(&tr_trans->base.resource, NULL);
+ pipe_resource_reference(&tr_trans->base.b.resource, NULL);
FREE(tr_trans);
}