gallium/postprocess: Proper reference counting of pp_jimenezmlaa depth buffer.
authorMichel Dänzer <michel.daenzer@amd.com>
Tue, 24 Jan 2012 16:57:56 +0000 (17:57 +0100)
committerMichel Dänzer <michel@daenzer.net>
Tue, 24 Jan 2012 16:57:56 +0000 (17:57 +0100)
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40776

NOTE: This is a candidate for the stable branches.

src/gallium/auxiliary/postprocess/pp_init.c

index ef127f8d76ebe05c1723a15abc1700ead42545d1..740d230a1e8edb5cf35e1c53766958455186c9d5 100644 (file)
@@ -135,6 +135,7 @@ pp_free_fbos(struct pp_queue_t *ppq)
       pipe_surface_reference(&ppq->inner_tmps[i], NULL);
       pipe_resource_reference(&ppq->inner_tmp[i], NULL);
    }
+   pipe_resource_reference(&ppq->depth, NULL);
    pipe_surface_reference(&ppq->stencils, NULL);
    pipe_resource_reference(&ppq->stencil, NULL);
 
@@ -244,7 +245,7 @@ pp_init_fbos(struct pp_queue_t *ppq, unsigned int w,
 
    tmp_res.format = p->surf.format = indepth->format;
    tmp_res.bind = p->surf.usage = PIPE_BIND_DEPTH_STENCIL;
-   ppq->depth = indepth;
+   pipe_resource_reference(&ppq->depth, indepth);
    if (!ppq->depth)
       goto error;