diff options
23 files changed, 136 insertions, 130 deletions
diff --git a/src/audio_core/sink/sink_details.cpp b/src/audio_core/sink/sink_details.cpp index 751e97bfc..027bfa517 100644 --- a/src/audio_core/sink/sink_details.cpp +++ b/src/audio_core/sink/sink_details.cpp | |||
| @@ -82,11 +82,12 @@ const SinkDetails& GetOutputSinkDetails(Settings::AudioEngine sink_id) { | |||
| 82 | #else | 82 | #else |
| 83 | iter = std::begin(sink_details); | 83 | iter = std::begin(sink_details); |
| 84 | #endif | 84 | #endif |
| 85 | LOG_INFO(Service_Audio, "Auto-selecting the {} backend", Settings::TranslateEnum(iter->id)); | 85 | LOG_INFO(Service_Audio, "Auto-selecting the {} backend", |
| 86 | Settings::CanonicalizeEnum(iter->id)); | ||
| 86 | } | 87 | } |
| 87 | 88 | ||
| 88 | if (iter == std::end(sink_details)) { | 89 | if (iter == std::end(sink_details)) { |
| 89 | LOG_ERROR(Audio, "Invalid sink_id {}", Settings::TranslateEnum(sink_id)); | 90 | LOG_ERROR(Audio, "Invalid sink_id {}", Settings::CanonicalizeEnum(sink_id)); |
| 90 | iter = find_backend(Settings::AudioEngine::Null); | 91 | iter = find_backend(Settings::AudioEngine::Null); |
| 91 | } | 92 | } |
| 92 | 93 | ||
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 8bfda5667..0a8729b5a 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -122,12 +122,12 @@ void SetConfiguringGlobal(bool is_global) { | |||
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | bool IsGPULevelExtreme() { | 124 | bool IsGPULevelExtreme() { |
| 125 | return values.gpu_accuracy.GetValue() == GPUAccuracy::Extreme; | 125 | return values.gpu_accuracy.GetValue() == GpuAccuracy::Extreme; |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | bool IsGPULevelHigh() { | 128 | bool IsGPULevelHigh() { |
| 129 | return values.gpu_accuracy.GetValue() == GPUAccuracy::Extreme || | 129 | return values.gpu_accuracy.GetValue() == GpuAccuracy::Extreme || |
| 130 | values.gpu_accuracy.GetValue() == GPUAccuracy::High; | 130 | values.gpu_accuracy.GetValue() == GpuAccuracy::High; |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | bool IsFastmemEnabled() { | 133 | bool IsFastmemEnabled() { |
diff --git a/src/common/settings.h b/src/common/settings.h index a9ce113ef..141408d3e 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -91,6 +91,7 @@ public: | |||
| 91 | return {}; | 91 | return {}; |
| 92 | } | 92 | } |
| 93 | virtual void LoadString(const std::string& load) = 0; | 93 | virtual void LoadString(const std::string& load) = 0; |
| 94 | virtual std::string Canonicalize() const = 0; | ||
| 94 | virtual const std::string& GetLabel() const = 0; | 95 | virtual const std::string& GetLabel() const = 0; |
| 95 | virtual std::string DefaultToString() const = 0; | 96 | virtual std::string DefaultToString() const = 0; |
| 96 | virtual bool Save() const = 0; | 97 | virtual bool Save() const = 0; |
| @@ -102,7 +103,7 @@ public: | |||
| 102 | virtual std::string MinVal() const = 0; | 103 | virtual std::string MinVal() const = 0; |
| 103 | virtual std::string MaxVal() const = 0; | 104 | virtual std::string MaxVal() const = 0; |
| 104 | virtual bool UsingGlobal() const { | 105 | virtual bool UsingGlobal() const { |
| 105 | return false; | 106 | return true; |
| 106 | } | 107 | } |
| 107 | }; | 108 | }; |
| 108 | 109 | ||
| @@ -245,7 +246,7 @@ protected: | |||
| 245 | } else if constexpr (std::is_same<Type, bool>()) { | 246 | } else if constexpr (std::is_same<Type, bool>()) { |
| 246 | return value_ ? "true" : "false"; | 247 | return value_ ? "true" : "false"; |
| 247 | } else if (std::is_same<Type, AudioEngine>()) { | 248 | } else if (std::is_same<Type, AudioEngine>()) { |
| 248 | return TranslateEnum(value_); | 249 | return CanonicalizeEnum(value_); |
| 249 | } else { | 250 | } else { |
| 250 | return std::to_string(static_cast<u64>(value_)); | 251 | return std::to_string(static_cast<u64>(value_)); |
| 251 | } | 252 | } |
| @@ -321,6 +322,13 @@ public: | |||
| 321 | } | 322 | } |
| 322 | } | 323 | } |
| 323 | 324 | ||
| 325 | [[nodiscard]] std::string constexpr Canonicalize() const override { | ||
| 326 | if constexpr (std::is_enum<Type>::value) { | ||
| 327 | return CanonicalizeEnum(this->GetValue()); | ||
| 328 | } | ||
| 329 | return ToString(this->GetValue()); | ||
| 330 | } | ||
| 331 | |||
| 324 | /** | 332 | /** |
| 325 | * Returns the save preference of the setting i.e. when saving or reading the setting from a | 333 | * Returns the save preference of the setting i.e. when saving or reading the setting from a |
| 326 | * frontend, whether this setting should be skipped. | 334 | * frontend, whether this setting should be skipped. |
| @@ -560,8 +568,8 @@ struct Values { | |||
| 560 | linkage, false, "use_unsafe_extended_memory_layout", Category::Core}; | 568 | linkage, false, "use_unsafe_extended_memory_layout", Category::Core}; |
| 561 | 569 | ||
| 562 | // Cpu | 570 | // Cpu |
| 563 | SwitchableSetting<CPUAccuracy, true> cpu_accuracy{linkage, CPUAccuracy::Auto, | 571 | SwitchableSetting<CpuAccuracy, true> cpu_accuracy{linkage, CpuAccuracy::Auto, |
| 564 | CPUAccuracy::Auto, CPUAccuracy::Paranoid, | 572 | CpuAccuracy::Auto, CpuAccuracy::Paranoid, |
| 565 | "cpu_accuracy", Category::Cpu}; | 573 | "cpu_accuracy", Category::Cpu}; |
| 566 | // TODO: remove cpu_accuracy_first_time, migration setting added 8 July 2021 | 574 | // TODO: remove cpu_accuracy_first_time, migration setting added 8 July 2021 |
| 567 | Setting<bool> cpu_accuracy_first_time{linkage, true, "cpu_accuracy_first_time", Category::Cpu}; | 575 | Setting<bool> cpu_accuracy_first_time{linkage, true, "cpu_accuracy_first_time", Category::Cpu}; |
| @@ -657,28 +665,28 @@ struct Values { | |||
| 657 | linkage, 100, 0, 9999, "speed_limit", Category::Renderer, true, true}; | 665 | linkage, 100, 0, 9999, "speed_limit", Category::Renderer, true, true}; |
| 658 | SwitchableSetting<bool> use_disk_shader_cache{linkage, true, "use_disk_shader_cache", | 666 | SwitchableSetting<bool> use_disk_shader_cache{linkage, true, "use_disk_shader_cache", |
| 659 | Category::Renderer}; | 667 | Category::Renderer}; |
| 660 | SwitchableSetting<GPUAccuracy, true> gpu_accuracy{linkage, | 668 | SwitchableSetting<GpuAccuracy, true> gpu_accuracy{linkage, |
| 661 | GPUAccuracy::High, | 669 | GpuAccuracy::High, |
| 662 | GPUAccuracy::Normal, | 670 | GpuAccuracy::Normal, |
| 663 | GPUAccuracy::Extreme, | 671 | GpuAccuracy::Extreme, |
| 664 | "gpu_accuracy", | 672 | "gpu_accuracy", |
| 665 | Category::RendererAdvanced, | 673 | Category::RendererAdvanced, |
| 666 | true, | 674 | true, |
| 667 | true}; | 675 | true}; |
| 668 | SwitchableSetting<bool> use_asynchronous_gpu_emulation{ | 676 | SwitchableSetting<bool> use_asynchronous_gpu_emulation{ |
| 669 | linkage, true, "use_asynchronous_gpu_emulation", Category::Renderer}; | 677 | linkage, true, "use_asynchronous_gpu_emulation", Category::Renderer}; |
| 670 | SwitchableSetting<NvdecEmulation> nvdec_emulation{linkage, NvdecEmulation::GPU, | 678 | SwitchableSetting<NvdecEmulation> nvdec_emulation{linkage, NvdecEmulation::Gpu, |
| 671 | "nvdec_emulation", Category::Renderer}; | 679 | "nvdec_emulation", Category::Renderer}; |
| 672 | SwitchableSetting<AstcDecodeMode, true> accelerate_astc{linkage, | 680 | SwitchableSetting<AstcDecodeMode, true> accelerate_astc{linkage, |
| 673 | AstcDecodeMode::CPU, | 681 | AstcDecodeMode::Cpu, |
| 674 | AstcDecodeMode::CPU, | 682 | AstcDecodeMode::Cpu, |
| 675 | AstcDecodeMode::CPUAsynchronous, | 683 | AstcDecodeMode::CpuAsynchronous, |
| 676 | "accelerate_astc", | 684 | "accelerate_astc", |
| 677 | Category::Renderer}; | 685 | Category::Renderer}; |
| 678 | Setting<VSyncMode, true> vsync_mode{linkage, | 686 | Setting<VSyncMode, true> vsync_mode{linkage, |
| 679 | VSyncMode::FIFO, | 687 | VSyncMode::Fifo, |
| 680 | VSyncMode::Immediate, | 688 | VSyncMode::Immediate, |
| 681 | VSyncMode::FIFORelaxed, | 689 | VSyncMode::FifoRelaxed, |
| 682 | "use_vsync", | 690 | "use_vsync", |
| 683 | Category::Renderer, | 691 | Category::Renderer, |
| 684 | true, | 692 | true, |
| @@ -686,7 +694,7 @@ struct Values { | |||
| 686 | SwitchableSetting<bool> use_reactive_flushing{linkage, true, "use_reactive_flushing", | 694 | SwitchableSetting<bool> use_reactive_flushing{linkage, true, "use_reactive_flushing", |
| 687 | Category::RendererAdvanced}; | 695 | Category::RendererAdvanced}; |
| 688 | SwitchableSetting<ShaderBackend, true> shader_backend{ | 696 | SwitchableSetting<ShaderBackend, true> shader_backend{ |
| 689 | linkage, ShaderBackend::GLSL, ShaderBackend::GLSL, ShaderBackend::SPIRV, | 697 | linkage, ShaderBackend::Glsl, ShaderBackend::Glsl, ShaderBackend::SpirV, |
| 690 | "shader_backend", Category::Renderer}; | 698 | "shader_backend", Category::Renderer}; |
| 691 | SwitchableSetting<bool> use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders", | 699 | SwitchableSetting<bool> use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders", |
| 692 | Category::RendererAdvanced}; | 700 | Category::RendererAdvanced}; |
| @@ -730,7 +738,7 @@ struct Values { | |||
| 730 | Language::PortugueseBrazilian, | 738 | Language::PortugueseBrazilian, |
| 731 | "language_index", | 739 | "language_index", |
| 732 | Category::System}; | 740 | Category::System}; |
| 733 | SwitchableSetting<Region, true> region_index{linkage, Region::USA, Region::Japan, | 741 | SwitchableSetting<Region, true> region_index{linkage, Region::Usa, Region::Japan, |
| 734 | Region::Taiwan, "region_index", Category::System}; | 742 | Region::Taiwan, "region_index", Category::System}; |
| 735 | SwitchableSetting<TimeZone, true> time_zone_index{linkage, TimeZone::Auto, | 743 | SwitchableSetting<TimeZone, true> time_zone_index{linkage, TimeZone::Auto, |
| 736 | TimeZone::Auto, TimeZone::Zulu, | 744 | TimeZone::Auto, TimeZone::Zulu, |
diff --git a/src/common/settings_enums.h b/src/common/settings_enums.h index f48fb7bd4..6cd2ac28b 100644 --- a/src/common/settings_enums.h +++ b/src/common/settings_enums.h | |||
| @@ -47,7 +47,7 @@ enum class Language : u32 { | |||
| 47 | 47 | ||
| 48 | enum class Region : u32 { | 48 | enum class Region : u32 { |
| 49 | Japan, | 49 | Japan, |
| 50 | USA, | 50 | Usa, |
| 51 | Europe, | 51 | Europe, |
| 52 | Australia, | 52 | Australia, |
| 53 | China, | 53 | China, |
| @@ -114,9 +114,9 @@ enum class AnisotropyMode : u32 { | |||
| 114 | }; | 114 | }; |
| 115 | 115 | ||
| 116 | enum class AstcDecodeMode : u32 { | 116 | enum class AstcDecodeMode : u32 { |
| 117 | CPU = 0, | 117 | Cpu = 0, |
| 118 | GPU = 1, | 118 | Gpu = 1, |
| 119 | CPUAsynchronous = 2, | 119 | CpuAsynchronous = 2, |
| 120 | }; | 120 | }; |
| 121 | 121 | ||
| 122 | enum class AstcRecompression : u32 { | 122 | enum class AstcRecompression : u32 { |
| @@ -128,8 +128,8 @@ enum class AstcRecompression : u32 { | |||
| 128 | enum class VSyncMode : u32 { | 128 | enum class VSyncMode : u32 { |
| 129 | Immediate = 0, | 129 | Immediate = 0, |
| 130 | Mailbox = 1, | 130 | Mailbox = 1, |
| 131 | FIFO = 2, | 131 | Fifo = 2, |
| 132 | FIFORelaxed = 3, | 132 | FifoRelaxed = 3, |
| 133 | }; | 133 | }; |
| 134 | 134 | ||
| 135 | enum class RendererBackend : u32 { | 135 | enum class RendererBackend : u32 { |
| @@ -139,19 +139,18 @@ enum class RendererBackend : u32 { | |||
| 139 | }; | 139 | }; |
| 140 | 140 | ||
| 141 | enum class ShaderBackend : u32 { | 141 | enum class ShaderBackend : u32 { |
| 142 | GLSL = 0, | 142 | Glsl = 0, |
| 143 | GLASM = 1, | 143 | Glasm = 1, |
| 144 | SPIRV = 2, | 144 | SpirV = 2, |
| 145 | }; | 145 | }; |
| 146 | 146 | ||
| 147 | enum class GPUAccuracy : u32 { | 147 | enum class GpuAccuracy : u32 { |
| 148 | Normal = 0, | 148 | Normal = 0, |
| 149 | High = 1, | 149 | High = 1, |
| 150 | Extreme = 2, | 150 | Extreme = 2, |
| 151 | MaxEnum = 3, | ||
| 152 | }; | 151 | }; |
| 153 | 152 | ||
| 154 | enum class CPUAccuracy : u32 { | 153 | enum class CpuAccuracy : u32 { |
| 155 | Auto = 0, | 154 | Auto = 0, |
| 156 | Accurate = 1, | 155 | Accurate = 1, |
| 157 | Unsafe = 2, | 156 | Unsafe = 2, |
| @@ -165,8 +164,8 @@ enum class FullscreenMode : u32 { | |||
| 165 | 164 | ||
| 166 | enum class NvdecEmulation : u32 { | 165 | enum class NvdecEmulation : u32 { |
| 167 | Off = 0, | 166 | Off = 0, |
| 168 | CPU = 1, | 167 | Cpu = 1, |
| 169 | GPU = 2, | 168 | Gpu = 2, |
| 170 | }; | 169 | }; |
| 171 | 170 | ||
| 172 | enum class ResolutionSetup : u32 { | 171 | enum class ResolutionSetup : u32 { |
| @@ -220,18 +219,18 @@ static std::map<std::type_index, std::map<std::string, u32>> translations = { | |||
| 220 | static std::string empty_string{}; | 219 | static std::string empty_string{}; |
| 221 | 220 | ||
| 222 | template <typename Type> | 221 | template <typename Type> |
| 223 | const std::string& TranslateEnum(Type id) { | 222 | const std::string& CanonicalizeEnum(Type id) { |
| 224 | auto& group = translations.at(typeid(Type)); | 223 | auto& group = canonicalizations.at(typeid(Type)); |
| 225 | for (auto& [name, value] : group) { | 224 | for (auto& [name, value] : group) { |
| 226 | if (static_cast<Type>(value) == id) { | 225 | if (static_cast<Type>(value) == id) { |
| 227 | return name; | 226 | return name; |
| 228 | } | 227 | } |
| 229 | } | 228 | } |
| 230 | return empty_string; | 229 | return invalid_string; |
| 231 | } | 230 | } |
| 232 | 231 | ||
| 233 | template <typename Type> | 232 | template <typename Type> |
| 234 | static Type ToEnum(const std::string& text) { | 233 | static Type ToEnum(const std::string& canonicalization) { |
| 235 | return static_cast<Type>(translations.at(typeid(Type)).at(text)); | 234 | return static_cast<Type>(canonicalizations.at(typeid(Type)).at(canonicalization)); |
| 236 | } | 235 | } |
| 237 | } // namespace Settings | 236 | } // namespace Settings |
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp index 3b82fb73c..dc7cfd239 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp | |||
| @@ -287,7 +287,7 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable* | |||
| 287 | } | 287 | } |
| 288 | } else { | 288 | } else { |
| 289 | // Unsafe optimizations | 289 | // Unsafe optimizations |
| 290 | if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::Unsafe) { | 290 | if (Settings::values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Unsafe) { |
| 291 | config.unsafe_optimizations = true; | 291 | config.unsafe_optimizations = true; |
| 292 | if (Settings::values.cpuopt_unsafe_unfuse_fma) { | 292 | if (Settings::values.cpuopt_unsafe_unfuse_fma) { |
| 293 | config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_UnfuseFMA; | 293 | config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_UnfuseFMA; |
| @@ -307,7 +307,7 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable* | |||
| 307 | } | 307 | } |
| 308 | 308 | ||
| 309 | // Curated optimizations | 309 | // Curated optimizations |
| 310 | if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::Auto) { | 310 | if (Settings::values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Auto) { |
| 311 | config.unsafe_optimizations = true; | 311 | config.unsafe_optimizations = true; |
| 312 | config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_UnfuseFMA; | 312 | config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_UnfuseFMA; |
| 313 | config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_IgnoreStandardFPCRValue; | 313 | config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_IgnoreStandardFPCRValue; |
| @@ -316,7 +316,7 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable* | |||
| 316 | } | 316 | } |
| 317 | 317 | ||
| 318 | // Paranoia mode for debugging optimizations | 318 | // Paranoia mode for debugging optimizations |
| 319 | if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::Paranoid) { | 319 | if (Settings::values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Paranoid) { |
| 320 | config.unsafe_optimizations = false; | 320 | config.unsafe_optimizations = false; |
| 321 | config.optimizations = Dynarmic::no_optimizations; | 321 | config.optimizations = Dynarmic::no_optimizations; |
| 322 | } | 322 | } |
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index bb97ed5bc..a4cc74ebf 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp | |||
| @@ -347,7 +347,7 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable* | |||
| 347 | } | 347 | } |
| 348 | } else { | 348 | } else { |
| 349 | // Unsafe optimizations | 349 | // Unsafe optimizations |
| 350 | if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::Unsafe) { | 350 | if (Settings::values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Unsafe) { |
| 351 | config.unsafe_optimizations = true; | 351 | config.unsafe_optimizations = true; |
| 352 | if (Settings::values.cpuopt_unsafe_unfuse_fma) { | 352 | if (Settings::values.cpuopt_unsafe_unfuse_fma) { |
| 353 | config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_UnfuseFMA; | 353 | config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_UnfuseFMA; |
| @@ -367,7 +367,7 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable* | |||
| 367 | } | 367 | } |
| 368 | 368 | ||
| 369 | // Curated optimizations | 369 | // Curated optimizations |
| 370 | if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::Auto) { | 370 | if (Settings::values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Auto) { |
| 371 | config.unsafe_optimizations = true; | 371 | config.unsafe_optimizations = true; |
| 372 | config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_UnfuseFMA; | 372 | config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_UnfuseFMA; |
| 373 | config.fastmem_address_space_bits = 64; | 373 | config.fastmem_address_space_bits = 64; |
| @@ -375,7 +375,7 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable* | |||
| 375 | } | 375 | } |
| 376 | 376 | ||
| 377 | // Paranoia mode for debugging optimizations | 377 | // Paranoia mode for debugging optimizations |
| 378 | if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::Paranoid) { | 378 | if (Settings::values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Paranoid) { |
| 379 | config.unsafe_optimizations = false; | 379 | config.unsafe_optimizations = false; |
| 380 | config.optimizations = Dynarmic::no_optimizations; | 380 | config.optimizations = Dynarmic::no_optimizations; |
| 381 | } | 381 | } |
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index c058ac2c7..62b3f6636 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp | |||
| @@ -61,16 +61,14 @@ static const char* TranslateRenderer(Settings::RendererBackend backend) { | |||
| 61 | return "Unknown"; | 61 | return "Unknown"; |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | static const char* TranslateGPUAccuracyLevel(Settings::GPUAccuracy backend) { | 64 | static const char* TranslateGPUAccuracyLevel(Settings::GpuAccuracy backend) { |
| 65 | switch (backend) { | 65 | switch (backend) { |
| 66 | case Settings::GPUAccuracy::Normal: | 66 | case Settings::GpuAccuracy::Normal: |
| 67 | return "Normal"; | 67 | return "Normal"; |
| 68 | case Settings::GPUAccuracy::High: | 68 | case Settings::GpuAccuracy::High: |
| 69 | return "High"; | 69 | return "High"; |
| 70 | case Settings::GPUAccuracy::Extreme: | 70 | case Settings::GpuAccuracy::Extreme: |
| 71 | return "Extreme"; | 71 | return "Extreme"; |
| 72 | case Settings::GPUAccuracy::MaxEnum: | ||
| 73 | break; | ||
| 74 | } | 72 | } |
| 75 | return "Unknown"; | 73 | return "Unknown"; |
| 76 | } | 74 | } |
| @@ -79,9 +77,9 @@ static const char* TranslateNvdecEmulation(Settings::NvdecEmulation backend) { | |||
| 79 | switch (backend) { | 77 | switch (backend) { |
| 80 | case Settings::NvdecEmulation::Off: | 78 | case Settings::NvdecEmulation::Off: |
| 81 | return "Off"; | 79 | return "Off"; |
| 82 | case Settings::NvdecEmulation::CPU: | 80 | case Settings::NvdecEmulation::Cpu: |
| 83 | return "CPU"; | 81 | return "CPU"; |
| 84 | case Settings::NvdecEmulation::GPU: | 82 | case Settings::NvdecEmulation::Gpu: |
| 85 | return "GPU"; | 83 | return "GPU"; |
| 86 | } | 84 | } |
| 87 | return "Unknown"; | 85 | return "Unknown"; |
| @@ -93,9 +91,9 @@ static constexpr const char* TranslateVSyncMode(Settings::VSyncMode mode) { | |||
| 93 | return "Immediate"; | 91 | return "Immediate"; |
| 94 | case Settings::VSyncMode::Mailbox: | 92 | case Settings::VSyncMode::Mailbox: |
| 95 | return "Mailbox"; | 93 | return "Mailbox"; |
| 96 | case Settings::VSyncMode::FIFO: | 94 | case Settings::VSyncMode::Fifo: |
| 97 | return "FIFO"; | 95 | return "FIFO"; |
| 98 | case Settings::VSyncMode::FIFORelaxed: | 96 | case Settings::VSyncMode::FifoRelaxed: |
| 99 | return "FIFO Relaxed"; | 97 | return "FIFO Relaxed"; |
| 100 | } | 98 | } |
| 101 | return "Unknown"; | 99 | return "Unknown"; |
| @@ -103,11 +101,11 @@ static constexpr const char* TranslateVSyncMode(Settings::VSyncMode mode) { | |||
| 103 | 101 | ||
| 104 | static constexpr const char* TranslateASTCDecodeMode(Settings::AstcDecodeMode mode) { | 102 | static constexpr const char* TranslateASTCDecodeMode(Settings::AstcDecodeMode mode) { |
| 105 | switch (mode) { | 103 | switch (mode) { |
| 106 | case Settings::AstcDecodeMode::CPU: | 104 | case Settings::AstcDecodeMode::Cpu: |
| 107 | return "CPU"; | 105 | return "CPU"; |
| 108 | case Settings::AstcDecodeMode::GPU: | 106 | case Settings::AstcDecodeMode::Gpu: |
| 109 | return "GPU"; | 107 | return "GPU"; |
| 110 | case Settings::AstcDecodeMode::CPUAsynchronous: | 108 | case Settings::AstcDecodeMode::CpuAsynchronous: |
| 111 | return "CPU Asynchronous"; | 109 | return "CPU Asynchronous"; |
| 112 | } | 110 | } |
| 113 | return "Unknown"; | 111 | return "Unknown"; |
| @@ -255,7 +253,7 @@ void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader, | |||
| 255 | // Log user configuration information | 253 | // Log user configuration information |
| 256 | constexpr auto field_type = Telemetry::FieldType::UserConfig; | 254 | constexpr auto field_type = Telemetry::FieldType::UserConfig; |
| 257 | AddField(field_type, "Audio_SinkId", | 255 | AddField(field_type, "Audio_SinkId", |
| 258 | Settings::TranslateEnum(Settings::values.sink_id.GetValue())); | 256 | Settings::CanonicalizeEnum(Settings::values.sink_id.GetValue())); |
| 259 | AddField(field_type, "Core_UseMultiCore", Settings::values.use_multi_core.GetValue()); | 257 | AddField(field_type, "Core_UseMultiCore", Settings::values.use_multi_core.GetValue()); |
| 260 | AddField(field_type, "Renderer_Backend", | 258 | AddField(field_type, "Renderer_Backend", |
| 261 | TranslateRenderer(Settings::values.renderer_backend.GetValue())); | 259 | TranslateRenderer(Settings::values.renderer_backend.GetValue())); |
diff --git a/src/video_core/host1x/codecs/codec.cpp b/src/video_core/host1x/codecs/codec.cpp index da07a556f..220cce28a 100644 --- a/src/video_core/host1x/codecs/codec.cpp +++ b/src/video_core/host1x/codecs/codec.cpp | |||
| @@ -247,7 +247,7 @@ void Codec::Initialize() { | |||
| 247 | av_codec = avcodec_find_decoder(codec); | 247 | av_codec = avcodec_find_decoder(codec); |
| 248 | 248 | ||
| 249 | InitializeAvCodecContext(); | 249 | InitializeAvCodecContext(); |
| 250 | if (Settings::values.nvdec_emulation.GetValue() == Settings::NvdecEmulation::GPU) { | 250 | if (Settings::values.nvdec_emulation.GetValue() == Settings::NvdecEmulation::Gpu) { |
| 251 | InitializeGpuDecoder(); | 251 | InitializeGpuDecoder(); |
| 252 | } | 252 | } |
| 253 | if (const int res = avcodec_open2(av_codec_ctx, av_codec, nullptr); res < 0) { | 253 | if (const int res = avcodec_open2(av_codec_ctx, av_codec, nullptr); res < 0) { |
diff --git a/src/video_core/host1x/codecs/h264.cpp b/src/video_core/host1x/codecs/h264.cpp index 862904e39..ece79b1e2 100644 --- a/src/video_core/host1x/codecs/h264.cpp +++ b/src/video_core/host1x/codecs/h264.cpp | |||
| @@ -84,7 +84,7 @@ std::span<const u8> H264::ComposeFrame(const Host1x::NvdecCommon::NvdecRegisters | |||
| 84 | 84 | ||
| 85 | // TODO (ameerj): Where do we get this number, it seems to be particular for each stream | 85 | // TODO (ameerj): Where do we get this number, it seems to be particular for each stream |
| 86 | const auto nvdec_decoding = Settings::values.nvdec_emulation.GetValue(); | 86 | const auto nvdec_decoding = Settings::values.nvdec_emulation.GetValue(); |
| 87 | const bool uses_gpu_decoding = nvdec_decoding == Settings::NvdecEmulation::GPU; | 87 | const bool uses_gpu_decoding = nvdec_decoding == Settings::NvdecEmulation::Gpu; |
| 88 | const u32 max_num_ref_frames = uses_gpu_decoding ? 6u : 16u; | 88 | const u32 max_num_ref_frames = uses_gpu_decoding ? 6u : 16u; |
| 89 | writer.WriteUe(max_num_ref_frames); | 89 | writer.WriteUe(max_num_ref_frames); |
| 90 | writer.WriteBit(false); | 90 | writer.WriteBit(false); |
diff --git a/src/video_core/renderer_opengl/gl_compute_pipeline.cpp b/src/video_core/renderer_opengl/gl_compute_pipeline.cpp index f9ca55c36..d70501860 100644 --- a/src/video_core/renderer_opengl/gl_compute_pipeline.cpp +++ b/src/video_core/renderer_opengl/gl_compute_pipeline.cpp | |||
| @@ -34,13 +34,13 @@ ComputePipeline::ComputePipeline(const Device& device, TextureCache& texture_cac | |||
| 34 | : texture_cache{texture_cache_}, buffer_cache{buffer_cache_}, | 34 | : texture_cache{texture_cache_}, buffer_cache{buffer_cache_}, |
| 35 | program_manager{program_manager_}, info{info_} { | 35 | program_manager{program_manager_}, info{info_} { |
| 36 | switch (device.GetShaderBackend()) { | 36 | switch (device.GetShaderBackend()) { |
| 37 | case Settings::ShaderBackend::GLSL: | 37 | case Settings::ShaderBackend::Glsl: |
| 38 | source_program = CreateProgram(code, GL_COMPUTE_SHADER); | 38 | source_program = CreateProgram(code, GL_COMPUTE_SHADER); |
| 39 | break; | 39 | break; |
| 40 | case Settings::ShaderBackend::GLASM: | 40 | case Settings::ShaderBackend::Glasm: |
| 41 | assembly_program = CompileProgram(code, GL_COMPUTE_PROGRAM_NV); | 41 | assembly_program = CompileProgram(code, GL_COMPUTE_PROGRAM_NV); |
| 42 | break; | 42 | break; |
| 43 | case Settings::ShaderBackend::SPIRV: | 43 | case Settings::ShaderBackend::SpirV: |
| 44 | source_program = CreateProgram(code_v, GL_COMPUTE_SHADER); | 44 | source_program = CreateProgram(code_v, GL_COMPUTE_SHADER); |
| 45 | break; | 45 | break; |
| 46 | } | 46 | } |
diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp index 33e63c17d..ee140c9c2 100644 --- a/src/video_core/renderer_opengl/gl_device.cpp +++ b/src/video_core/renderer_opengl/gl_device.cpp | |||
| @@ -177,15 +177,15 @@ Device::Device(Core::Frontend::EmuWindow& emu_window) { | |||
| 177 | has_fast_buffer_sub_data = is_nvidia && !disable_fast_buffer_sub_data; | 177 | has_fast_buffer_sub_data = is_nvidia && !disable_fast_buffer_sub_data; |
| 178 | 178 | ||
| 179 | shader_backend = Settings::values.shader_backend.GetValue(); | 179 | shader_backend = Settings::values.shader_backend.GetValue(); |
| 180 | use_assembly_shaders = shader_backend == Settings::ShaderBackend::GLASM && | 180 | use_assembly_shaders = shader_backend == Settings::ShaderBackend::Glasm && |
| 181 | GLAD_GL_NV_gpu_program5 && GLAD_GL_NV_compute_program5 && | 181 | GLAD_GL_NV_gpu_program5 && GLAD_GL_NV_compute_program5 && |
| 182 | GLAD_GL_NV_transform_feedback && GLAD_GL_NV_transform_feedback2; | 182 | GLAD_GL_NV_transform_feedback && GLAD_GL_NV_transform_feedback2; |
| 183 | if (shader_backend == Settings::ShaderBackend::GLASM && !use_assembly_shaders) { | 183 | if (shader_backend == Settings::ShaderBackend::Glasm && !use_assembly_shaders) { |
| 184 | LOG_ERROR(Render_OpenGL, "Assembly shaders enabled but not supported"); | 184 | LOG_ERROR(Render_OpenGL, "Assembly shaders enabled but not supported"); |
| 185 | shader_backend = Settings::ShaderBackend::GLSL; | 185 | shader_backend = Settings::ShaderBackend::Glsl; |
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | if (shader_backend == Settings::ShaderBackend::GLSL && is_nvidia) { | 188 | if (shader_backend == Settings::ShaderBackend::Glsl && is_nvidia) { |
| 189 | const std::string_view driver_version = version.substr(13); | 189 | const std::string_view driver_version = version.substr(13); |
| 190 | const int version_major = | 190 | const int version_major = |
| 191 | std::atoi(driver_version.substr(0, driver_version.find(".")).data()); | 191 | std::atoi(driver_version.substr(0, driver_version.find(".")).data()); |
diff --git a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp index 71f720c63..f822fa856 100644 --- a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp +++ b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp | |||
| @@ -236,18 +236,18 @@ GraphicsPipeline::GraphicsPipeline(const Device& device, TextureCache& texture_c | |||
| 236 | force_context_flush](ShaderContext::Context*) mutable { | 236 | force_context_flush](ShaderContext::Context*) mutable { |
| 237 | for (size_t stage = 0; stage < 5; ++stage) { | 237 | for (size_t stage = 0; stage < 5; ++stage) { |
| 238 | switch (backend) { | 238 | switch (backend) { |
| 239 | case Settings::ShaderBackend::GLSL: | 239 | case Settings::ShaderBackend::Glsl: |
| 240 | if (!sources_[stage].empty()) { | 240 | if (!sources_[stage].empty()) { |
| 241 | source_programs[stage] = CreateProgram(sources_[stage], Stage(stage)); | 241 | source_programs[stage] = CreateProgram(sources_[stage], Stage(stage)); |
| 242 | } | 242 | } |
| 243 | break; | 243 | break; |
| 244 | case Settings::ShaderBackend::GLASM: | 244 | case Settings::ShaderBackend::Glasm: |
| 245 | if (!sources_[stage].empty()) { | 245 | if (!sources_[stage].empty()) { |
| 246 | assembly_programs[stage] = | 246 | assembly_programs[stage] = |
| 247 | CompileProgram(sources_[stage], AssemblyStage(stage)); | 247 | CompileProgram(sources_[stage], AssemblyStage(stage)); |
| 248 | } | 248 | } |
| 249 | break; | 249 | break; |
| 250 | case Settings::ShaderBackend::SPIRV: | 250 | case Settings::ShaderBackend::SpirV: |
| 251 | if (!sources_spirv_[stage].empty()) { | 251 | if (!sources_spirv_[stage].empty()) { |
| 252 | source_programs[stage] = CreateProgram(sources_spirv_[stage], Stage(stage)); | 252 | source_programs[stage] = CreateProgram(sources_spirv_[stage], Stage(stage)); |
| 253 | } | 253 | } |
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp index 7e1d7f92e..618cb6354 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp | |||
| @@ -522,14 +522,14 @@ std::unique_ptr<GraphicsPipeline> ShaderCache::CreateGraphicsPipeline( | |||
| 522 | const auto runtime_info{ | 522 | const auto runtime_info{ |
| 523 | MakeRuntimeInfo(key, program, previous_program, glasm_use_storage_buffers, use_glasm)}; | 523 | MakeRuntimeInfo(key, program, previous_program, glasm_use_storage_buffers, use_glasm)}; |
| 524 | switch (device.GetShaderBackend()) { | 524 | switch (device.GetShaderBackend()) { |
| 525 | case Settings::ShaderBackend::GLSL: | 525 | case Settings::ShaderBackend::Glsl: |
| 526 | ConvertLegacyToGeneric(program, runtime_info); | 526 | ConvertLegacyToGeneric(program, runtime_info); |
| 527 | sources[stage_index] = EmitGLSL(profile, runtime_info, program, binding); | 527 | sources[stage_index] = EmitGLSL(profile, runtime_info, program, binding); |
| 528 | break; | 528 | break; |
| 529 | case Settings::ShaderBackend::GLASM: | 529 | case Settings::ShaderBackend::Glasm: |
| 530 | sources[stage_index] = EmitGLASM(profile, runtime_info, program, binding); | 530 | sources[stage_index] = EmitGLASM(profile, runtime_info, program, binding); |
| 531 | break; | 531 | break; |
| 532 | case Settings::ShaderBackend::SPIRV: | 532 | case Settings::ShaderBackend::SpirV: |
| 533 | ConvertLegacyToGeneric(program, runtime_info); | 533 | ConvertLegacyToGeneric(program, runtime_info); |
| 534 | sources_spirv[stage_index] = EmitSPIRV(profile, runtime_info, program, binding); | 534 | sources_spirv[stage_index] = EmitSPIRV(profile, runtime_info, program, binding); |
| 535 | break; | 535 | break; |
| @@ -582,13 +582,13 @@ std::unique_ptr<ComputePipeline> ShaderCache::CreateComputePipeline( | |||
| 582 | std::string code{}; | 582 | std::string code{}; |
| 583 | std::vector<u32> code_spirv; | 583 | std::vector<u32> code_spirv; |
| 584 | switch (device.GetShaderBackend()) { | 584 | switch (device.GetShaderBackend()) { |
| 585 | case Settings::ShaderBackend::GLSL: | 585 | case Settings::ShaderBackend::Glsl: |
| 586 | code = EmitGLSL(profile, program); | 586 | code = EmitGLSL(profile, program); |
| 587 | break; | 587 | break; |
| 588 | case Settings::ShaderBackend::GLASM: | 588 | case Settings::ShaderBackend::Glasm: |
| 589 | code = EmitGLASM(profile, info, program); | 589 | code = EmitGLASM(profile, info, program); |
| 590 | break; | 590 | break; |
| 591 | case Settings::ShaderBackend::SPIRV: | 591 | case Settings::ShaderBackend::SpirV: |
| 592 | code_spirv = EmitSPIRV(profile, program); | 592 | code_spirv = EmitSPIRV(profile, program); |
| 593 | break; | 593 | break; |
| 594 | } | 594 | } |
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 38ae12d8e..9cafd2983 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp | |||
| @@ -232,7 +232,7 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4 | |||
| 232 | [[nodiscard]] bool CanBeAccelerated(const TextureCacheRuntime& runtime, | 232 | [[nodiscard]] bool CanBeAccelerated(const TextureCacheRuntime& runtime, |
| 233 | const VideoCommon::ImageInfo& info) { | 233 | const VideoCommon::ImageInfo& info) { |
| 234 | if (IsPixelFormatASTC(info.format) && info.size.depth == 1 && !runtime.HasNativeASTC()) { | 234 | if (IsPixelFormatASTC(info.format) && info.size.depth == 1 && !runtime.HasNativeASTC()) { |
| 235 | return Settings::values.accelerate_astc.GetValue() == Settings::AstcDecodeMode::GPU && | 235 | return Settings::values.accelerate_astc.GetValue() == Settings::AstcDecodeMode::Gpu && |
| 236 | Settings::values.astc_recompression.GetValue() == | 236 | Settings::values.astc_recompression.GetValue() == |
| 237 | Settings::AstcRecompression::Uncompressed; | 237 | Settings::AstcRecompression::Uncompressed; |
| 238 | } | 238 | } |
| @@ -267,7 +267,7 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4 | |||
| 267 | const VideoCommon::ImageInfo& info) { | 267 | const VideoCommon::ImageInfo& info) { |
| 268 | if (IsPixelFormatASTC(info.format) && !runtime.HasNativeASTC()) { | 268 | if (IsPixelFormatASTC(info.format) && !runtime.HasNativeASTC()) { |
| 269 | return Settings::values.accelerate_astc.GetValue() == | 269 | return Settings::values.accelerate_astc.GetValue() == |
| 270 | Settings::AstcDecodeMode::CPUAsynchronous; | 270 | Settings::AstcDecodeMode::CpuAsynchronous; |
| 271 | } | 271 | } |
| 272 | return false; | 272 | return false; |
| 273 | } | 273 | } |
diff --git a/src/video_core/renderer_vulkan/vk_swapchain.cpp b/src/video_core/renderer_vulkan/vk_swapchain.cpp index d3cddac69..81ef98f61 100644 --- a/src/video_core/renderer_vulkan/vk_swapchain.cpp +++ b/src/video_core/renderer_vulkan/vk_swapchain.cpp | |||
| @@ -45,8 +45,8 @@ static VkPresentModeKHR ChooseSwapPresentMode(bool has_imm, bool has_mailbox, | |||
| 45 | return mode; | 45 | return mode; |
| 46 | } | 46 | } |
| 47 | switch (mode) { | 47 | switch (mode) { |
| 48 | case Settings::VSyncMode::FIFO: | 48 | case Settings::VSyncMode::Fifo: |
| 49 | case Settings::VSyncMode::FIFORelaxed: | 49 | case Settings::VSyncMode::FifoRelaxed: |
| 50 | if (has_mailbox) { | 50 | if (has_mailbox) { |
| 51 | return Settings::VSyncMode::Mailbox; | 51 | return Settings::VSyncMode::Mailbox; |
| 52 | } else if (has_imm) { | 52 | } else if (has_imm) { |
| @@ -59,8 +59,8 @@ static VkPresentModeKHR ChooseSwapPresentMode(bool has_imm, bool has_mailbox, | |||
| 59 | }(); | 59 | }(); |
| 60 | if ((setting == Settings::VSyncMode::Mailbox && !has_mailbox) || | 60 | if ((setting == Settings::VSyncMode::Mailbox && !has_mailbox) || |
| 61 | (setting == Settings::VSyncMode::Immediate && !has_imm) || | 61 | (setting == Settings::VSyncMode::Immediate && !has_imm) || |
| 62 | (setting == Settings::VSyncMode::FIFORelaxed && !has_fifo_relaxed)) { | 62 | (setting == Settings::VSyncMode::FifoRelaxed && !has_fifo_relaxed)) { |
| 63 | setting = Settings::VSyncMode::FIFO; | 63 | setting = Settings::VSyncMode::Fifo; |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | switch (setting) { | 66 | switch (setting) { |
| @@ -68,9 +68,9 @@ static VkPresentModeKHR ChooseSwapPresentMode(bool has_imm, bool has_mailbox, | |||
| 68 | return VK_PRESENT_MODE_IMMEDIATE_KHR; | 68 | return VK_PRESENT_MODE_IMMEDIATE_KHR; |
| 69 | case Settings::VSyncMode::Mailbox: | 69 | case Settings::VSyncMode::Mailbox: |
| 70 | return VK_PRESENT_MODE_MAILBOX_KHR; | 70 | return VK_PRESENT_MODE_MAILBOX_KHR; |
| 71 | case Settings::VSyncMode::FIFO: | 71 | case Settings::VSyncMode::Fifo: |
| 72 | return VK_PRESENT_MODE_FIFO_KHR; | 72 | return VK_PRESENT_MODE_FIFO_KHR; |
| 73 | case Settings::VSyncMode::FIFORelaxed: | 73 | case Settings::VSyncMode::FifoRelaxed: |
| 74 | return VK_PRESENT_MODE_FIFO_RELAXED_KHR; | 74 | return VK_PRESENT_MODE_FIFO_RELAXED_KHR; |
| 75 | default: | 75 | default: |
| 76 | return VK_PRESENT_MODE_FIFO_KHR; | 76 | return VK_PRESENT_MODE_FIFO_KHR; |
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index a060c3934..53d749bd4 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp | |||
| @@ -817,7 +817,7 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched | |||
| 817 | : device{device_}, scheduler{scheduler_}, memory_allocator{memory_allocator_}, | 817 | : device{device_}, scheduler{scheduler_}, memory_allocator{memory_allocator_}, |
| 818 | staging_buffer_pool{staging_buffer_pool_}, blit_image_helper{blit_image_helper_}, | 818 | staging_buffer_pool{staging_buffer_pool_}, blit_image_helper{blit_image_helper_}, |
| 819 | render_pass_cache{render_pass_cache_}, resolution{Settings::values.resolution_info} { | 819 | render_pass_cache{render_pass_cache_}, resolution{Settings::values.resolution_info} { |
| 820 | if (Settings::values.accelerate_astc.GetValue() == Settings::AstcDecodeMode::GPU) { | 820 | if (Settings::values.accelerate_astc.GetValue() == Settings::AstcDecodeMode::Gpu) { |
| 821 | astc_decoder_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, | 821 | astc_decoder_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, |
| 822 | compute_pass_descriptor_queue, memory_allocator); | 822 | compute_pass_descriptor_queue, memory_allocator); |
| 823 | } | 823 | } |
| @@ -1302,14 +1302,14 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu | |||
| 1302 | aspect_mask(ImageAspectMask(info.format)) { | 1302 | aspect_mask(ImageAspectMask(info.format)) { |
| 1303 | if (IsPixelFormatASTC(info.format) && !runtime->device.IsOptimalAstcSupported()) { | 1303 | if (IsPixelFormatASTC(info.format) && !runtime->device.IsOptimalAstcSupported()) { |
| 1304 | switch (Settings::values.accelerate_astc.GetValue()) { | 1304 | switch (Settings::values.accelerate_astc.GetValue()) { |
| 1305 | case Settings::AstcDecodeMode::GPU: | 1305 | case Settings::AstcDecodeMode::Gpu: |
| 1306 | if (Settings::values.astc_recompression.GetValue() == | 1306 | if (Settings::values.astc_recompression.GetValue() == |
| 1307 | Settings::AstcRecompression::Uncompressed && | 1307 | Settings::AstcRecompression::Uncompressed && |
| 1308 | info.size.depth == 1) { | 1308 | info.size.depth == 1) { |
| 1309 | flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; | 1309 | flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; |
| 1310 | } | 1310 | } |
| 1311 | break; | 1311 | break; |
| 1312 | case Settings::AstcDecodeMode::CPUAsynchronous: | 1312 | case Settings::AstcDecodeMode::CpuAsynchronous: |
| 1313 | flags |= VideoCommon::ImageFlagBits::AsynchronousDecode; | 1313 | flags |= VideoCommon::ImageFlagBits::AsynchronousDecode; |
| 1314 | break; | 1314 | break; |
| 1315 | default: | 1315 | default: |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 28ee5d492..051756452 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -89,10 +89,10 @@ const std::map<bool, QString> Config::use_docked_mode_texts_map = { | |||
| 89 | {false, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Handheld"))}, | 89 | {false, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Handheld"))}, |
| 90 | }; | 90 | }; |
| 91 | 91 | ||
| 92 | const std::map<Settings::GPUAccuracy, QString> Config::gpu_accuracy_texts_map = { | 92 | const std::map<Settings::GpuAccuracy, QString> Config::gpu_accuracy_texts_map = { |
| 93 | {Settings::GPUAccuracy::Normal, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Normal"))}, | 93 | {Settings::GpuAccuracy::Normal, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Normal"))}, |
| 94 | {Settings::GPUAccuracy::High, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "High"))}, | 94 | {Settings::GpuAccuracy::High, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "High"))}, |
| 95 | {Settings::GPUAccuracy::Extreme, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Extreme"))}, | 95 | {Settings::GpuAccuracy::Extreme, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Extreme"))}, |
| 96 | }; | 96 | }; |
| 97 | 97 | ||
| 98 | const std::map<Settings::RendererBackend, QString> Config::renderer_backend_texts_map = { | 98 | const std::map<Settings::RendererBackend, QString> Config::renderer_backend_texts_map = { |
diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h index 553a82295..c00e717b8 100644 --- a/src/yuzu/configuration/config.h +++ b/src/yuzu/configuration/config.h | |||
| @@ -52,7 +52,7 @@ public: | |||
| 52 | static const std::map<Settings::AntiAliasing, QString> anti_aliasing_texts_map; | 52 | static const std::map<Settings::AntiAliasing, QString> anti_aliasing_texts_map; |
| 53 | static const std::map<Settings::ScalingFilter, QString> scaling_filter_texts_map; | 53 | static const std::map<Settings::ScalingFilter, QString> scaling_filter_texts_map; |
| 54 | static const std::map<bool, QString> use_docked_mode_texts_map; | 54 | static const std::map<bool, QString> use_docked_mode_texts_map; |
| 55 | static const std::map<Settings::GPUAccuracy, QString> gpu_accuracy_texts_map; | 55 | static const std::map<Settings::GpuAccuracy, QString> gpu_accuracy_texts_map; |
| 56 | static const std::map<Settings::RendererBackend, QString> renderer_backend_texts_map; | 56 | static const std::map<Settings::RendererBackend, QString> renderer_backend_texts_map; |
| 57 | static const std::map<Settings::ShaderBackend, QString> shader_backend_texts_map; | 57 | static const std::map<Settings::ShaderBackend, QString> shader_backend_texts_map; |
| 58 | 58 | ||
| @@ -211,8 +211,8 @@ private: | |||
| 211 | }; | 211 | }; |
| 212 | 212 | ||
| 213 | // These metatype declarations cannot be in common/settings.h because core is devoid of QT | 213 | // These metatype declarations cannot be in common/settings.h because core is devoid of QT |
| 214 | Q_DECLARE_METATYPE(Settings::CPUAccuracy); | 214 | Q_DECLARE_METATYPE(Settings::CpuAccuracy); |
| 215 | Q_DECLARE_METATYPE(Settings::GPUAccuracy); | 215 | Q_DECLARE_METATYPE(Settings::GpuAccuracy); |
| 216 | Q_DECLARE_METATYPE(Settings::FullscreenMode); | 216 | Q_DECLARE_METATYPE(Settings::FullscreenMode); |
| 217 | Q_DECLARE_METATYPE(Settings::NvdecEmulation); | 217 | Q_DECLARE_METATYPE(Settings::NvdecEmulation); |
| 218 | Q_DECLARE_METATYPE(Settings::ResolutionSetup); | 218 | Q_DECLARE_METATYPE(Settings::ResolutionSetup); |
diff --git a/src/yuzu/configuration/configure_audio.cpp b/src/yuzu/configuration/configure_audio.cpp index 0496bd78f..7cc8affb7 100644 --- a/src/yuzu/configuration/configure_audio.cpp +++ b/src/yuzu/configuration/configure_audio.cpp | |||
| @@ -188,7 +188,7 @@ void ConfigureAudio::InitializeAudioSinkComboBox() { | |||
| 188 | sink_combo_box->addItem(QString::fromUtf8(AudioCore::Sink::auto_device_name)); | 188 | sink_combo_box->addItem(QString::fromUtf8(AudioCore::Sink::auto_device_name)); |
| 189 | 189 | ||
| 190 | for (const auto& id : AudioCore::Sink::GetSinkIDs()) { | 190 | for (const auto& id : AudioCore::Sink::GetSinkIDs()) { |
| 191 | sink_combo_box->addItem(QString::fromStdString(Settings::TranslateEnum(id))); | 191 | sink_combo_box->addItem(QString::fromStdString(Settings::CanonicalizeEnum(id))); |
| 192 | } | 192 | } |
| 193 | } | 193 | } |
| 194 | 194 | ||
diff --git a/src/yuzu/configuration/configure_cpu.cpp b/src/yuzu/configuration/configure_cpu.cpp index ac298a50f..67b811014 100644 --- a/src/yuzu/configuration/configure_cpu.cpp +++ b/src/yuzu/configuration/configure_cpu.cpp | |||
| @@ -73,9 +73,9 @@ void ConfigureCpu::Setup() { | |||
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | void ConfigureCpu::UpdateGroup(int index) { | 75 | void ConfigureCpu::UpdateGroup(int index) { |
| 76 | const auto accuracy = static_cast<Settings::CPUAccuracy>( | 76 | const auto accuracy = static_cast<Settings::CpuAccuracy>( |
| 77 | combobox_translations.at(typeid(Settings::CPUAccuracy))[index].first); | 77 | combobox_translations.at(typeid(Settings::CpuAccuracy))[index].first); |
| 78 | ui->unsafe_group->setVisible(accuracy == Settings::CPUAccuracy::Unsafe); | 78 | ui->unsafe_group->setVisible(accuracy == Settings::CpuAccuracy::Unsafe); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | void ConfigureCpu::ApplyConfiguration() { | 81 | void ConfigureCpu::ApplyConfiguration() { |
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 59702603a..1e26267a0 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp | |||
| @@ -51,9 +51,9 @@ static constexpr VkPresentModeKHR VSyncSettingToMode(Settings::VSyncMode mode) { | |||
| 51 | return VK_PRESENT_MODE_IMMEDIATE_KHR; | 51 | return VK_PRESENT_MODE_IMMEDIATE_KHR; |
| 52 | case Settings::VSyncMode::Mailbox: | 52 | case Settings::VSyncMode::Mailbox: |
| 53 | return VK_PRESENT_MODE_MAILBOX_KHR; | 53 | return VK_PRESENT_MODE_MAILBOX_KHR; |
| 54 | case Settings::VSyncMode::FIFO: | 54 | case Settings::VSyncMode::Fifo: |
| 55 | return VK_PRESENT_MODE_FIFO_KHR; | 55 | return VK_PRESENT_MODE_FIFO_KHR; |
| 56 | case Settings::VSyncMode::FIFORelaxed: | 56 | case Settings::VSyncMode::FifoRelaxed: |
| 57 | return VK_PRESENT_MODE_FIFO_RELAXED_KHR; | 57 | return VK_PRESENT_MODE_FIFO_RELAXED_KHR; |
| 58 | default: | 58 | default: |
| 59 | return VK_PRESENT_MODE_FIFO_KHR; | 59 | return VK_PRESENT_MODE_FIFO_KHR; |
| @@ -67,11 +67,11 @@ static constexpr Settings::VSyncMode PresentModeToSetting(VkPresentModeKHR mode) | |||
| 67 | case VK_PRESENT_MODE_MAILBOX_KHR: | 67 | case VK_PRESENT_MODE_MAILBOX_KHR: |
| 68 | return Settings::VSyncMode::Mailbox; | 68 | return Settings::VSyncMode::Mailbox; |
| 69 | case VK_PRESENT_MODE_FIFO_KHR: | 69 | case VK_PRESENT_MODE_FIFO_KHR: |
| 70 | return Settings::VSyncMode::FIFO; | 70 | return Settings::VSyncMode::Fifo; |
| 71 | case VK_PRESENT_MODE_FIFO_RELAXED_KHR: | 71 | case VK_PRESENT_MODE_FIFO_RELAXED_KHR: |
| 72 | return Settings::VSyncMode::FIFORelaxed; | 72 | return Settings::VSyncMode::FifoRelaxed; |
| 73 | default: | 73 | default: |
| 74 | return Settings::VSyncMode::FIFO; | 74 | return Settings::VSyncMode::Fifo; |
| 75 | } | 75 | } |
| 76 | } | 76 | } |
| 77 | 77 | ||
diff --git a/src/yuzu/configuration/shared_translation.cpp b/src/yuzu/configuration/shared_translation.cpp index 5d4e29a08..4caa44e1b 100644 --- a/src/yuzu/configuration/shared_translation.cpp +++ b/src/yuzu/configuration/shared_translation.cpp | |||
| @@ -177,9 +177,9 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QWidget* parent) { | |||
| 177 | translations->insert( | 177 | translations->insert( |
| 178 | {typeid(Settings::AstcDecodeMode), | 178 | {typeid(Settings::AstcDecodeMode), |
| 179 | { | 179 | { |
| 180 | {static_cast<u32>(Settings::AstcDecodeMode::CPU), tr("CPU")}, | 180 | {static_cast<u32>(Settings::AstcDecodeMode::Cpu), tr("CPU")}, |
| 181 | {static_cast<u32>(Settings::AstcDecodeMode::GPU), tr("GPU")}, | 181 | {static_cast<u32>(Settings::AstcDecodeMode::Gpu), tr("GPU")}, |
| 182 | {static_cast<u32>(Settings::AstcDecodeMode::CPUAsynchronous), tr("CPU Asynchronous")}, | 182 | {static_cast<u32>(Settings::AstcDecodeMode::CpuAsynchronous), tr("CPU Asynchronous")}, |
| 183 | }}); | 183 | }}); |
| 184 | translations->insert( | 184 | translations->insert( |
| 185 | {typeid(Settings::AstcRecompression), | 185 | {typeid(Settings::AstcRecompression), |
| @@ -199,24 +199,24 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QWidget* parent) { | |||
| 199 | }}); | 199 | }}); |
| 200 | translations->insert({typeid(Settings::ShaderBackend), | 200 | translations->insert({typeid(Settings::ShaderBackend), |
| 201 | { | 201 | { |
| 202 | {static_cast<u32>(Settings::ShaderBackend::GLSL), tr("GLSL")}, | 202 | {static_cast<u32>(Settings::ShaderBackend::Glsl), tr("GLSL")}, |
| 203 | {static_cast<u32>(Settings::ShaderBackend::GLASM), | 203 | {static_cast<u32>(Settings::ShaderBackend::Glasm), |
| 204 | tr("GLASM (Assembly Shaders, NVIDIA Only)")}, | 204 | tr("GLASM (Assembly Shaders, NVIDIA Only)")}, |
| 205 | {static_cast<u32>(Settings::ShaderBackend::SPIRV), | 205 | {static_cast<u32>(Settings::ShaderBackend::SpirV), |
| 206 | tr("SPIR-V (Experimental, Mesa Only)")}, | 206 | tr("SPIR-V (Experimental, Mesa Only)")}, |
| 207 | }}); | 207 | }}); |
| 208 | translations->insert({typeid(Settings::GPUAccuracy), | 208 | translations->insert({typeid(Settings::GpuAccuracy), |
| 209 | { | 209 | { |
| 210 | {static_cast<u32>(Settings::GPUAccuracy::Normal), tr("Normal")}, | 210 | {static_cast<u32>(Settings::GpuAccuracy::Normal), tr("Normal")}, |
| 211 | {static_cast<u32>(Settings::GPUAccuracy::High), tr("High")}, | 211 | {static_cast<u32>(Settings::GpuAccuracy::High), tr("High")}, |
| 212 | {static_cast<u32>(Settings::GPUAccuracy::Extreme), tr("Extreme")}, | 212 | {static_cast<u32>(Settings::GpuAccuracy::Extreme), tr("Extreme")}, |
| 213 | }}); | 213 | }}); |
| 214 | translations->insert({typeid(Settings::CPUAccuracy), | 214 | translations->insert({typeid(Settings::CpuAccuracy), |
| 215 | { | 215 | { |
| 216 | {static_cast<u32>(Settings::CPUAccuracy::Auto), tr("Auto")}, | 216 | {static_cast<u32>(Settings::CpuAccuracy::Auto), tr("Auto")}, |
| 217 | {static_cast<u32>(Settings::CPUAccuracy::Accurate), tr("Accurate")}, | 217 | {static_cast<u32>(Settings::CpuAccuracy::Accurate), tr("Accurate")}, |
| 218 | {static_cast<u32>(Settings::CPUAccuracy::Unsafe), tr("Unsafe")}, | 218 | {static_cast<u32>(Settings::CpuAccuracy::Unsafe), tr("Unsafe")}, |
| 219 | {static_cast<u32>(Settings::CPUAccuracy::Paranoid), | 219 | {static_cast<u32>(Settings::CpuAccuracy::Paranoid), |
| 220 | tr("Paranoid (disables most optimizations)")}, | 220 | tr("Paranoid (disables most optimizations)")}, |
| 221 | }}); | 221 | }}); |
| 222 | translations->insert( | 222 | translations->insert( |
| @@ -229,8 +229,8 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QWidget* parent) { | |||
| 229 | {typeid(Settings::NvdecEmulation), | 229 | {typeid(Settings::NvdecEmulation), |
| 230 | { | 230 | { |
| 231 | {static_cast<u32>(Settings::NvdecEmulation::Off), tr("No Video Output")}, | 231 | {static_cast<u32>(Settings::NvdecEmulation::Off), tr("No Video Output")}, |
| 232 | {static_cast<u32>(Settings::NvdecEmulation::CPU), tr("CPU Video Decoding")}, | 232 | {static_cast<u32>(Settings::NvdecEmulation::Cpu), tr("CPU Video Decoding")}, |
| 233 | {static_cast<u32>(Settings::NvdecEmulation::GPU), tr("GPU Video Decoding (Default)")}, | 233 | {static_cast<u32>(Settings::NvdecEmulation::Gpu), tr("GPU Video Decoding (Default)")}, |
| 234 | }}); | 234 | }}); |
| 235 | translations->insert( | 235 | translations->insert( |
| 236 | {typeid(Settings::ResolutionSetup), | 236 | {typeid(Settings::ResolutionSetup), |
| @@ -313,7 +313,7 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QWidget* parent) { | |||
| 313 | translations->insert({typeid(Settings::Region), | 313 | translations->insert({typeid(Settings::Region), |
| 314 | { | 314 | { |
| 315 | {static_cast<u32>(Settings::Region::Japan), tr("Japan")}, | 315 | {static_cast<u32>(Settings::Region::Japan), tr("Japan")}, |
| 316 | {static_cast<u32>(Settings::Region::USA), tr("USA")}, | 316 | {static_cast<u32>(Settings::Region::Usa), tr("USA")}, |
| 317 | {static_cast<u32>(Settings::Region::Europe), tr("Europe")}, | 317 | {static_cast<u32>(Settings::Region::Europe), tr("Europe")}, |
| 318 | {static_cast<u32>(Settings::Region::Australia), tr("Australia")}, | 318 | {static_cast<u32>(Settings::Region::Australia), tr("Australia")}, |
| 319 | {static_cast<u32>(Settings::Region::China), tr("China")}, | 319 | {static_cast<u32>(Settings::Region::China), tr("China")}, |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 6cd557c29..2922b3347 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1183,7 +1183,7 @@ void GMainWindow::InitializeWidgets() { | |||
| 1183 | QMenu context_menu; | 1183 | QMenu context_menu; |
| 1184 | 1184 | ||
| 1185 | for (auto const& gpu_accuracy_pair : Config::gpu_accuracy_texts_map) { | 1185 | for (auto const& gpu_accuracy_pair : Config::gpu_accuracy_texts_map) { |
| 1186 | if (gpu_accuracy_pair.first == Settings::GPUAccuracy::Extreme) { | 1186 | if (gpu_accuracy_pair.first == Settings::GpuAccuracy::Extreme) { |
| 1187 | continue; | 1187 | continue; |
| 1188 | } | 1188 | } |
| 1189 | context_menu.addAction(gpu_accuracy_pair.second, [this, gpu_accuracy_pair] { | 1189 | context_menu.addAction(gpu_accuracy_pair.second, [this, gpu_accuracy_pair] { |
| @@ -3651,14 +3651,14 @@ void GMainWindow::OnToggleDockedMode() { | |||
| 3651 | 3651 | ||
| 3652 | void GMainWindow::OnToggleGpuAccuracy() { | 3652 | void GMainWindow::OnToggleGpuAccuracy() { |
| 3653 | switch (Settings::values.gpu_accuracy.GetValue()) { | 3653 | switch (Settings::values.gpu_accuracy.GetValue()) { |
| 3654 | case Settings::GPUAccuracy::High: { | 3654 | case Settings::GpuAccuracy::High: { |
| 3655 | Settings::values.gpu_accuracy.SetValue(Settings::GPUAccuracy::Normal); | 3655 | Settings::values.gpu_accuracy.SetValue(Settings::GpuAccuracy::Normal); |
| 3656 | break; | 3656 | break; |
| 3657 | } | 3657 | } |
| 3658 | case Settings::GPUAccuracy::Normal: | 3658 | case Settings::GpuAccuracy::Normal: |
| 3659 | case Settings::GPUAccuracy::Extreme: | 3659 | case Settings::GpuAccuracy::Extreme: |
| 3660 | default: { | 3660 | default: { |
| 3661 | Settings::values.gpu_accuracy.SetValue(Settings::GPUAccuracy::High); | 3661 | Settings::values.gpu_accuracy.SetValue(Settings::GpuAccuracy::High); |
| 3662 | break; | 3662 | break; |
| 3663 | } | 3663 | } |
| 3664 | } | 3664 | } |
| @@ -4071,7 +4071,7 @@ void GMainWindow::UpdateGPUAccuracyButton() { | |||
| 4071 | const auto gpu_accuracy = Settings::values.gpu_accuracy.GetValue(); | 4071 | const auto gpu_accuracy = Settings::values.gpu_accuracy.GetValue(); |
| 4072 | const auto gpu_accuracy_text = Config::gpu_accuracy_texts_map.find(gpu_accuracy)->second; | 4072 | const auto gpu_accuracy_text = Config::gpu_accuracy_texts_map.find(gpu_accuracy)->second; |
| 4073 | gpu_accuracy_button->setText(gpu_accuracy_text.toUpper()); | 4073 | gpu_accuracy_button->setText(gpu_accuracy_text.toUpper()); |
| 4074 | gpu_accuracy_button->setChecked(gpu_accuracy != Settings::GPUAccuracy::Normal); | 4074 | gpu_accuracy_button->setChecked(gpu_accuracy != Settings::GpuAccuracy::Normal); |
| 4075 | } | 4075 | } |
| 4076 | 4076 | ||
| 4077 | void GMainWindow::UpdateDockedButton() { | 4077 | void GMainWindow::UpdateDockedButton() { |