zink: do not leak image-views
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 25 Mar 2019 13:29:50 +0000 (14:29 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:44 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/zink_context.c
src/gallium/drivers/zink/zink_context.h

index 9c5167a8797853ded1517463f5535745b3574bc1..b437bd3269ddc4660a4f38a6f5a5fff48fc0d7aa 100644 (file)
@@ -236,8 +236,10 @@ zink_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *pres,
 
 static void
 zink_destroy_sampler_view(struct pipe_context *pctx,
-                          struct pipe_sampler_view *view)
+                          struct pipe_sampler_view *pview)
 {
+   struct zink_sampler_view *view = zink_sampler_view(pview);
+   vkDestroyImageView(zink_screen(pctx->screen)->dev, view->image_view, NULL);
    FREE(view);
 }
 
index 69e2fdd797e14fbfabca28ea2314d292ea2f03d2..fdf6ed665f604b772e01e145ae946c2a3686fcce 100644 (file)
@@ -48,6 +48,12 @@ struct zink_sampler_view {
    VkImageView image_view;
 };
 
+static inline struct zink_sampler_view *
+zink_sampler_view(struct pipe_sampler_view *pview)
+{
+   return (struct zink_sampler_view *)pview;
+}
+
 struct zink_context {
    struct pipe_context base;
    struct slab_child_pool transfer_pool;