panfrost: Dereference sampled texture
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Thu, 23 May 2019 08:09:33 +0000 (10:09 +0200)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Fri, 24 May 2019 14:50:09 +0000 (16:50 +0200)
We are currently leaking resources if they were sampled from. Once we
are done with a sampler, we should dereference that resource.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
src/gallium/drivers/panfrost/pan_context.c

index 5cae386f070eb39213cde3325b5142171a5d0a29..b3f89ea9cc441fe2e9dcbc74053f086d03e5456f 100644 (file)
@@ -2057,13 +2057,10 @@ panfrost_set_sampler_views(
 static void
 panfrost_sampler_view_destroy(
         struct pipe_context *pctx,
-        struct pipe_sampler_view *views)
+        struct pipe_sampler_view *view)
 {
-        //struct panfrost_context *ctx = pan_context(pctx);
-
-        /* TODO */
-
-        free(views);
+        pipe_resource_reference(&view->texture, NULL);
+        free(view);
 }
 
 static void