Skip to content

Commit

Permalink
d3d{9,11}_swapchain: recreate swapchain on VK_SUBOPTIMAL_KHR
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
llyyr committed Sep 11, 2024
1 parent 565ec7e commit ce75e9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/d3d11/d3d11_swapchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ namespace dxvk {

VkResult status = m_presenter->acquireNextImage(sync, imageIndex);

while (status != VK_SUCCESS && status != VK_SUBOPTIMAL_KHR) {
while (status != VK_SUCCESS) {
RecreateSwapChain();

if (!m_presenter->hasSwapChain())
Expand Down
2 changes: 1 addition & 1 deletion src/d3d9/d3d9_swapchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ namespace dxvk {

VkResult status = m_wctx->presenter->acquireNextImage(sync, imageIndex);

while (status != VK_SUCCESS && status != VK_SUBOPTIMAL_KHR) {
while (status != VK_SUCCESS) {
RecreateSwapChain();

info = m_wctx->presenter->info();
Expand Down

0 comments on commit ce75e9a

Please sign in to comment.