zink: set surface->dt when updating swapchain
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 10 Jan 2023 15:51:06 +0000 (10:51 -0500)
committerEric Engestrom <eric@engestrom.ch>
Wed, 11 Jan 2023 17:44:23 +0000 (17:44 +0000)
this otherwise re-creates swapchain surfaces on every frame and has
a significant perf hit for no reason

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20613>
(cherry picked from commit b2739c9f00557347008dfc500dcc584abb81378b)

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

index 49b762b..614ba84 100644 (file)
         "description": "zink: set surface->dt when updating swapchain",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
index 0a48d7a..5b53928 100644 (file)
@@ -465,6 +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;
    }
    if (!surface->swapchain[res->obj->dt_idx]) {
       /* no current swapchain imageview exists: create it */