zink: use actual swapchain object for surface comparison

the outer swapchain object is persistent, which means checking it
will never yield an update after the first check

fixes #8122

Fixes: b2739c9f00 ("zink: set surface->dt when updating swapchain"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20814>
(cherry picked from commit 474ed4b877)
This commit is contained in:
Mike Blumenkrantz 2023-01-20 13:11:37 -05:00 committed by Eric Engestrom
parent d240b30e35
commit 4502264786
3 changed files with 4 additions and 4 deletions

View file

@ -1642,7 +1642,7 @@
"description": "zink: use actual swapchain object for surface comparison",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "b2739c9f00557347008dfc500dcc584abb81378b"
},

View 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 */

View 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
};