zink: simplify conditional for surface rebind no-ops
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 25 Oct 2022 17:36:50 +0000 (13:36 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 27 Oct 2022 14:43:50 +0000 (14:43 +0000)
the question isn't whether the storage imageview has been created,
it's whether the surface is current for the memory binding

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19307>

src/gallium/drivers/zink/zink_surface.c

index 78badb3..53b94a9 100644 (file)
@@ -353,7 +353,7 @@ zink_rebind_surface(struct zink_context *ctx, struct pipe_surface **psurface)
    struct zink_surface *surface = zink_surface(*psurface);
    struct zink_resource *res = zink_resource((*psurface)->texture);
    struct zink_screen *screen = zink_screen(ctx->base.screen);
-   if (surface->simage_view)
+   if (surface->obj == res->obj)
       return false;
    assert(!res->obj->dt);
    VkImageViewCreateInfo ivci = surface->ivci;