options |= XCB_PRESENT_OPTION_SUBOPTIMAL;
#endif
+ /* Poll for any available event and update the swapchain status. This could
+ * update the status of the swapchain to SUBOPTIMAL or OUT_OF_DATE if the
+ * associated X11 surface has been resized.
+ */
+ xcb_generic_event_t *event;
+ while ((event = xcb_poll_for_special_event(chain->conn, chain->special_event))) {
+ VkResult result = x11_handle_dri3_present_event(chain, (void *)event);
+ free(event);
+ if (result < 0)
+ return x11_swapchain_result(chain, result);
+ x11_swapchain_result(chain, result);
+ }
+
xshmfence_reset(image->shm_fence);
++chain->send_sbc;
struct x11_swapchain *chain = (struct x11_swapchain *)anv_chain;
uint64_t timeout = info->timeout;
+ /* If the swapchain is in an error state, don't go any further. */
+ if (chain->status < 0)
+ return chain->status;
+
if (chain->threaded) {
return x11_acquire_next_image_from_queue(chain, image_index, timeout);
} else {
{
struct x11_swapchain *chain = (struct x11_swapchain *)anv_chain;
+ /* If the swapchain is in an error state, don't go any further. */
+ if (chain->status < 0)
+ return chain->status;
+
if (chain->threaded) {
wsi_queue_push(&chain->present_queue, image_index);
return chain->status;