zink: flag swapchains when updating fails

these are dead, they just don't know it yet

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16038>
This commit is contained in:
Mike Blumenkrantz 2022-04-19 10:50:23 -04:00 committed by Marge Bot
parent b86c814347
commit 651b71a6ca
2 changed files with 6 additions and 0 deletions

View File

@ -513,6 +513,10 @@ zink_kopper_acquire(struct zink_context *ctx, struct zink_resource *res, uint64_
{
assert(res->obj->dt);
struct kopper_displaytarget *cdt = kopper_displaytarget(res->obj->dt);
if (cdt->is_kill) {
kill_swapchain(ctx, res);
return false;
}
const struct kopper_swapchain *cswap = cdt->swapchain;
res->obj->new_dt |= res->base.b.width0 != cswap->scci.imageExtent.width ||
res->base.b.height0 != cswap->scci.imageExtent.height;
@ -738,6 +742,7 @@ zink_kopper_update(struct pipe_screen *pscreen, struct pipe_resource *pres, int
}
if (update_caps(screen, cdt) != VK_SUCCESS) {
mesa_loge("zink: failed to update swapchain capabilities");
cdt->is_kill = true;
return false;
}
*w = cdt->caps.currentExtent.width;

View File

@ -69,6 +69,7 @@ struct kopper_displaytarget
VkSurfaceCapabilitiesKHR caps;
VkImageFormatListCreateInfoKHR format_list;
enum kopper_type type;
bool is_kill;
};
struct zink_context;