summaryrefslogtreecommitdiff
path: root/src/yuzu/bootmanager.cpp
diff options
context:
space:
mode:
authorlat9nq <22451773+lat9nq@users.noreply.github.com>2023-04-30 15:39:00 -0400
committerlat9nq <22451773+lat9nq@users.noreply.github.com>2023-05-02 21:51:29 -0400
commit6f0929df82be77f116988cf16cde4ebbc5f978dc (patch)
treeb12668b13bce18dc9b628cf77b2d935ca0ab4f71 /src/yuzu/bootmanager.cpp
parent8f43b05d6b1be260f68907c581b8e3a91cf244d8 (diff)
configuration: Expose separate swap present modes
Previously, yuzu would try and guess which vsync mode to use given different scenarios, but apparently we didn't always get it right. This exposes the separate modes in a drop-down the user can select. If a mode isn't available in Vulkan, it defaults to FIFO.
Diffstat (limited to 'src/yuzu/bootmanager.cpp')
-rw-r--r--src/yuzu/bootmanager.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 4c7bf28d8..01dc51cff 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -154,7 +154,18 @@ public:
// disable vsync for any shared contexts
auto format = share_context->format();
- format.setSwapInterval(main_surface ? Settings::values.use_vsync.GetValue() : 0);
+ const int swap_interval = [&]() {
+ switch (Settings::values.vsync_mode.GetValue()) {
+ case Settings::VSyncMode::Immediate:
+ return 0;
+ case Settings::VSyncMode::FIFO:
+ return 1;
+ case Settings::VSyncMode::Mailbox:
+ return 2;
+ }
+ }();
+
+ format.setSwapInterval(main_surface ? swap_interval : 0);
context = std::make_unique<QOpenGLContext>();
context->setShareContext(share_context);