Actions
Emulator Issues #10552
closedVulkan presentation modes issue
Status:
Invalid
Priority:
Normal
Assignee:
-
% Done:
0%
Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:
Description
In Source/Core/VideoBackends/Vulkan/SwapChain.cpp (as of Dolphin-5551), the SwapChain::SelectPresentMode() function is used to select the Vulkan presentation mode. (See below.)
If vsync is enabled, VK_PRESENT_MODE_FIFO_KHR will always be used, since that must be supported by the driver. But the "Use optimized-vsync above vsync" comment suggests that VK_PRESENT_MODE_MAILBOX_KHR should be used in preference to VK_PRESENT_MODE_FIFO_KHR. Currently VK_PRESENT_MODE_MAILBOX_KHR will only be used when the vsync option is not enabled, and the driver doesn't support VK_PRESENT_MODE_IMMEDIATE_KHR.
Also, in the non-vsync case, should you try for VK_PRESENT_MODE_FIFO_RELAXED_KHR if VK_PRESENT_MODE_IMMEDIATE_KHR is not available?
bool SwapChain::SelectPresentMode()
{
... stuff deleted ...
// If vsync is enabled, use VK_PRESENT_MODE_FIFO_KHR.
// This check should not fail with conforming drivers, as the FIFO present mode is mandated by
// the specification (VK_KHR_swapchain). In case it isn't though, fall through to any other mode.
if (m_vsync_enabled && CheckForMode(VK_PRESENT_MODE_FIFO_KHR))
{
m_present_mode = VK_PRESENT_MODE_FIFO_KHR;
return true;
}
// Prefer screen-tearing, if possible, for lowest latency.
if (CheckForMode(VK_PRESENT_MODE_IMMEDIATE_KHR))
{
m_present_mode = VK_PRESENT_MODE_IMMEDIATE_KHR;
return true;
}
// Use optimized-vsync above vsync.
if (CheckForMode(VK_PRESENT_MODE_MAILBOX_KHR))
{
m_present_mode = VK_PRESENT_MODE_MAILBOX_KHR;
return true;
}
// Fall back to whatever is available.
m_present_mode = present_modes[0];
return true;
}
Actions