[PATCH 2/5] wined3d: Handle blits to Vulkan swapchains not matching the D3D swapchain.
Henri Verbeet
hverbeet at gmail.com
Mon Mar 8 04:50:15 CST 2021
On Fri, 5 Mar 2021 at 17:06, Matteo Bruni <mbruni at 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?
More information about the wine-devel
mailing list