diff options
| -rw-r--r-- | src/core/settings.h | 1 | ||||
| -rw-r--r-- | src/core/telemetry_session.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_disk_cache.cpp | 21 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.ui | 7 | ||||
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu_cmd/default_ini.h | 4 |
8 files changed, 42 insertions, 0 deletions
diff --git a/src/core/settings.h b/src/core/settings.h index c97387fc7..7e76e0466 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -391,6 +391,7 @@ struct Values { | |||
| 391 | float resolution_factor; | 391 | float resolution_factor; |
| 392 | bool use_frame_limit; | 392 | bool use_frame_limit; |
| 393 | u16 frame_limit; | 393 | u16 frame_limit; |
| 394 | bool use_disk_shader_cache; | ||
| 394 | bool use_accurate_gpu_emulation; | 395 | bool use_accurate_gpu_emulation; |
| 395 | 396 | ||
| 396 | float bg_red; | 397 | float bg_red; |
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index 09ed74d78..58dfcc4df 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp | |||
| @@ -158,6 +158,8 @@ TelemetrySession::TelemetrySession() { | |||
| 158 | AddField(Telemetry::FieldType::UserConfig, "Renderer_UseFrameLimit", | 158 | AddField(Telemetry::FieldType::UserConfig, "Renderer_UseFrameLimit", |
| 159 | Settings::values.use_frame_limit); | 159 | Settings::values.use_frame_limit); |
| 160 | AddField(Telemetry::FieldType::UserConfig, "Renderer_FrameLimit", Settings::values.frame_limit); | 160 | AddField(Telemetry::FieldType::UserConfig, "Renderer_FrameLimit", Settings::values.frame_limit); |
| 161 | AddField(Telemetry::FieldType::UserConfig, "Renderer_UseDiskShaderCache", | ||
| 162 | Settings::values.use_disk_shader_cache); | ||
| 161 | AddField(Telemetry::FieldType::UserConfig, "Renderer_UseAccurateGpuEmulation", | 163 | AddField(Telemetry::FieldType::UserConfig, "Renderer_UseAccurateGpuEmulation", |
| 162 | Settings::values.use_accurate_gpu_emulation); | 164 | Settings::values.use_accurate_gpu_emulation); |
| 163 | AddField(Telemetry::FieldType::UserConfig, "System_UseDockedMode", | 165 | AddField(Telemetry::FieldType::UserConfig, "System_UseDockedMode", |
diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp index 4b0e50b90..6a23b8fe2 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | #include "core/core.h" | 18 | #include "core/core.h" |
| 19 | #include "core/hle/kernel/process.h" | 19 | #include "core/hle/kernel/process.h" |
| 20 | #include "core/settings.h" | ||
| 20 | 21 | ||
| 21 | #include "video_core/renderer_opengl/gl_shader_cache.h" | 22 | #include "video_core/renderer_opengl/gl_shader_cache.h" |
| 22 | #include "video_core/renderer_opengl/gl_shader_disk_cache.h" | 23 | #include "video_core/renderer_opengl/gl_shader_disk_cache.h" |
| @@ -78,6 +79,10 @@ void ShaderDiskCacheRaw::Save(FileUtil::IOFile& file) const { | |||
| 78 | 79 | ||
| 79 | bool ShaderDiskCacheOpenGL::LoadTransferable(std::vector<ShaderDiskCacheRaw>& raws, | 80 | bool ShaderDiskCacheOpenGL::LoadTransferable(std::vector<ShaderDiskCacheRaw>& raws, |
| 80 | std::vector<ShaderDiskCacheUsage>& usages) { | 81 | std::vector<ShaderDiskCacheUsage>& usages) { |
| 82 | if (!Settings::values.use_disk_shader_cache) { | ||
| 83 | return false; | ||
| 84 | } | ||
| 85 | |||
| 81 | FileUtil::IOFile file(GetTransferablePath(), "rb"); | 86 | FileUtil::IOFile file(GetTransferablePath(), "rb"); |
| 82 | if (!file.IsOpen()) { | 87 | if (!file.IsOpen()) { |
| 83 | LOG_INFO(Render_OpenGL, "No transferable shader cache found for game with title id={}", | 88 | LOG_INFO(Render_OpenGL, "No transferable shader cache found for game with title id={}", |
| @@ -129,6 +134,10 @@ bool ShaderDiskCacheOpenGL::LoadTransferable(std::vector<ShaderDiskCacheRaw>& ra | |||
| 129 | } | 134 | } |
| 130 | 135 | ||
| 131 | std::vector<ShaderDiskCachePrecompiledEntry> ShaderDiskCacheOpenGL::LoadPrecompiled() { | 136 | std::vector<ShaderDiskCachePrecompiledEntry> ShaderDiskCacheOpenGL::LoadPrecompiled() { |
| 137 | if (!Settings::values.use_disk_shader_cache) { | ||
| 138 | return {}; | ||
| 139 | } | ||
| 140 | |||
| 132 | FileUtil::IOFile file(GetPrecompiledPath(), "rb"); | 141 | FileUtil::IOFile file(GetPrecompiledPath(), "rb"); |
| 133 | if (!file.IsOpen()) { | 142 | if (!file.IsOpen()) { |
| 134 | LOG_INFO(Render_OpenGL, "No precompiled shader cache found for game with title id={}", | 143 | LOG_INFO(Render_OpenGL, "No precompiled shader cache found for game with title id={}", |
| @@ -173,6 +182,10 @@ void ShaderDiskCacheOpenGL::InvalidatePrecompiled() const { | |||
| 173 | } | 182 | } |
| 174 | 183 | ||
| 175 | void ShaderDiskCacheOpenGL::SaveRaw(const ShaderDiskCacheRaw& entry) { | 184 | void ShaderDiskCacheOpenGL::SaveRaw(const ShaderDiskCacheRaw& entry) { |
| 185 | if (!Settings::values.use_disk_shader_cache) { | ||
| 186 | return; | ||
| 187 | } | ||
| 188 | |||
| 176 | const u64 id = entry.GetUniqueIdentifier(); | 189 | const u64 id = entry.GetUniqueIdentifier(); |
| 177 | if (transferable.find(id) != transferable.end()) { | 190 | if (transferable.find(id) != transferable.end()) { |
| 178 | // The shader already exists | 191 | // The shader already exists |
| @@ -190,6 +203,10 @@ void ShaderDiskCacheOpenGL::SaveRaw(const ShaderDiskCacheRaw& entry) { | |||
| 190 | } | 203 | } |
| 191 | 204 | ||
| 192 | void ShaderDiskCacheOpenGL::SaveUsage(const ShaderDiskCacheUsage& usage) { | 205 | void ShaderDiskCacheOpenGL::SaveUsage(const ShaderDiskCacheUsage& usage) { |
| 206 | if (!Settings::values.use_disk_shader_cache) { | ||
| 207 | return; | ||
| 208 | } | ||
| 209 | |||
| 193 | const auto it = transferable.find(usage.unique_identifier); | 210 | const auto it = transferable.find(usage.unique_identifier); |
| 194 | if (it == transferable.end()) { | 211 | if (it == transferable.end()) { |
| 195 | LOG_CRITICAL(Render_OpenGL, "Saving shader usage without storing raw previously"); | 212 | LOG_CRITICAL(Render_OpenGL, "Saving shader usage without storing raw previously"); |
| @@ -208,6 +225,10 @@ void ShaderDiskCacheOpenGL::SaveUsage(const ShaderDiskCacheUsage& usage) { | |||
| 208 | } | 225 | } |
| 209 | 226 | ||
| 210 | void ShaderDiskCacheOpenGL::SavePrecompiled(const ShaderDiskCacheUsage& usage, GLuint program) { | 227 | void ShaderDiskCacheOpenGL::SavePrecompiled(const ShaderDiskCacheUsage& usage, GLuint program) { |
| 228 | if (!Settings::values.use_disk_shader_cache) { | ||
| 229 | return; | ||
| 230 | } | ||
| 231 | |||
| 211 | FileUtil::IOFile file = AppendPrecompiledFile(); | 232 | FileUtil::IOFile file = AppendPrecompiledFile(); |
| 212 | if (!file.IsOpen()) { | 233 | if (!file.IsOpen()) { |
| 213 | return; | 234 | return; |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index ddf4cf552..e9546dadf 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -370,6 +370,8 @@ void Config::ReadValues() { | |||
| 370 | Settings::values.resolution_factor = qt_config->value("resolution_factor", 1.0).toFloat(); | 370 | Settings::values.resolution_factor = qt_config->value("resolution_factor", 1.0).toFloat(); |
| 371 | Settings::values.use_frame_limit = qt_config->value("use_frame_limit", true).toBool(); | 371 | Settings::values.use_frame_limit = qt_config->value("use_frame_limit", true).toBool(); |
| 372 | Settings::values.frame_limit = qt_config->value("frame_limit", 100).toInt(); | 372 | Settings::values.frame_limit = qt_config->value("frame_limit", 100).toInt(); |
| 373 | Settings::values.use_disk_shader_cache = | ||
| 374 | qt_config->value("use_disk_shader_cache", false).toBool(); | ||
| 373 | Settings::values.use_accurate_gpu_emulation = | 375 | Settings::values.use_accurate_gpu_emulation = |
| 374 | qt_config->value("use_accurate_gpu_emulation", false).toBool(); | 376 | qt_config->value("use_accurate_gpu_emulation", false).toBool(); |
| 375 | 377 | ||
| @@ -629,6 +631,7 @@ void Config::SaveValues() { | |||
| 629 | qt_config->setValue("resolution_factor", (double)Settings::values.resolution_factor); | 631 | qt_config->setValue("resolution_factor", (double)Settings::values.resolution_factor); |
| 630 | qt_config->setValue("use_frame_limit", Settings::values.use_frame_limit); | 632 | qt_config->setValue("use_frame_limit", Settings::values.use_frame_limit); |
| 631 | qt_config->setValue("frame_limit", Settings::values.frame_limit); | 633 | qt_config->setValue("frame_limit", Settings::values.frame_limit); |
| 634 | qt_config->setValue("use_disk_shader_cache", Settings::values.use_disk_shader_cache); | ||
| 632 | qt_config->setValue("use_accurate_gpu_emulation", Settings::values.use_accurate_gpu_emulation); | 635 | qt_config->setValue("use_accurate_gpu_emulation", Settings::values.use_accurate_gpu_emulation); |
| 633 | 636 | ||
| 634 | // Cast to double because Qt's written float values are not human-readable | 637 | // Cast to double because Qt's written float values are not human-readable |
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index d21f95469..0f5dd534b 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp | |||
| @@ -73,6 +73,7 @@ void ConfigureGraphics::setConfiguration() { | |||
| 73 | static_cast<int>(FromResolutionFactor(Settings::values.resolution_factor))); | 73 | static_cast<int>(FromResolutionFactor(Settings::values.resolution_factor))); |
| 74 | ui->toggle_frame_limit->setChecked(Settings::values.use_frame_limit); | 74 | ui->toggle_frame_limit->setChecked(Settings::values.use_frame_limit); |
| 75 | ui->frame_limit->setValue(Settings::values.frame_limit); | 75 | ui->frame_limit->setValue(Settings::values.frame_limit); |
| 76 | ui->use_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache); | ||
| 76 | ui->use_accurate_gpu_emulation->setChecked(Settings::values.use_accurate_gpu_emulation); | 77 | ui->use_accurate_gpu_emulation->setChecked(Settings::values.use_accurate_gpu_emulation); |
| 77 | UpdateBackgroundColorButton(QColor::fromRgbF(Settings::values.bg_red, Settings::values.bg_green, | 78 | UpdateBackgroundColorButton(QColor::fromRgbF(Settings::values.bg_red, Settings::values.bg_green, |
| 78 | Settings::values.bg_blue)); | 79 | Settings::values.bg_blue)); |
| @@ -83,6 +84,7 @@ void ConfigureGraphics::applyConfiguration() { | |||
| 83 | ToResolutionFactor(static_cast<Resolution>(ui->resolution_factor_combobox->currentIndex())); | 84 | ToResolutionFactor(static_cast<Resolution>(ui->resolution_factor_combobox->currentIndex())); |
| 84 | Settings::values.use_frame_limit = ui->toggle_frame_limit->isChecked(); | 85 | Settings::values.use_frame_limit = ui->toggle_frame_limit->isChecked(); |
| 85 | Settings::values.frame_limit = ui->frame_limit->value(); | 86 | Settings::values.frame_limit = ui->frame_limit->value(); |
| 87 | Settings::values.use_disk_shader_cache = ui->use_disk_shader_cache->isChecked(); | ||
| 86 | Settings::values.use_accurate_gpu_emulation = ui->use_accurate_gpu_emulation->isChecked(); | 88 | Settings::values.use_accurate_gpu_emulation = ui->use_accurate_gpu_emulation->isChecked(); |
| 87 | Settings::values.bg_red = static_cast<float>(bg_color.redF()); | 89 | Settings::values.bg_red = static_cast<float>(bg_color.redF()); |
| 88 | Settings::values.bg_green = static_cast<float>(bg_color.greenF()); | 90 | Settings::values.bg_green = static_cast<float>(bg_color.greenF()); |
diff --git a/src/yuzu/configuration/configure_graphics.ui b/src/yuzu/configuration/configure_graphics.ui index e278cdd05..824f5810a 100644 --- a/src/yuzu/configuration/configure_graphics.ui +++ b/src/yuzu/configuration/configure_graphics.ui | |||
| @@ -50,6 +50,13 @@ | |||
| 50 | </layout> | 50 | </layout> |
| 51 | </item> | 51 | </item> |
| 52 | <item> | 52 | <item> |
| 53 | <widget class="QCheckBox" name="use_disk_shader_cache"> | ||
| 54 | <property name="text"> | ||
| 55 | <string>Use disk shader cache</string> | ||
| 56 | </property> | ||
| 57 | </widget> | ||
| 58 | </item> | ||
| 59 | <item> | ||
| 53 | <widget class="QCheckBox" name="use_accurate_gpu_emulation"> | 60 | <widget class="QCheckBox" name="use_accurate_gpu_emulation"> |
| 54 | <property name="text"> | 61 | <property name="text"> |
| 55 | <string>Use accurate GPU emulation (slow)</string> | 62 | <string>Use accurate GPU emulation (slow)</string> |
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 7a77f76e8..ff05b3179 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -350,6 +350,8 @@ void Config::ReadValues() { | |||
| 350 | Settings::values.use_frame_limit = sdl2_config->GetBoolean("Renderer", "use_frame_limit", true); | 350 | Settings::values.use_frame_limit = sdl2_config->GetBoolean("Renderer", "use_frame_limit", true); |
| 351 | Settings::values.frame_limit = | 351 | Settings::values.frame_limit = |
| 352 | static_cast<u16>(sdl2_config->GetInteger("Renderer", "frame_limit", 100)); | 352 | static_cast<u16>(sdl2_config->GetInteger("Renderer", "frame_limit", 100)); |
| 353 | Settings::values.use_disk_shader_cache = | ||
| 354 | sdl2_config->GetBoolean("Renderer", "use_disk_shader_cache", false); | ||
| 353 | Settings::values.use_accurate_gpu_emulation = | 355 | Settings::values.use_accurate_gpu_emulation = |
| 354 | sdl2_config->GetBoolean("Renderer", "use_accurate_gpu_emulation", false); | 356 | sdl2_config->GetBoolean("Renderer", "use_accurate_gpu_emulation", false); |
| 355 | 357 | ||
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index ba51a4a51..a81986f8e 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h | |||
| @@ -110,6 +110,10 @@ use_frame_limit = | |||
| 110 | # 1 - 9999: Speed limit as a percentage of target game speed. 100 (default) | 110 | # 1 - 9999: Speed limit as a percentage of target game speed. 100 (default) |
| 111 | frame_limit = | 111 | frame_limit = |
| 112 | 112 | ||
| 113 | # Whether to use disk based shader cache | ||
| 114 | # 0 (default): Off, 1 : On | ||
| 115 | use_disk_shader_cache = | ||
| 116 | |||
| 113 | # Whether to use accurate GPU emulation | 117 | # Whether to use accurate GPU emulation |
| 114 | # 0 (default): Off (fast), 1 : On (slow) | 118 | # 0 (default): Off (fast), 1 : On (slow) |
| 115 | use_accurate_gpu_emulation = | 119 | use_accurate_gpu_emulation = |