[Mesa-dev] [PATCH] gallium/postprocess: Fix resource freeing

Thomas Hellstrom thellstrom at vmware.com
Wed Aug 31 06:22:34 UTC 2016


The code was triggering asserts in DEBUG builds of the SVGA driver since
the reference count of the resource was never decremented before destroy.

Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
Reviewed-by: Brian Paul <brianp at vmware.com>
---
 src/gallium/auxiliary/postprocess/pp_mlaa.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/postprocess/pp_mlaa.c b/src/gallium/auxiliary/postprocess/pp_mlaa.c
index 502fcf1..0edd01f 100644
--- a/src/gallium/auxiliary/postprocess/pp_mlaa.c
+++ b/src/gallium/auxiliary/postprocess/pp_mlaa.c
@@ -353,13 +353,11 @@ void
 pp_jimenezmlaa_free(struct pp_queue_t *ppq, unsigned int n)
 {
    if (ppq->areamaptex) {
-      ppq->p->screen->resource_destroy(ppq->p->screen, ppq->areamaptex);
-      ppq->areamaptex = NULL;
+      pipe_resource_reference(&ppq->areamaptex, NULL);
    }
 
    if (ppq->constbuf) {
-      ppq->p->screen->resource_destroy(ppq->p->screen, ppq->constbuf);
-      ppq->constbuf = NULL;
+      pipe_resource_reference(&ppq->constbuf, NULL);
    }
 }
 
-- 
2.5.0



More information about the mesa-dev mailing list