On Fri, 5 Mar 2021 at 17:06, Matteo Bruni <mbruni(a)codeweavers.com> wrote:
+ if (dst_rect->right >= swapchain_vk->width || dst_rect->bottom >= swapchain_vk->height) + { + dst_rect_tmp = *dst_rect; + if (dst_rect->right >= swapchain_vk->width) + dst_rect_tmp.right = swapchain_vk->width - 1; + if (dst_rect->bottom >= swapchain_vk->height) + dst_rect_tmp.bottom = swapchain_vk->height - 1; + dst_rect = &dst_rect_tmp; + } That's off by one. (And indeed, causes rows of missing pixels along the bottom and right of the window, as well as some blurriness.)
@@ -1142,8 +1162,16 @@ static void wined3d_swapchain_vk_blit(struct wined3d_swapchain_vk *swapchain_vk, present_desc.pSwapchains = &swapchain_vk->vk_swapchain; present_desc.pImageIndices = &image_idx; present_desc.pResults = NULL; - if ((vr = VK_CALL(vkQueuePresentKHR(device_vk->vk_queue, &present_desc)))) + vr = VK_CALL(vkQueuePresentKHR(device_vk->vk_queue, &present_desc)); + if (vr == VK_ERROR_OUT_OF_DATE_KHR) + { + if (FAILED(hr = wined3d_swapchain_vk_recreate(swapchain_vk))) + ERR("Failed to recreate swapchain, hr %#x.\n", hr); + } + else if (vr) + { ERR("Present returned vr %s.\n", wined3d_debug_vkresult(vr)); + } } That's probably fine for typical games, but should we perhaps retry the blit for applications that present infrequently?