zink: use actual swapchain object for surface comparison
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 20 Jan 2023 18:11:37 +0000 (13:11 -0500)
committerEric Engestrom <eric@engestrom.ch>
Thu, 26 Jan 2023 15:40:34 +0000 (15:40 +0000)
the outer swapchain object is persistent, which means checking it
will never yield an update after the first check

fixes #8122

Fixes: b2739c9f005 ("zink: set surface->dt when updating swapchain"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20814>
(cherry picked from commit 474ed4b877e0988acdb9329de485f2e339812680)

.pick_status.json
src/gallium/drivers/zink/zink_surface.c
src/gallium/drivers/zink/zink_types.h

index c54b2ec..14d953b 100644 (file)
         "description": "zink: use actual swapchain object for surface comparison",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "b2739c9f00557347008dfc500dcc584abb81378b"
     },
index 5b53928..d0afa8e 100644 (file)
@@ -451,7 +451,7 @@ zink_surface_swapchain_update(struct zink_context *ctx, struct zink_surface *sur
    struct kopper_displaytarget *cdt = res->obj->dt;
    if (!cdt)
       return; //dead swapchain
-   if (res->obj->dt != surface->dt) {
+   if (cdt->swapchain != surface->dt_swapchain) {
       /* new swapchain: clear out previous swapchain imageviews/array and setup a new one;
        * old views will be pruned normally in zink_batch or on object destruction
        */
@@ -465,7 +465,7 @@ zink_surface_swapchain_update(struct zink_context *ctx, struct zink_surface *sur
       surface->base.width = res->base.b.width0;
       surface->base.height = res->base.b.height0;
       init_surface_info(surface, res, &surface->ivci);
-      surface->dt = res->obj->dt;
+      surface->dt_swapchain = cdt->swapchain;
    }
    if (!surface->swapchain[res->obj->dt_idx]) {
       /* no current swapchain imageview exists: create it */
index 7bbbfb4..5aa5931 100644 (file)
@@ -1325,7 +1325,7 @@ struct zink_surface {
    VkImageView *swapchain;
    unsigned swapchain_size;
    void *obj; //backing resource object; used to determine rebinds
-   void *dt; //current swapchain object; used to determine swapchain rebinds
+   void *dt_swapchain; //current swapchain object; used to determine swapchain rebinds
    uint32_t hash; //for surface caching
 };