summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/trace/tr_texture.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-02-15 10:36:32 -0700
committerBrian Paul <[email protected]>2013-02-15 11:11:34 -0700
commit82d62cf04f3c585ba324fcef16417fbee4a3d220 (patch)
treef743480e4c38f77a4e26b57a294c71454d257c8b /src/gallium/drivers/trace/tr_texture.c
parent3b0de75c4dab869f2e312c4627cd69fd0b40d7aa (diff)
trace: fix incorrect trace_surface::base.context pointer
When a trace_surface object is created in trace_surf_create() we weren't correctly setting the surface's context pointer. Instead of it being the trace context, it was the wrapped driver's context. This caused things to blow up sometimes during surface deallocation. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/trace/tr_texture.c')
-rw-r--r--src/gallium/drivers/trace/tr_texture.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/trace/tr_texture.c b/src/gallium/drivers/trace/tr_texture.c
index 81ebc9ee770..aae13383865 100644
--- a/src/gallium/drivers/trace/tr_texture.c
+++ b/src/gallium/drivers/trace/tr_texture.c
@@ -74,7 +74,8 @@ trace_resource_destroy(struct trace_screen *tr_scr,
struct pipe_surface *
-trace_surf_create(struct trace_resource *tr_res,
+trace_surf_create(struct trace_context *tr_ctx,
+ struct trace_resource *tr_res,
struct pipe_surface *surface)
{
struct trace_surface *tr_surf;
@@ -89,6 +90,7 @@ trace_surf_create(struct trace_resource *tr_res,
goto error;
memcpy(&tr_surf->base, surface, sizeof(struct pipe_surface));
+ tr_surf->base.context = &tr_ctx->base;
pipe_reference_init(&tr_surf->base.reference, 1);
tr_surf->base.texture = NULL;