From f45e22b08d147d6fbf90ec49c9bf82aaeddd377f Mon Sep 17 00:00:00 2001 From: BearOso Date: Mon, 4 Sep 2023 11:38:00 -0500 Subject: [PATCH] Qt: Change vsync setting immediately when config changes. --- qt/src/EmuCanvasVulkan.cpp | 3 +++ qt/src/EmuConfig.cpp | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/qt/src/EmuCanvasVulkan.cpp b/qt/src/EmuCanvasVulkan.cpp index d4ad0bba..2e43948f 100644 --- a/qt/src/EmuCanvasVulkan.cpp +++ b/qt/src/EmuCanvasVulkan.cpp @@ -178,6 +178,9 @@ void EmuCanvasVulkan::draw() if (!window->isVisible()) return; + if (context->swapchain->set_vsync(config->enable_vsync)) + context->recreate_swapchain(); + if (S9xImGuiDraw(width() * devicePixelRatioF(), height() * devicePixelRatioF())) { auto draw_data = ImGui::GetDrawData(); diff --git a/qt/src/EmuConfig.cpp b/qt/src/EmuConfig.cpp index c2436ea4..1ab06bae 100644 --- a/qt/src/EmuConfig.cpp +++ b/qt/src/EmuConfig.cpp @@ -225,9 +225,7 @@ bool EmuConfig::setDefaults(int section) restart_set(display_driver, "vulkan"); restart_set(display_device_index, 0); enable_vsync = true; - ; bilinear_filter = true; - ; reduce_input_lag = true; adjust_for_vrr = false; restart_set(use_shader, false);