diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/settings.cpp | 4 | ||||
| -rw-r--r-- | src/common/settings.h | 8 | ||||
| -rw-r--r-- | src/core/telemetry_session.cpp | 16 | ||||
| -rw-r--r-- | src/video_core/command_classes/codecs/codec.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/video_core.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 7 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.h | 1 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 42 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.h | 1 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.ui | 51 | ||||
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu_cmd/default_ini.h | 6 |
12 files changed, 120 insertions, 27 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 996315999..33665eab8 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -54,7 +54,7 @@ void LogSettings() { | |||
| 54 | log_setting("Renderer_GPUAccuracyLevel", values.gpu_accuracy.GetValue()); | 54 | log_setting("Renderer_GPUAccuracyLevel", values.gpu_accuracy.GetValue()); |
| 55 | log_setting("Renderer_UseAsynchronousGpuEmulation", | 55 | log_setting("Renderer_UseAsynchronousGpuEmulation", |
| 56 | values.use_asynchronous_gpu_emulation.GetValue()); | 56 | values.use_asynchronous_gpu_emulation.GetValue()); |
| 57 | log_setting("Renderer_UseNvdecEmulation", values.use_nvdec_emulation.GetValue()); | 57 | log_setting("Renderer_NvdecEmulation", values.nvdec_emulation.GetValue()); |
| 58 | log_setting("Renderer_AccelerateASTC", values.accelerate_astc.GetValue()); | 58 | log_setting("Renderer_AccelerateASTC", values.accelerate_astc.GetValue()); |
| 59 | log_setting("Renderer_UseVsync", values.use_vsync.GetValue()); | 59 | log_setting("Renderer_UseVsync", values.use_vsync.GetValue()); |
| 60 | log_setting("Renderer_ShaderBackend", values.shader_backend.GetValue()); | 60 | log_setting("Renderer_ShaderBackend", values.shader_backend.GetValue()); |
| @@ -137,7 +137,7 @@ void RestoreGlobalState(bool is_powered_on) { | |||
| 137 | values.use_disk_shader_cache.SetGlobal(true); | 137 | values.use_disk_shader_cache.SetGlobal(true); |
| 138 | values.gpu_accuracy.SetGlobal(true); | 138 | values.gpu_accuracy.SetGlobal(true); |
| 139 | values.use_asynchronous_gpu_emulation.SetGlobal(true); | 139 | values.use_asynchronous_gpu_emulation.SetGlobal(true); |
| 140 | values.use_nvdec_emulation.SetGlobal(true); | 140 | values.nvdec_emulation.SetGlobal(true); |
| 141 | values.accelerate_astc.SetGlobal(true); | 141 | values.accelerate_astc.SetGlobal(true); |
| 142 | values.use_vsync.SetGlobal(true); | 142 | values.use_vsync.SetGlobal(true); |
| 143 | values.shader_backend.SetGlobal(true); | 143 | values.shader_backend.SetGlobal(true); |
diff --git a/src/common/settings.h b/src/common/settings.h index 1ba9b606c..28074c1b9 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -48,6 +48,12 @@ enum class FullscreenMode : u32 { | |||
| 48 | Exclusive = 1, | 48 | Exclusive = 1, |
| 49 | }; | 49 | }; |
| 50 | 50 | ||
| 51 | enum class NvdecEmulation : u32 { | ||
| 52 | Off = 0, | ||
| 53 | CPU = 1, | ||
| 54 | GPU = 2, | ||
| 55 | }; | ||
| 56 | |||
| 51 | /** The BasicSetting class is a simple resource manager. It defines a label and default value | 57 | /** The BasicSetting class is a simple resource manager. It defines a label and default value |
| 52 | * alongside the actual value of the setting for simpler and less-error prone use with frontend | 58 | * alongside the actual value of the setting for simpler and less-error prone use with frontend |
| 53 | * configurations. Setting a default value and label is required, though subclasses may deviate from | 59 | * configurations. Setting a default value and label is required, though subclasses may deviate from |
| @@ -466,7 +472,7 @@ struct Values { | |||
| 466 | RangedSetting<GPUAccuracy> gpu_accuracy{GPUAccuracy::High, GPUAccuracy::Normal, | 472 | RangedSetting<GPUAccuracy> gpu_accuracy{GPUAccuracy::High, GPUAccuracy::Normal, |
| 467 | GPUAccuracy::Extreme, "gpu_accuracy"}; | 473 | GPUAccuracy::Extreme, "gpu_accuracy"}; |
| 468 | Setting<bool> use_asynchronous_gpu_emulation{true, "use_asynchronous_gpu_emulation"}; | 474 | Setting<bool> use_asynchronous_gpu_emulation{true, "use_asynchronous_gpu_emulation"}; |
| 469 | Setting<bool> use_nvdec_emulation{true, "use_nvdec_emulation"}; | 475 | Setting<NvdecEmulation> nvdec_emulation{NvdecEmulation::GPU, "nvdec_emulation"}; |
| 470 | Setting<bool> accelerate_astc{true, "accelerate_astc"}; | 476 | Setting<bool> accelerate_astc{true, "accelerate_astc"}; |
| 471 | Setting<bool> use_vsync{true, "use_vsync"}; | 477 | Setting<bool> use_vsync{true, "use_vsync"}; |
| 472 | BasicRangedSetting<u16> fps_cap{1000, 1, 1000, "fps_cap"}; | 478 | BasicRangedSetting<u16> fps_cap{1000, 1, 1000, "fps_cap"}; |
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index 5a8cfd301..1f1607998 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp | |||
| @@ -72,6 +72,18 @@ static const char* TranslateGPUAccuracyLevel(Settings::GPUAccuracy backend) { | |||
| 72 | return "Unknown"; | 72 | return "Unknown"; |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | static const char* TranslateNvdecEmulation(Settings::NvdecEmulation backend) { | ||
| 76 | switch (backend) { | ||
| 77 | case Settings::NvdecEmulation::Off: | ||
| 78 | return "Off"; | ||
| 79 | case Settings::NvdecEmulation::CPU: | ||
| 80 | return "CPU"; | ||
| 81 | case Settings::NvdecEmulation::GPU: | ||
| 82 | return "GPU"; | ||
| 83 | } | ||
| 84 | return "Unknown"; | ||
| 85 | } | ||
| 86 | |||
| 75 | u64 GetTelemetryId() { | 87 | u64 GetTelemetryId() { |
| 76 | u64 telemetry_id{}; | 88 | u64 telemetry_id{}; |
| 77 | const auto filename = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ConfigDir) / "telemetry_id"; | 89 | const auto filename = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ConfigDir) / "telemetry_id"; |
| @@ -229,8 +241,8 @@ void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader, | |||
| 229 | TranslateGPUAccuracyLevel(Settings::values.gpu_accuracy.GetValue())); | 241 | TranslateGPUAccuracyLevel(Settings::values.gpu_accuracy.GetValue())); |
| 230 | AddField(field_type, "Renderer_UseAsynchronousGpuEmulation", | 242 | AddField(field_type, "Renderer_UseAsynchronousGpuEmulation", |
| 231 | Settings::values.use_asynchronous_gpu_emulation.GetValue()); | 243 | Settings::values.use_asynchronous_gpu_emulation.GetValue()); |
| 232 | AddField(field_type, "Renderer_UseNvdecEmulation", | 244 | AddField(field_type, "Renderer_NvdecEmulation", |
| 233 | Settings::values.use_nvdec_emulation.GetValue()); | 245 | TranslateNvdecEmulation(Settings::values.nvdec_emulation.GetValue())); |
| 234 | AddField(field_type, "Renderer_AccelerateASTC", Settings::values.accelerate_astc.GetValue()); | 246 | AddField(field_type, "Renderer_AccelerateASTC", Settings::values.accelerate_astc.GetValue()); |
| 235 | AddField(field_type, "Renderer_UseVsync", Settings::values.use_vsync.GetValue()); | 247 | AddField(field_type, "Renderer_UseVsync", Settings::values.use_vsync.GetValue()); |
| 236 | AddField(field_type, "Renderer_ShaderBackend", | 248 | AddField(field_type, "Renderer_ShaderBackend", |
diff --git a/src/video_core/command_classes/codecs/codec.cpp b/src/video_core/command_classes/codecs/codec.cpp index 18aa40ca3..61966cbfe 100644 --- a/src/video_core/command_classes/codecs/codec.cpp +++ b/src/video_core/command_classes/codecs/codec.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <fstream> | 5 | #include <fstream> |
| 6 | #include <vector> | 6 | #include <vector> |
| 7 | #include "common/assert.h" | 7 | #include "common/assert.h" |
| 8 | #include "common/settings.h" | ||
| 8 | #include "video_core/command_classes/codecs/codec.h" | 9 | #include "video_core/command_classes/codecs/codec.h" |
| 9 | #include "video_core/command_classes/codecs/h264.h" | 10 | #include "video_core/command_classes/codecs/h264.h" |
| 10 | #include "video_core/command_classes/codecs/vp9.h" | 11 | #include "video_core/command_classes/codecs/vp9.h" |
| @@ -142,8 +143,11 @@ void Codec::Initialize() { | |||
| 142 | } | 143 | } |
| 143 | }(); | 144 | }(); |
| 144 | av_codec = avcodec_find_decoder(codec); | 145 | av_codec = avcodec_find_decoder(codec); |
| 146 | |||
| 145 | InitializeAvCodecContext(); | 147 | InitializeAvCodecContext(); |
| 146 | InitializeGpuDecoder(); | 148 | if (Settings::values.nvdec_emulation.GetValue() == Settings::NvdecEmulation::GPU) { |
| 149 | InitializeGpuDecoder(); | ||
| 150 | } | ||
| 147 | if (const int res = avcodec_open2(av_codec_ctx, av_codec, nullptr); res < 0) { | 151 | if (const int res = avcodec_open2(av_codec_ctx, av_codec, nullptr); res < 0) { |
| 148 | LOG_ERROR(Service_NVDRV, "avcodec_open2() Failed with result {}", res); | 152 | LOG_ERROR(Service_NVDRV, "avcodec_open2() Failed with result {}", res); |
| 149 | avcodec_free_context(&av_codec_ctx); | 153 | avcodec_free_context(&av_codec_ctx); |
diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index 3b575db4d..cae543a51 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp | |||
| @@ -37,7 +37,8 @@ std::unique_ptr<VideoCore::RendererBase> CreateRenderer( | |||
| 37 | namespace VideoCore { | 37 | namespace VideoCore { |
| 38 | 38 | ||
| 39 | std::unique_ptr<Tegra::GPU> CreateGPU(Core::Frontend::EmuWindow& emu_window, Core::System& system) { | 39 | std::unique_ptr<Tegra::GPU> CreateGPU(Core::Frontend::EmuWindow& emu_window, Core::System& system) { |
| 40 | const bool use_nvdec = Settings::values.use_nvdec_emulation.GetValue(); | 40 | const auto nvdec_value = Settings::values.nvdec_emulation.GetValue(); |
| 41 | const bool use_nvdec = nvdec_value != Settings::NvdecEmulation::Off; | ||
| 41 | const bool use_async = Settings::values.use_asynchronous_gpu_emulation.GetValue(); | 42 | const bool use_async = Settings::values.use_asynchronous_gpu_emulation.GetValue(); |
| 42 | auto gpu = std::make_unique<Tegra::GPU>(system, use_async, use_nvdec); | 43 | auto gpu = std::make_unique<Tegra::GPU>(system, use_async, use_nvdec); |
| 43 | auto context = emu_window.CreateSharedContext(); | 44 | auto context = emu_window.CreateSharedContext(); |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 380379eb4..6aec3c46c 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -811,7 +811,7 @@ void Config::ReadRendererValues() { | |||
| 811 | ReadGlobalSetting(Settings::values.use_disk_shader_cache); | 811 | ReadGlobalSetting(Settings::values.use_disk_shader_cache); |
| 812 | ReadGlobalSetting(Settings::values.gpu_accuracy); | 812 | ReadGlobalSetting(Settings::values.gpu_accuracy); |
| 813 | ReadGlobalSetting(Settings::values.use_asynchronous_gpu_emulation); | 813 | ReadGlobalSetting(Settings::values.use_asynchronous_gpu_emulation); |
| 814 | ReadGlobalSetting(Settings::values.use_nvdec_emulation); | 814 | ReadGlobalSetting(Settings::values.nvdec_emulation); |
| 815 | ReadGlobalSetting(Settings::values.accelerate_astc); | 815 | ReadGlobalSetting(Settings::values.accelerate_astc); |
| 816 | ReadGlobalSetting(Settings::values.use_vsync); | 816 | ReadGlobalSetting(Settings::values.use_vsync); |
| 817 | ReadGlobalSetting(Settings::values.shader_backend); | 817 | ReadGlobalSetting(Settings::values.shader_backend); |
| @@ -1348,7 +1348,10 @@ void Config::SaveRendererValues() { | |||
| 1348 | static_cast<u32>(Settings::values.gpu_accuracy.GetDefault()), | 1348 | static_cast<u32>(Settings::values.gpu_accuracy.GetDefault()), |
| 1349 | Settings::values.gpu_accuracy.UsingGlobal()); | 1349 | Settings::values.gpu_accuracy.UsingGlobal()); |
| 1350 | WriteGlobalSetting(Settings::values.use_asynchronous_gpu_emulation); | 1350 | WriteGlobalSetting(Settings::values.use_asynchronous_gpu_emulation); |
| 1351 | WriteGlobalSetting(Settings::values.use_nvdec_emulation); | 1351 | WriteSetting(QString::fromStdString(Settings::values.nvdec_emulation.GetLabel()), |
| 1352 | static_cast<u32>(Settings::values.nvdec_emulation.GetValue(global)), | ||
| 1353 | static_cast<u32>(Settings::values.nvdec_emulation.GetDefault()), | ||
| 1354 | Settings::values.nvdec_emulation.UsingGlobal()); | ||
| 1352 | WriteGlobalSetting(Settings::values.accelerate_astc); | 1355 | WriteGlobalSetting(Settings::values.accelerate_astc); |
| 1353 | WriteGlobalSetting(Settings::values.use_vsync); | 1356 | WriteGlobalSetting(Settings::values.use_vsync); |
| 1354 | WriteSetting(QString::fromStdString(Settings::values.shader_backend.GetLabel()), | 1357 | WriteSetting(QString::fromStdString(Settings::values.shader_backend.GetLabel()), |
diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h index c1d7feb9f..334623997 100644 --- a/src/yuzu/configuration/config.h +++ b/src/yuzu/configuration/config.h | |||
| @@ -182,5 +182,6 @@ private: | |||
| 182 | Q_DECLARE_METATYPE(Settings::CPUAccuracy); | 182 | Q_DECLARE_METATYPE(Settings::CPUAccuracy); |
| 183 | Q_DECLARE_METATYPE(Settings::GPUAccuracy); | 183 | Q_DECLARE_METATYPE(Settings::GPUAccuracy); |
| 184 | Q_DECLARE_METATYPE(Settings::FullscreenMode); | 184 | Q_DECLARE_METATYPE(Settings::FullscreenMode); |
| 185 | Q_DECLARE_METATYPE(Settings::NvdecEmulation); | ||
| 185 | Q_DECLARE_METATYPE(Settings::RendererBackend); | 186 | Q_DECLARE_METATYPE(Settings::RendererBackend); |
| 186 | Q_DECLARE_METATYPE(Settings::ShaderBackend); | 187 | Q_DECLARE_METATYPE(Settings::ShaderBackend); |
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 37e896258..c594164be 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp | |||
| @@ -88,24 +88,30 @@ void ConfigureGraphics::SetConfiguration() { | |||
| 88 | ui->api_widget->setEnabled(runtime_lock); | 88 | ui->api_widget->setEnabled(runtime_lock); |
| 89 | ui->use_asynchronous_gpu_emulation->setEnabled(runtime_lock); | 89 | ui->use_asynchronous_gpu_emulation->setEnabled(runtime_lock); |
| 90 | ui->use_disk_shader_cache->setEnabled(runtime_lock); | 90 | ui->use_disk_shader_cache->setEnabled(runtime_lock); |
| 91 | ui->use_nvdec_emulation->setEnabled(runtime_lock); | 91 | ui->nvdec_emulation_widget->setEnabled(runtime_lock); |
| 92 | ui->accelerate_astc->setEnabled(runtime_lock); | 92 | ui->accelerate_astc->setEnabled(runtime_lock); |
| 93 | ui->use_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache.GetValue()); | 93 | ui->use_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache.GetValue()); |
| 94 | ui->use_asynchronous_gpu_emulation->setChecked( | 94 | ui->use_asynchronous_gpu_emulation->setChecked( |
| 95 | Settings::values.use_asynchronous_gpu_emulation.GetValue()); | 95 | Settings::values.use_asynchronous_gpu_emulation.GetValue()); |
| 96 | ui->use_nvdec_emulation->setChecked(Settings::values.use_nvdec_emulation.GetValue()); | ||
| 97 | ui->accelerate_astc->setChecked(Settings::values.accelerate_astc.GetValue()); | 96 | ui->accelerate_astc->setChecked(Settings::values.accelerate_astc.GetValue()); |
| 98 | 97 | ||
| 99 | if (Settings::IsConfiguringGlobal()) { | 98 | if (Settings::IsConfiguringGlobal()) { |
| 100 | ui->api->setCurrentIndex(static_cast<int>(Settings::values.renderer_backend.GetValue())); | 99 | ui->api->setCurrentIndex(static_cast<int>(Settings::values.renderer_backend.GetValue())); |
| 101 | ui->fullscreen_mode_combobox->setCurrentIndex( | 100 | ui->fullscreen_mode_combobox->setCurrentIndex( |
| 102 | static_cast<int>(Settings::values.fullscreen_mode.GetValue())); | 101 | static_cast<int>(Settings::values.fullscreen_mode.GetValue())); |
| 102 | ui->nvdec_emulation->setCurrentIndex( | ||
| 103 | static_cast<int>(Settings::values.nvdec_emulation.GetValue())); | ||
| 103 | ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio.GetValue()); | 104 | ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio.GetValue()); |
| 104 | } else { | 105 | } else { |
| 105 | ConfigurationShared::SetPerGameSetting(ui->api, &Settings::values.renderer_backend); | 106 | ConfigurationShared::SetPerGameSetting(ui->api, &Settings::values.renderer_backend); |
| 106 | ConfigurationShared::SetHighlight(ui->api_widget, | 107 | ConfigurationShared::SetHighlight(ui->api_widget, |
| 107 | !Settings::values.renderer_backend.UsingGlobal()); | 108 | !Settings::values.renderer_backend.UsingGlobal()); |
| 108 | 109 | ||
| 110 | ConfigurationShared::SetPerGameSetting(ui->nvdec_emulation, | ||
| 111 | &Settings::values.nvdec_emulation); | ||
| 112 | ConfigurationShared::SetHighlight(ui->nvdec_emulation_widget, | ||
| 113 | !Settings::values.nvdec_emulation.UsingGlobal()); | ||
| 114 | |||
| 109 | ConfigurationShared::SetPerGameSetting(ui->fullscreen_mode_combobox, | 115 | ConfigurationShared::SetPerGameSetting(ui->fullscreen_mode_combobox, |
| 110 | &Settings::values.fullscreen_mode); | 116 | &Settings::values.fullscreen_mode); |
| 111 | ConfigurationShared::SetHighlight(ui->fullscreen_mode_label, | 117 | ConfigurationShared::SetHighlight(ui->fullscreen_mode_label, |
| @@ -137,8 +143,6 @@ void ConfigureGraphics::ApplyConfiguration() { | |||
| 137 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_asynchronous_gpu_emulation, | 143 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_asynchronous_gpu_emulation, |
| 138 | ui->use_asynchronous_gpu_emulation, | 144 | ui->use_asynchronous_gpu_emulation, |
| 139 | use_asynchronous_gpu_emulation); | 145 | use_asynchronous_gpu_emulation); |
| 140 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_nvdec_emulation, | ||
| 141 | ui->use_nvdec_emulation, use_nvdec_emulation); | ||
| 142 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.accelerate_astc, ui->accelerate_astc, | 146 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.accelerate_astc, ui->accelerate_astc, |
| 143 | accelerate_astc); | 147 | accelerate_astc); |
| 144 | 148 | ||
| @@ -147,6 +151,9 @@ void ConfigureGraphics::ApplyConfiguration() { | |||
| 147 | if (Settings::values.renderer_backend.UsingGlobal()) { | 151 | if (Settings::values.renderer_backend.UsingGlobal()) { |
| 148 | Settings::values.renderer_backend.SetValue(GetCurrentGraphicsBackend()); | 152 | Settings::values.renderer_backend.SetValue(GetCurrentGraphicsBackend()); |
| 149 | } | 153 | } |
| 154 | if (Settings::values.nvdec_emulation.UsingGlobal()) { | ||
| 155 | Settings::values.nvdec_emulation.SetValue(GetCurrentNvdecEmulation()); | ||
| 156 | } | ||
| 150 | if (Settings::values.shader_backend.UsingGlobal()) { | 157 | if (Settings::values.shader_backend.UsingGlobal()) { |
| 151 | Settings::values.shader_backend.SetValue(shader_backend); | 158 | Settings::values.shader_backend.SetValue(shader_backend); |
| 152 | } | 159 | } |
| @@ -180,6 +187,13 @@ void ConfigureGraphics::ApplyConfiguration() { | |||
| 180 | } | 187 | } |
| 181 | } | 188 | } |
| 182 | 189 | ||
| 190 | if (ui->nvdec_emulation->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { | ||
| 191 | Settings::values.nvdec_emulation.SetGlobal(true); | ||
| 192 | } else { | ||
| 193 | Settings::values.nvdec_emulation.SetGlobal(false); | ||
| 194 | Settings::values.nvdec_emulation.SetValue(GetCurrentNvdecEmulation()); | ||
| 195 | } | ||
| 196 | |||
| 183 | if (ui->bg_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { | 197 | if (ui->bg_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { |
| 184 | Settings::values.bg_red.SetGlobal(true); | 198 | Settings::values.bg_red.SetGlobal(true); |
| 185 | Settings::values.bg_green.SetGlobal(true); | 199 | Settings::values.bg_green.SetGlobal(true); |
| @@ -278,6 +292,20 @@ Settings::RendererBackend ConfigureGraphics::GetCurrentGraphicsBackend() const { | |||
| 278 | ConfigurationShared::USE_GLOBAL_OFFSET); | 292 | ConfigurationShared::USE_GLOBAL_OFFSET); |
| 279 | } | 293 | } |
| 280 | 294 | ||
| 295 | Settings::NvdecEmulation ConfigureGraphics::GetCurrentNvdecEmulation() const { | ||
| 296 | if (Settings::IsConfiguringGlobal()) { | ||
| 297 | return static_cast<Settings::NvdecEmulation>(ui->nvdec_emulation->currentIndex()); | ||
| 298 | } | ||
| 299 | |||
| 300 | if (ui->nvdec_emulation->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { | ||
| 301 | Settings::values.nvdec_emulation.SetGlobal(true); | ||
| 302 | return Settings::values.nvdec_emulation.GetValue(); | ||
| 303 | } | ||
| 304 | Settings::values.nvdec_emulation.SetGlobal(false); | ||
| 305 | return static_cast<Settings::NvdecEmulation>(ui->nvdec_emulation->currentIndex() - | ||
| 306 | ConfigurationShared::USE_GLOBAL_OFFSET); | ||
| 307 | } | ||
| 308 | |||
| 281 | void ConfigureGraphics::SetupPerGameUI() { | 309 | void ConfigureGraphics::SetupPerGameUI() { |
| 282 | if (Settings::IsConfiguringGlobal()) { | 310 | if (Settings::IsConfiguringGlobal()) { |
| 283 | ui->api->setEnabled(Settings::values.renderer_backend.UsingGlobal()); | 311 | ui->api->setEnabled(Settings::values.renderer_backend.UsingGlobal()); |
| @@ -286,7 +314,7 @@ void ConfigureGraphics::SetupPerGameUI() { | |||
| 286 | ui->aspect_ratio_combobox->setEnabled(Settings::values.aspect_ratio.UsingGlobal()); | 314 | ui->aspect_ratio_combobox->setEnabled(Settings::values.aspect_ratio.UsingGlobal()); |
| 287 | ui->use_asynchronous_gpu_emulation->setEnabled( | 315 | ui->use_asynchronous_gpu_emulation->setEnabled( |
| 288 | Settings::values.use_asynchronous_gpu_emulation.UsingGlobal()); | 316 | Settings::values.use_asynchronous_gpu_emulation.UsingGlobal()); |
| 289 | ui->use_nvdec_emulation->setEnabled(Settings::values.use_nvdec_emulation.UsingGlobal()); | 317 | ui->nvdec_emulation->setEnabled(Settings::values.nvdec_emulation.UsingGlobal()); |
| 290 | ui->accelerate_astc->setEnabled(Settings::values.accelerate_astc.UsingGlobal()); | 318 | ui->accelerate_astc->setEnabled(Settings::values.accelerate_astc.UsingGlobal()); |
| 291 | ui->use_disk_shader_cache->setEnabled(Settings::values.use_disk_shader_cache.UsingGlobal()); | 319 | ui->use_disk_shader_cache->setEnabled(Settings::values.use_disk_shader_cache.UsingGlobal()); |
| 292 | ui->bg_button->setEnabled(Settings::values.bg_red.UsingGlobal()); | 320 | ui->bg_button->setEnabled(Settings::values.bg_red.UsingGlobal()); |
| @@ -301,8 +329,6 @@ void ConfigureGraphics::SetupPerGameUI() { | |||
| 301 | 329 | ||
| 302 | ConfigurationShared::SetColoredTristate( | 330 | ConfigurationShared::SetColoredTristate( |
| 303 | ui->use_disk_shader_cache, Settings::values.use_disk_shader_cache, use_disk_shader_cache); | 331 | ui->use_disk_shader_cache, Settings::values.use_disk_shader_cache, use_disk_shader_cache); |
| 304 | ConfigurationShared::SetColoredTristate( | ||
| 305 | ui->use_nvdec_emulation, Settings::values.use_nvdec_emulation, use_nvdec_emulation); | ||
| 306 | ConfigurationShared::SetColoredTristate(ui->accelerate_astc, Settings::values.accelerate_astc, | 332 | ConfigurationShared::SetColoredTristate(ui->accelerate_astc, Settings::values.accelerate_astc, |
| 307 | accelerate_astc); | 333 | accelerate_astc); |
| 308 | ConfigurationShared::SetColoredTristate(ui->use_asynchronous_gpu_emulation, | 334 | ConfigurationShared::SetColoredTristate(ui->use_asynchronous_gpu_emulation, |
| @@ -316,4 +342,6 @@ void ConfigureGraphics::SetupPerGameUI() { | |||
| 316 | static_cast<int>(Settings::values.fullscreen_mode.GetValue(true))); | 342 | static_cast<int>(Settings::values.fullscreen_mode.GetValue(true))); |
| 317 | ConfigurationShared::InsertGlobalItem( | 343 | ConfigurationShared::InsertGlobalItem( |
| 318 | ui->api, static_cast<int>(Settings::values.renderer_backend.GetValue(true))); | 344 | ui->api, static_cast<int>(Settings::values.renderer_backend.GetValue(true))); |
| 345 | ConfigurationShared::InsertGlobalItem( | ||
| 346 | ui->nvdec_emulation, static_cast<int>(Settings::values.nvdec_emulation.GetValue(true))); | ||
| 319 | } | 347 | } |
diff --git a/src/yuzu/configuration/configure_graphics.h b/src/yuzu/configuration/configure_graphics.h index c866b911b..7d7ac329d 100644 --- a/src/yuzu/configuration/configure_graphics.h +++ b/src/yuzu/configuration/configure_graphics.h | |||
| @@ -43,6 +43,7 @@ private: | |||
| 43 | void SetupPerGameUI(); | 43 | void SetupPerGameUI(); |
| 44 | 44 | ||
| 45 | Settings::RendererBackend GetCurrentGraphicsBackend() const; | 45 | Settings::RendererBackend GetCurrentGraphicsBackend() const; |
| 46 | Settings::NvdecEmulation GetCurrentNvdecEmulation() const; | ||
| 46 | 47 | ||
| 47 | std::unique_ptr<Ui::ConfigureGraphics> ui; | 48 | std::unique_ptr<Ui::ConfigureGraphics> ui; |
| 48 | QColor bg_color; | 49 | QColor bg_color; |
diff --git a/src/yuzu/configuration/configure_graphics.ui b/src/yuzu/configuration/configure_graphics.ui index 099ddbb7c..41e930f6b 100644 --- a/src/yuzu/configuration/configure_graphics.ui +++ b/src/yuzu/configuration/configure_graphics.ui | |||
| @@ -168,13 +168,6 @@ | |||
| 168 | </widget> | 168 | </widget> |
| 169 | </item> | 169 | </item> |
| 170 | <item> | 170 | <item> |
| 171 | <widget class="QCheckBox" name="use_nvdec_emulation"> | ||
| 172 | <property name="text"> | ||
| 173 | <string>Use NVDEC emulation</string> | ||
| 174 | </property> | ||
| 175 | </widget> | ||
| 176 | </item> | ||
| 177 | <item> | ||
| 178 | <widget class="QCheckBox" name="accelerate_astc"> | 171 | <widget class="QCheckBox" name="accelerate_astc"> |
| 179 | <property name="text"> | 172 | <property name="text"> |
| 180 | <string>Accelerate ASTC texture decoding</string> | 173 | <string>Accelerate ASTC texture decoding</string> |
| @@ -182,6 +175,50 @@ | |||
| 182 | </widget> | 175 | </widget> |
| 183 | </item> | 176 | </item> |
| 184 | <item> | 177 | <item> |
| 178 | <widget class="QWidget" name="nvdec_emulation_widget" native="true"> | ||
| 179 | <layout class="QHBoxLayout" name="nvdec_emulation_layout"> | ||
| 180 | <property name="leftMargin"> | ||
| 181 | <number>0</number> | ||
| 182 | </property> | ||
| 183 | <property name="topMargin"> | ||
| 184 | <number>0</number> | ||
| 185 | </property> | ||
| 186 | <property name="rightMargin"> | ||
| 187 | <number>0</number> | ||
| 188 | </property> | ||
| 189 | <property name="bottomMargin"> | ||
| 190 | <number>0</number> | ||
| 191 | </property> | ||
| 192 | <item> | ||
| 193 | <widget class="QLabel" name="nvdec_emulation_label"> | ||
| 194 | <property name="text"> | ||
| 195 | <string>NVDEC emulation:</string> | ||
| 196 | </property> | ||
| 197 | </widget> | ||
| 198 | </item> | ||
| 199 | <item> | ||
| 200 | <widget class="QComboBox" name="nvdec_emulation"> | ||
| 201 | <item> | ||
| 202 | <property name="text"> | ||
| 203 | <string>Disabled</string> | ||
| 204 | </property> | ||
| 205 | </item> | ||
| 206 | <item> | ||
| 207 | <property name="text"> | ||
| 208 | <string>CPU Decoding</string> | ||
| 209 | </property> | ||
| 210 | </item> | ||
| 211 | <item> | ||
| 212 | <property name="text"> | ||
| 213 | <string>GPU Decoding</string> | ||
| 214 | </property> | ||
| 215 | </item> | ||
| 216 | </widget> | ||
| 217 | </item> | ||
| 218 | </layout> | ||
| 219 | </widget> | ||
| 220 | </item> | ||
| 221 | <item> | ||
| 185 | <widget class="QWidget" name="fullscreen_mode_layout" native="true"> | 222 | <widget class="QWidget" name="fullscreen_mode_layout" native="true"> |
| 186 | <layout class="QHBoxLayout" name="horizontalLayout_1"> | 223 | <layout class="QHBoxLayout" name="horizontalLayout_1"> |
| 187 | <property name="leftMargin"> | 224 | <property name="leftMargin"> |
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 4f14be524..464cd472e 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -465,7 +465,7 @@ void Config::ReadValues() { | |||
| 465 | ReadSetting("Renderer", Settings::values.disable_fps_limit); | 465 | ReadSetting("Renderer", Settings::values.disable_fps_limit); |
| 466 | ReadSetting("Renderer", Settings::values.shader_backend); | 466 | ReadSetting("Renderer", Settings::values.shader_backend); |
| 467 | ReadSetting("Renderer", Settings::values.use_asynchronous_shaders); | 467 | ReadSetting("Renderer", Settings::values.use_asynchronous_shaders); |
| 468 | ReadSetting("Renderer", Settings::values.use_nvdec_emulation); | 468 | ReadSetting("Renderer", Settings::values.nvdec_emulation); |
| 469 | ReadSetting("Renderer", Settings::values.accelerate_astc); | 469 | ReadSetting("Renderer", Settings::values.accelerate_astc); |
| 470 | ReadSetting("Renderer", Settings::values.use_fast_gpu_time); | 470 | ReadSetting("Renderer", Settings::values.use_fast_gpu_time); |
| 471 | ReadSetting("Renderer", Settings::values.use_caches_gc); | 471 | ReadSetting("Renderer", Settings::values.use_caches_gc); |
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index e02eceb99..72f3213fb 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h | |||
| @@ -261,9 +261,9 @@ shader_backend = | |||
| 261 | # 0 (default): Off, 1: On | 261 | # 0 (default): Off, 1: On |
| 262 | use_asynchronous_shaders = | 262 | use_asynchronous_shaders = |
| 263 | 263 | ||
| 264 | # Enable NVDEC emulation. | 264 | # NVDEC emulation. |
| 265 | # 0: Off, 1 (default): On | 265 | # 0: Disabled, 1: CPU Decoding, 2 (default): GPU Decoding |
| 266 | use_nvdec_emulation = | 266 | nvdec_emulation = |
| 267 | 267 | ||
| 268 | # Accelerate ASTC texture decoding. | 268 | # Accelerate ASTC texture decoding. |
| 269 | # 0: Off, 1 (default): On | 269 | # 0: Off, 1 (default): On |