From: Erik Faye-Lund Date: Mon, 25 Mar 2019 13:29:50 +0000 (+0100) Subject: zink: do not leak image-views X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ac45bc2359393d92ddba0e6dc4f3833df4918f27;p=mesa.git zink: do not leak image-views Acked-by: Jordan Justen --- diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 9c5167a8797..b437bd3269d 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -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); } diff --git a/src/gallium/drivers/zink/zink_context.h b/src/gallium/drivers/zink/zink_context.h index 69e2fdd797e..fdf6ed665f6 100644 --- a/src/gallium/drivers/zink/zink_context.h +++ b/src/gallium/drivers/zink/zink_context.h @@ -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;