mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
vk/wsi/x11: Send OUT_OF_DATE if the X drawable goes away
This commit is contained in:
parent
005c8e0106
commit
c1553653a2
1 changed files with 13 additions and 2 deletions
|
|
@ -192,9 +192,18 @@ x11_acquire_next_image(struct anv_swap_chain *anv_chain,
|
|||
struct x11_image *image = &chain->images[chain->next_image];
|
||||
|
||||
if (image->busy) {
|
||||
xcb_generic_error_t *err;
|
||||
xcb_get_geometry_reply_t *geom =
|
||||
xcb_get_geometry_reply(chain->conn, image->geom_cookie, NULL);
|
||||
image->busy = false;
|
||||
xcb_get_geometry_reply(chain->conn, image->geom_cookie, &err);
|
||||
if (!geom) {
|
||||
if (err->error_code == XCB_DRAWABLE) {
|
||||
/* Probably the best thing to do if our drawable goes away */
|
||||
return vk_error(VK_ERROR_OUT_OF_DATE_WSI);
|
||||
} else {
|
||||
return vk_error(VK_ERROR_UNKNOWN);
|
||||
}
|
||||
free(err);
|
||||
}
|
||||
|
||||
if (geom->width != chain->extent.width ||
|
||||
geom->height != chain->extent.height) {
|
||||
|
|
@ -202,6 +211,8 @@ x11_acquire_next_image(struct anv_swap_chain *anv_chain,
|
|||
return vk_error(VK_ERROR_OUT_OF_DATE_WSI);
|
||||
}
|
||||
free(geom);
|
||||
|
||||
image->busy = false;
|
||||
}
|
||||
|
||||
*image_index = chain->next_image;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue