gallium/postprocess: Fix resource freeing
authorThomas Hellstrom <thellstrom@vmware.com>
Thu, 26 May 2016 09:16:28 +0000 (11:16 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Thu, 1 Sep 2016 05:59:49 +0000 (07:59 +0200)
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@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/auxiliary/postprocess/pp_mlaa.c

index 502fcf169a6c675dddd274120c38f04e8114abbf..0edd01f3f5d5a6bf3afd98a7bc73a3ec7470aeae 100644 (file)
@@ -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);
    }
 }