summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/SwapChain.cpp
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2016-11-13 14:10:58 +0100
committerGitHub <noreply@github.com>2016-11-13 14:10:58 +0100
commitc723532f0db017334870a965553d9b4bcc80f886 (patch)
tree5d36f2197641d65d570f652be296c4c3beed391b /Source/Core/VideoBackends/Vulkan/SwapChain.cpp
parent3b78fec24ebe4143353ea7180048c271d787df93 (diff)
parentc09ce029dfafebb539944e71b8949c6179213f8f (diff)
Merge pull request #4430 from stenzek/vulkan-no-relaxed-vsync
Vulkan: Don't use FIFO_RELAXED present mode for vsync.
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/SwapChain.cpp')
-rw-r--r--Source/Core/VideoBackends/Vulkan/SwapChain.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/SwapChain.cpp b/Source/Core/VideoBackends/Vulkan/SwapChain.cpp
index 899f931c6d..1027099d21 100644
--- a/Source/Core/VideoBackends/Vulkan/SwapChain.cpp
+++ b/Source/Core/VideoBackends/Vulkan/SwapChain.cpp
@@ -198,25 +198,13 @@ bool SwapChain::SelectPresentMode()
return it != present_modes.end();
};
- // If vsync is enabled, prefer VK_PRESENT_MODE_FIFO_KHR.
- if (m_vsync_enabled)
+ // 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))
{
- // Try for relaxed vsync first, since it's likely the VI won't line up with
- // the refresh rate of the system exactly, so tearing once is better than
- // waiting for the next vblank.
- if (CheckForMode(VK_PRESENT_MODE_FIFO_RELAXED_KHR))
- {
- m_present_mode = VK_PRESENT_MODE_FIFO_RELAXED_KHR;
- return true;
- }
-
- // Fall back to strict vsync.
- if (CheckForMode(VK_PRESENT_MODE_FIFO_KHR))
- {
- WARN_LOG(VIDEO, "Vulkan: FIFO_RELAXED not available, falling back to FIFO.");
- m_present_mode = VK_PRESENT_MODE_FIFO_KHR;
- return true;
- }
+ m_present_mode = VK_PRESENT_MODE_FIFO_KHR;
+ return true;
}
// Prefer screen-tearing, if possible, for lowest latency.