aboutsummaryrefslogtreecommitdiff
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
commit581d8f34eeeb251fb969323bcea05734ebf2d832 (patch)
treeb12668b13bce18dc9b628cf77b2d935ca0ab4f71 /src/yuzu/bootmanager.cpp
parent35b4802239d0f7f0365dad6076664ad63c0068e1 (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 4c7bf28d80..01dc51cffc 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);