From fc6be400115c0caa4e5cbb810917d6b8a11596a4 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Thu, 26 May 2016 11:16:28 +0200 Subject: [PATCH] gallium/postprocess: Fix resource freeing 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 Reviewed-by: Brian Paul Reviewed-by: Alex Deucher --- 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 502fcf169a6..0edd01f3f5d 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); } }