From 1302c9c1e76778be090d2d23670e91e5e04197c5 Mon Sep 17 00:00:00 2001 From: fearlessTobi Date: Thu, 29 Nov 2018 17:07:18 +0100 Subject: [PATCH] frontend: Remove V-Sync option from UI The V-Sync option is fundamentally broken in Citra, so let's do the same as yuzu and remove it entirely for SDL2 and at least from the frontend for QT. (It was also only used by 7.3% of users) --- src/citra/config.cpp | 2 +- src/citra/default_ini.h | 2 +- src/citra/emu_window/emu_window_sdl2.cpp | 2 +- src/citra_qt/bootmanager.cpp | 2 +- src/citra_qt/configuration/config.cpp | 4 ++-- src/citra_qt/configuration/configure_graphics.cpp | 3 --- src/citra_qt/configuration/configure_graphics.ui | 7 ------- src/core/settings.cpp | 2 +- src/core/settings.h | 2 +- src/core/telemetry_session.cpp | 2 +- 10 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/citra/config.cpp b/src/citra/config.cpp index 3372f2d7ab..b3794f2cc9 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp @@ -121,7 +121,7 @@ void Config::ReadValues() { Settings::values.use_shader_jit = sdl2_config->GetBoolean("Renderer", "use_shader_jit", true); Settings::values.resolution_factor = static_cast(sdl2_config->GetInteger("Renderer", "resolution_factor", 1)); - Settings::values.use_vsync = sdl2_config->GetBoolean("Renderer", "use_vsync", false); + Settings::values.vsync_enabled = sdl2_config->GetBoolean("Renderer", "vsync_enabled", false); Settings::values.use_frame_limit = sdl2_config->GetBoolean("Renderer", "use_frame_limit", true); Settings::values.frame_limit = static_cast(sdl2_config->GetInteger("Renderer", "frame_limit", 100)); diff --git a/src/citra/default_ini.h b/src/citra/default_ini.h index b7596d54a8..35edcbaaac 100644 --- a/src/citra/default_ini.h +++ b/src/citra/default_ini.h @@ -119,7 +119,7 @@ resolution_factor = # Whether to enable V-Sync (caps the framerate at 60FPS) or not. # 0 (default): Off, 1: On -use_vsync = +vsync_enabled = # Turns on the frame limiter, which will limit frames output to the target game speed # 0: Off, 1: On (default) diff --git a/src/citra/emu_window/emu_window_sdl2.cpp b/src/citra/emu_window/emu_window_sdl2.cpp index 175480fda7..2da55bd29c 100644 --- a/src/citra/emu_window/emu_window_sdl2.cpp +++ b/src/citra/emu_window/emu_window_sdl2.cpp @@ -163,7 +163,7 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { OnResize(); OnMinimalClientAreaChangeRequest(GetActiveConfig().min_client_area_size); SDL_PumpEvents(); - SDL_GL_SetSwapInterval(Settings::values.use_vsync); + SDL_GL_SetSwapInterval(Settings::values.vsync_enabled); LOG_INFO(Frontend, "Citra Version: {} | {}-{}", Common::g_build_fullname, Common::g_scm_branch, Common::g_scm_desc); Settings::LogSettings(); diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index ef47dcf9c9..1d62d3c02c 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -315,7 +315,7 @@ void GRenderWindow::InitRenderTarget() { QGLFormat fmt; fmt.setVersion(3, 3); fmt.setProfile(QGLFormat::CoreProfile); - fmt.setSwapInterval(Settings::values.use_vsync); + fmt.setSwapInterval(Settings::values.vsync_enabled); // Requests a forward-compatible context, which is required to get a 3.2+ context on OS X fmt.setOption(QGL::NoDeprecatedFunctions); diff --git a/src/citra_qt/configuration/config.cpp b/src/citra_qt/configuration/config.cpp index 19e94715c7..c6e5647bc5 100644 --- a/src/citra_qt/configuration/config.cpp +++ b/src/citra_qt/configuration/config.cpp @@ -137,7 +137,7 @@ void Config::ReadValues() { Settings::values.use_shader_jit = ReadSetting("use_shader_jit", true).toBool(); Settings::values.resolution_factor = static_cast(ReadSetting("resolution_factor", 1).toInt()); - Settings::values.use_vsync = ReadSetting("use_vsync", false).toBool(); + Settings::values.vsync_enabled = ReadSetting("vsync_enabled", false).toBool(); Settings::values.use_frame_limit = ReadSetting("use_frame_limit", true).toBool(); Settings::values.frame_limit = ReadSetting("frame_limit", 100).toInt(); @@ -426,7 +426,7 @@ void Config::SaveValues() { WriteSetting("shaders_accurate_mul", Settings::values.shaders_accurate_mul, false); WriteSetting("use_shader_jit", Settings::values.use_shader_jit, true); WriteSetting("resolution_factor", Settings::values.resolution_factor, 1); - WriteSetting("use_vsync", Settings::values.use_vsync, false); + WriteSetting("vsync_enabled", Settings::values.vsync_enabled, false); WriteSetting("use_frame_limit", Settings::values.use_frame_limit, true); WriteSetting("frame_limit", Settings::values.frame_limit, 100); diff --git a/src/citra_qt/configuration/configure_graphics.cpp b/src/citra_qt/configuration/configure_graphics.cpp index 4bbb7d19f3..c51b39ca34 100644 --- a/src/citra_qt/configuration/configure_graphics.cpp +++ b/src/citra_qt/configuration/configure_graphics.cpp @@ -17,7 +17,6 @@ ConfigureGraphics::ConfigureGraphics(QWidget* parent) ui->setupUi(this); this->setConfiguration(); - ui->toggle_vsync->setEnabled(!Core::System::GetInstance().IsPoweredOn()); ui->frame_limit->setEnabled(Settings::values.use_frame_limit); connect(ui->toggle_frame_limit, &QCheckBox::stateChanged, ui->frame_limit, &QSpinBox::setEnabled); @@ -61,7 +60,6 @@ void ConfigureGraphics::setConfiguration() { ui->toggle_accurate_mul->setChecked(Settings::values.shaders_accurate_mul); ui->toggle_shader_jit->setChecked(Settings::values.use_shader_jit); ui->resolution_factor_combobox->setCurrentIndex(Settings::values.resolution_factor); - ui->toggle_vsync->setChecked(Settings::values.use_vsync); ui->toggle_frame_limit->setChecked(Settings::values.use_frame_limit); ui->frame_limit->setValue(Settings::values.frame_limit); ui->factor_3d->setValue(Settings::values.factor_3d); @@ -82,7 +80,6 @@ void ConfigureGraphics::applyConfiguration() { Settings::values.use_shader_jit = ui->toggle_shader_jit->isChecked(); Settings::values.resolution_factor = static_cast(ui->resolution_factor_combobox->currentIndex()); - Settings::values.use_vsync = ui->toggle_vsync->isChecked(); Settings::values.use_frame_limit = ui->toggle_frame_limit->isChecked(); Settings::values.frame_limit = ui->frame_limit->value(); Settings::values.factor_3d = ui->factor_3d->value(); diff --git a/src/citra_qt/configuration/configure_graphics.ui b/src/citra_qt/configuration/configure_graphics.ui index 040c5e3979..64f5df3cf8 100644 --- a/src/citra_qt/configuration/configure_graphics.ui +++ b/src/citra_qt/configuration/configure_graphics.ui @@ -20,13 +20,6 @@ General - - - - Enable V-Sync - - - diff --git a/src/core/settings.cpp b/src/core/settings.cpp index ae2ed5cf2e..88c88dc8c4 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -73,7 +73,7 @@ void LogSettings() { LogSetting("Renderer_ShadersAccurateMul", Settings::values.shaders_accurate_mul); LogSetting("Renderer_UseShaderJit", Settings::values.use_shader_jit); LogSetting("Renderer_UseResolutionFactor", Settings::values.resolution_factor); - LogSetting("Renderer_UseVsync", Settings::values.use_vsync); + LogSetting("Renderer_VsyncEnabled", Settings::values.vsync_enabled); LogSetting("Renderer_UseFrameLimit", Settings::values.use_frame_limit); LogSetting("Renderer_FrameLimit", Settings::values.frame_limit); LogSetting("Layout_Toggle3d", Settings::values.toggle_3d); diff --git a/src/core/settings.h b/src/core/settings.h index 907e58c973..efe637dd4f 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -135,7 +135,7 @@ struct Values { bool shaders_accurate_mul; bool use_shader_jit; u16 resolution_factor; - bool use_vsync; + bool vsync_enabled; bool use_frame_limit; u16 frame_limit; diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index b6c18cf963..da2cfb5c72 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp @@ -177,7 +177,7 @@ TelemetrySession::TelemetrySession() { Settings::values.shaders_accurate_mul); AddField(Telemetry::FieldType::UserConfig, "Renderer_UseShaderJit", Settings::values.use_shader_jit); - AddField(Telemetry::FieldType::UserConfig, "Renderer_UseVsync", Settings::values.use_vsync); + AddField(Telemetry::FieldType::UserConfig, "Renderer_UseVsync", Settings::values.vsync_enabled); AddField(Telemetry::FieldType::UserConfig, "Renderer_Toggle3d", Settings::values.toggle_3d); AddField(Telemetry::FieldType::UserConfig, "Renderer_Factor3d", Settings::values.factor_3d); AddField(Telemetry::FieldType::UserConfig, "System_IsNew3ds", Settings::values.is_new_3ds);