mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
vulkan/wsi: return VK_SUBOPTIMAL_KHR for sw/x11 on window resize
the other codepaths all end up checking geometry in one way or another in order to validate the extents, so add a check here to do the same fixes #6893 Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17638>
This commit is contained in:
parent
74aea0b840
commit
6139493ae3
1 changed files with 15 additions and 1 deletions
|
|
@ -1369,7 +1369,21 @@ x11_acquire_next_image(struct wsi_swapchain *anv_chain,
|
||||||
if (!chain->images[i].busy) {
|
if (!chain->images[i].busy) {
|
||||||
*image_index = i;
|
*image_index = i;
|
||||||
chain->images[i].busy = true;
|
chain->images[i].busy = true;
|
||||||
return VK_SUCCESS;
|
xcb_generic_error_t *err;
|
||||||
|
|
||||||
|
xcb_get_geometry_cookie_t geom_cookie = xcb_get_geometry(chain->conn, chain->window);
|
||||||
|
xcb_get_geometry_reply_t *geom = xcb_get_geometry_reply(chain->conn, geom_cookie, &err);
|
||||||
|
VkResult result = VK_SUCCESS;
|
||||||
|
if (geom) {
|
||||||
|
if (chain->extent.width != geom->width ||
|
||||||
|
chain->extent.height != geom->height)
|
||||||
|
result = VK_SUBOPTIMAL_KHR;
|
||||||
|
} else {
|
||||||
|
result = VK_ERROR_SURFACE_LOST_KHR;
|
||||||
|
}
|
||||||
|
free(err);
|
||||||
|
free(geom);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return VK_NOT_READY;
|
return VK_NOT_READY;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue