1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 19:24:12 +01:00

[d3d9,d3d11] recreate swapchain on VK_SUBOPTIMAL_KHR

The vulkan wayland wsi returns suboptimal when the window is
fullscreened and not directly scanned out, and there are modifiers
available that would allow the window to be directly scanned out.
Recreate the swapchain if we receive suboptimal result.

This allows us recreate the swapchain to use a modifier that allows
direct scan-out under winewayland on wayland compositors.
This commit is contained in:
llyyr 2024-09-11 06:22:22 +05:30 committed by Philip Rebohle
parent c1a25df468
commit 1a1c3a4202
2 changed files with 8 additions and 2 deletions

View File

@ -377,7 +377,7 @@ namespace dxvk {
VkResult status = m_presenter->acquireNextImage(sync, imageIndex); VkResult status = m_presenter->acquireNextImage(sync, imageIndex);
while (status != VK_SUCCESS && status != VK_SUBOPTIMAL_KHR) { while (status != VK_SUCCESS) {
RecreateSwapChain(); RecreateSwapChain();
if (!m_presenter->hasSwapChain()) if (!m_presenter->hasSwapChain())
@ -385,6 +385,9 @@ namespace dxvk {
info = m_presenter->info(); info = m_presenter->info();
status = m_presenter->acquireNextImage(sync, imageIndex); status = m_presenter->acquireNextImage(sync, imageIndex);
if (status == VK_SUBOPTIMAL_KHR)
break;
} }
if (m_hdrMetadata && m_dirtyHdrMetadata) { if (m_hdrMetadata && m_dirtyHdrMetadata) {

View File

@ -799,11 +799,14 @@ namespace dxvk {
VkResult status = m_wctx->presenter->acquireNextImage(sync, imageIndex); VkResult status = m_wctx->presenter->acquireNextImage(sync, imageIndex);
while (status != VK_SUCCESS && status != VK_SUBOPTIMAL_KHR) { while (status != VK_SUCCESS) {
RecreateSwapChain(); RecreateSwapChain();
info = m_wctx->presenter->info(); info = m_wctx->presenter->info();
status = m_wctx->presenter->acquireNextImage(sync, imageIndex); status = m_wctx->presenter->acquireNextImage(sync, imageIndex);
if (status == VK_SUBOPTIMAL_KHR)
break;
} }
if (m_hdrMetadata && m_dirtyHdrMetadata) { if (m_hdrMetadata && m_dirtyHdrMetadata) {