[PATCH v2 2/5] wined3d: Handle blits to Vulkan swapchains not matching the D3D swapchain.
Henri Verbeet
hverbeet at gmail.com
Thu Mar 11 05:52:44 CST 2021
On Wed, 10 Mar 2021 at 20:50, Matteo Bruni <mbruni at codeweavers.com> wrote:
> @@ -1142,8 +1162,21 @@ 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 || vr == VK_SUBOPTIMAL_KHR)
> + {
> + if (FAILED(hr = wined3d_swapchain_vk_recreate(swapchain_vk)))
> + ERR("Failed to recreate swapchain, hr %#x.\n", hr);
> + if (vr == VK_ERROR_OUT_OF_DATE_KHR)
> + {
> + if ((vr = VK_CALL(vkQueuePresentKHR(device_vk->vk_queue, &present_desc))))
> + ERR("Present returned vr %s.\n", wined3d_debug_vkresult(vr));
Does that work? I'd expect swapchain image content to be undefined
after recreating the swapchain. (For reference, what I had in mind was
to return a VkResult from wined3d_swapchain_vk_blit(), either from
vkAcquireNextImageKHR() or vkQueuePresentKHR(), and then recreate the
swapchain and redo the blit in the caller.)
More information about the wine-devel
mailing list