zink: break out surface destroy function into a screen function
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 19 Mar 2021 21:21:38 +0000 (17:21 -0400)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Mon, 22 Mar 2021 12:49:26 +0000 (08:49 -0400)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9665>

src/gallium/drivers/zink/zink_surface.c
src/gallium/drivers/zink/zink_surface.h

index 2e3309f..2f11bd0 100644 (file)
@@ -177,11 +177,9 @@ zink_create_surface(struct pipe_context *pctx,
    return zink_get_surface(zink_context(pctx), pres, templ, &ivci);
 }
 
-static void
-zink_surface_destroy(struct pipe_context *pctx,
-                     struct pipe_surface *psurface)
+void
+zink_destroy_surface(struct zink_screen *screen, struct pipe_surface *psurface)
 {
-   struct zink_screen *screen = zink_screen(pctx->screen);
    struct zink_surface *surface = zink_surface(psurface);
    simple_mtx_lock(&screen->surface_mtx);
    struct hash_entry *he = _mesa_hash_table_search_pre_hashed(&screen->surface_cache, surface->hash, &surface->ivci);
@@ -193,6 +191,13 @@ zink_surface_destroy(struct pipe_context *pctx,
    FREE(surface);
 }
 
+static void
+zink_surface_destroy(struct pipe_context *pctx,
+                     struct pipe_surface *psurface)
+{
+   zink_destroy_surface(zink_screen(pctx->screen), psurface);
+}
+
 void
 zink_context_surface_init(struct pipe_context *context)
 {
index afed99d..61bc9c9 100644 (file)
@@ -45,6 +45,9 @@ zink_surface(struct pipe_surface *pipe)
 }
 
 void
+zink_destroy_surface(struct zink_screen *screen, struct pipe_surface *psurface);
+
+void
 zink_context_surface_init(struct pipe_context *context);
 
 VkImageViewCreateInfo