From f1cc8cfea9724881b3715f4c8398b077c422b57d Mon Sep 17 00:00:00 2001 From: wwylele Date: Sun, 13 May 2018 10:45:59 +0300 Subject: [PATCH] citra,citra_qt: load/save hardware shader settings --- src/citra/config.cpp | 5 +++++ src/citra/default_ini.h | 12 ++++++++++++ src/citra_qt/configuration/config.cpp | 7 +++++++ 3 files changed, 24 insertions(+) diff --git a/src/citra/config.cpp b/src/citra/config.cpp index 0ec7bc6b20..b4e3a2ce93 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp @@ -95,6 +95,11 @@ void Config::ReadValues() { // Renderer Settings::values.use_hw_renderer = sdl2_config->GetBoolean("Renderer", "use_hw_renderer", true); + Settings::values.use_hw_shader = sdl2_config->GetBoolean("Renderer", "use_hw_shader", true); + Settings::values.shaders_accurate_gs = + sdl2_config->GetBoolean("Renderer", "shaders_accurate_gs", true); + Settings::values.shaders_accurate_mul = + sdl2_config->GetBoolean("Renderer", "shaders_accurate_mul", false); 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)); diff --git a/src/citra/default_ini.h b/src/citra/default_ini.h index 18be9ec25e..7179d6f94e 100644 --- a/src/citra/default_ini.h +++ b/src/citra/default_ini.h @@ -77,6 +77,18 @@ use_cpu_jit = # 0: Software, 1 (default): Hardware use_hw_renderer = +# Whether to use hardware shaders to emulate 3DS shaders +# 0: Software, 1 (default): Hardware +use_hw_shader = + +# Whether to use accurate multiplication in hardware shaders +# 0: Off (Default. Faster, but causes issues in some games) 1: On (Slower, but correct) +shaders_accurate_mul = + +# Whether to fallback to software for geometry shaders +# 0: Off (Faster, but causes issues in some games) 1: On (Default. Slower, but correct) +shaders_accurate_gs = + # Whether to use the Just-In-Time (JIT) compiler for shader emulation # 0: Interpreter (slow), 1 (default): JIT (fast) use_shader_jit = diff --git a/src/citra_qt/configuration/config.cpp b/src/citra_qt/configuration/config.cpp index ca99856b5e..bdb2966597 100644 --- a/src/citra_qt/configuration/config.cpp +++ b/src/citra_qt/configuration/config.cpp @@ -83,6 +83,10 @@ void Config::ReadValues() { qt_config->beginGroup("Renderer"); Settings::values.use_hw_renderer = qt_config->value("use_hw_renderer", true).toBool(); + Settings::values.use_hw_shader = qt_config->value("use_hw_shader", true).toBool(); + Settings::values.shaders_accurate_gs = qt_config->value("shaders_accurate_gs", true).toBool(); + Settings::values.shaders_accurate_mul = + qt_config->value("shaders_accurate_mul", false).toBool(); Settings::values.use_shader_jit = qt_config->value("use_shader_jit", true).toBool(); Settings::values.resolution_factor = static_cast(qt_config->value("resolution_factor", 1).toInt()); @@ -272,6 +276,9 @@ void Config::SaveValues() { qt_config->beginGroup("Renderer"); qt_config->setValue("use_hw_renderer", Settings::values.use_hw_renderer); + qt_config->setValue("use_hw_shader", Settings::values.use_hw_shader); + qt_config->setValue("shaders_accurate_gs", Settings::values.shaders_accurate_gs); + qt_config->setValue("shaders_accurate_mul", Settings::values.shaders_accurate_mul); qt_config->setValue("use_shader_jit", Settings::values.use_shader_jit); qt_config->setValue("resolution_factor", Settings::values.resolution_factor); qt_config->setValue("use_vsync", Settings::values.use_vsync);