2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

settings,general: Rename non-confirming enums

This commit is contained in:
lat9nq 2023-06-07 01:52:23 -04:00
parent 9e3c94bb3d
commit d146dd9d12
23 changed files with 136 additions and 130 deletions

View file

@ -82,11 +82,12 @@ const SinkDetails& GetOutputSinkDetails(Settings::AudioEngine sink_id) {
#else
iter = std::begin(sink_details);
#endif
LOG_INFO(Service_Audio, "Auto-selecting the {} backend", Settings::TranslateEnum(iter->id));
LOG_INFO(Service_Audio, "Auto-selecting the {} backend",
Settings::CanonicalizeEnum(iter->id));
}
if (iter == std::end(sink_details)) {
LOG_ERROR(Audio, "Invalid sink_id {}", Settings::TranslateEnum(sink_id));
LOG_ERROR(Audio, "Invalid sink_id {}", Settings::CanonicalizeEnum(sink_id));
iter = find_backend(Settings::AudioEngine::Null);
}

View file

@ -122,12 +122,12 @@ void SetConfiguringGlobal(bool is_global) {
}
bool IsGPULevelExtreme() {
return values.gpu_accuracy.GetValue() == GPUAccuracy::Extreme;
return values.gpu_accuracy.GetValue() == GpuAccuracy::Extreme;
}
bool IsGPULevelHigh() {
return values.gpu_accuracy.GetValue() == GPUAccuracy::Extreme ||
values.gpu_accuracy.GetValue() == GPUAccuracy::High;
return values.gpu_accuracy.GetValue() == GpuAccuracy::Extreme ||
values.gpu_accuracy.GetValue() == GpuAccuracy::High;
}
bool IsFastmemEnabled() {

View file

@ -91,6 +91,7 @@ public:
return {};
}
virtual void LoadString(const std::string& load) = 0;
virtual std::string Canonicalize() const = 0;
virtual const std::string& GetLabel() const = 0;
virtual std::string DefaultToString() const = 0;
virtual bool Save() const = 0;
@ -102,7 +103,7 @@ public:
virtual std::string MinVal() const = 0;
virtual std::string MaxVal() const = 0;
virtual bool UsingGlobal() const {
return false;
return true;
}
};
@ -245,7 +246,7 @@ protected:
} else if constexpr (std::is_same<Type, bool>()) {
return value_ ? "true" : "false";
} else if (std::is_same<Type, AudioEngine>()) {
return TranslateEnum(value_);
return CanonicalizeEnum(value_);
} else {
return std::to_string(static_cast<u64>(value_));
}
@ -321,6 +322,13 @@ public:
}
}
[[nodiscard]] std::string constexpr Canonicalize() const override {
if constexpr (std::is_enum<Type>::value) {
return CanonicalizeEnum(this->GetValue());
}
return ToString(this->GetValue());
}
/**
* Returns the save preference of the setting i.e. when saving or reading the setting from a
* frontend, whether this setting should be skipped.
@ -560,8 +568,8 @@ struct Values {
linkage, false, "use_unsafe_extended_memory_layout", Category::Core};
// Cpu
SwitchableSetting<CPUAccuracy, true> cpu_accuracy{linkage, CPUAccuracy::Auto,
CPUAccuracy::Auto, CPUAccuracy::Paranoid,
SwitchableSetting<CpuAccuracy, true> cpu_accuracy{linkage, CpuAccuracy::Auto,
CpuAccuracy::Auto, CpuAccuracy::Paranoid,
"cpu_accuracy", Category::Cpu};
// TODO: remove cpu_accuracy_first_time, migration setting added 8 July 2021
Setting<bool> cpu_accuracy_first_time{linkage, true, "cpu_accuracy_first_time", Category::Cpu};
@ -657,28 +665,28 @@ struct Values {
linkage, 100, 0, 9999, "speed_limit", Category::Renderer, true, true};
SwitchableSetting<bool> use_disk_shader_cache{linkage, true, "use_disk_shader_cache",
Category::Renderer};
SwitchableSetting<GPUAccuracy, true> gpu_accuracy{linkage,
GPUAccuracy::High,
GPUAccuracy::Normal,
GPUAccuracy::Extreme,
SwitchableSetting<GpuAccuracy, true> gpu_accuracy{linkage,
GpuAccuracy::High,
GpuAccuracy::Normal,
GpuAccuracy::Extreme,
"gpu_accuracy",
Category::RendererAdvanced,
true,
true};
SwitchableSetting<bool> use_asynchronous_gpu_emulation{
linkage, true, "use_asynchronous_gpu_emulation", Category::Renderer};
SwitchableSetting<NvdecEmulation> nvdec_emulation{linkage, NvdecEmulation::GPU,
SwitchableSetting<NvdecEmulation> nvdec_emulation{linkage, NvdecEmulation::Gpu,
"nvdec_emulation", Category::Renderer};
SwitchableSetting<AstcDecodeMode, true> accelerate_astc{linkage,
AstcDecodeMode::CPU,
AstcDecodeMode::CPU,
AstcDecodeMode::CPUAsynchronous,
AstcDecodeMode::Cpu,
AstcDecodeMode::Cpu,
AstcDecodeMode::CpuAsynchronous,
"accelerate_astc",
Category::Renderer};
Setting<VSyncMode, true> vsync_mode{linkage,
VSyncMode::FIFO,
VSyncMode::Fifo,
VSyncMode::Immediate,
VSyncMode::FIFORelaxed,
VSyncMode::FifoRelaxed,
"use_vsync",
Category::Renderer,
true,
@ -686,7 +694,7 @@ struct Values {
SwitchableSetting<bool> use_reactive_flushing{linkage, true, "use_reactive_flushing",
Category::RendererAdvanced};
SwitchableSetting<ShaderBackend, true> shader_backend{
linkage, ShaderBackend::GLSL, ShaderBackend::GLSL, ShaderBackend::SPIRV,
linkage, ShaderBackend::Glsl, ShaderBackend::Glsl, ShaderBackend::SpirV,
"shader_backend", Category::Renderer};
SwitchableSetting<bool> use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders",
Category::RendererAdvanced};
@ -730,7 +738,7 @@ struct Values {
Language::PortugueseBrazilian,
"language_index",
Category::System};
SwitchableSetting<Region, true> region_index{linkage, Region::USA, Region::Japan,
SwitchableSetting<Region, true> region_index{linkage, Region::Usa, Region::Japan,
Region::Taiwan, "region_index", Category::System};
SwitchableSetting<TimeZone, true> time_zone_index{linkage, TimeZone::Auto,
TimeZone::Auto, TimeZone::Zulu,

View file

@ -47,7 +47,7 @@ enum class Language : u32 {
enum class Region : u32 {
Japan,
USA,
Usa,
Europe,
Australia,
China,
@ -114,9 +114,9 @@ enum class AnisotropyMode : u32 {
};
enum class AstcDecodeMode : u32 {
CPU = 0,
GPU = 1,
CPUAsynchronous = 2,
Cpu = 0,
Gpu = 1,
CpuAsynchronous = 2,
};
enum class AstcRecompression : u32 {
@ -128,8 +128,8 @@ enum class AstcRecompression : u32 {
enum class VSyncMode : u32 {
Immediate = 0,
Mailbox = 1,
FIFO = 2,
FIFORelaxed = 3,
Fifo = 2,
FifoRelaxed = 3,
};
enum class RendererBackend : u32 {
@ -139,19 +139,18 @@ enum class RendererBackend : u32 {
};
enum class ShaderBackend : u32 {
GLSL = 0,
GLASM = 1,
SPIRV = 2,
Glsl = 0,
Glasm = 1,
SpirV = 2,
};
enum class GPUAccuracy : u32 {
enum class GpuAccuracy : u32 {
Normal = 0,
High = 1,
Extreme = 2,
MaxEnum = 3,
};
enum class CPUAccuracy : u32 {
enum class CpuAccuracy : u32 {
Auto = 0,
Accurate = 1,
Unsafe = 2,
@ -165,8 +164,8 @@ enum class FullscreenMode : u32 {
enum class NvdecEmulation : u32 {
Off = 0,
CPU = 1,
GPU = 2,
Cpu = 1,
Gpu = 2,
};
enum class ResolutionSetup : u32 {
@ -220,18 +219,18 @@ static std::map<std::type_index, std::map<std::string, u32>> translations = {
static std::string empty_string{};
template <typename Type>
const std::string& TranslateEnum(Type id) {
auto& group = translations.at(typeid(Type));
const std::string& CanonicalizeEnum(Type id) {
auto& group = canonicalizations.at(typeid(Type));
for (auto& [name, value] : group) {
if (static_cast<Type>(value) == id) {
return name;
}
}
return empty_string;
return invalid_string;
}
template <typename Type>
static Type ToEnum(const std::string& text) {
return static_cast<Type>(translations.at(typeid(Type)).at(text));
static Type ToEnum(const std::string& canonicalization) {
return static_cast<Type>(canonicalizations.at(typeid(Type)).at(canonicalization));
}
} // namespace Settings

View file

@ -287,7 +287,7 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable*
}
} else {
// Unsafe optimizations
if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::Unsafe) {
if (Settings::values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Unsafe) {
config.unsafe_optimizations = true;
if (Settings::values.cpuopt_unsafe_unfuse_fma) {
config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_UnfuseFMA;
@ -307,7 +307,7 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable*
}
// Curated optimizations
if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::Auto) {
if (Settings::values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Auto) {
config.unsafe_optimizations = true;
config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_UnfuseFMA;
config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_IgnoreStandardFPCRValue;
@ -316,7 +316,7 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable*
}
// Paranoia mode for debugging optimizations
if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::Paranoid) {
if (Settings::values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Paranoid) {
config.unsafe_optimizations = false;
config.optimizations = Dynarmic::no_optimizations;
}

View file

@ -347,7 +347,7 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable*
}
} else {
// Unsafe optimizations
if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::Unsafe) {
if (Settings::values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Unsafe) {
config.unsafe_optimizations = true;
if (Settings::values.cpuopt_unsafe_unfuse_fma) {
config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_UnfuseFMA;
@ -367,7 +367,7 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable*
}
// Curated optimizations
if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::Auto) {
if (Settings::values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Auto) {
config.unsafe_optimizations = true;
config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_UnfuseFMA;
config.fastmem_address_space_bits = 64;
@ -375,7 +375,7 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable*
}
// Paranoia mode for debugging optimizations
if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::Paranoid) {
if (Settings::values.cpu_accuracy.GetValue() == Settings::CpuAccuracy::Paranoid) {
config.unsafe_optimizations = false;
config.optimizations = Dynarmic::no_optimizations;
}

View file

@ -61,16 +61,14 @@ static const char* TranslateRenderer(Settings::RendererBackend backend) {
return "Unknown";
}
static const char* TranslateGPUAccuracyLevel(Settings::GPUAccuracy backend) {
static const char* TranslateGPUAccuracyLevel(Settings::GpuAccuracy backend) {
switch (backend) {
case Settings::GPUAccuracy::Normal:
case Settings::GpuAccuracy::Normal:
return "Normal";
case Settings::GPUAccuracy::High:
case Settings::GpuAccuracy::High:
return "High";
case Settings::GPUAccuracy::Extreme:
case Settings::GpuAccuracy::Extreme:
return "Extreme";
case Settings::GPUAccuracy::MaxEnum:
break;
}
return "Unknown";
}
@ -79,9 +77,9 @@ static const char* TranslateNvdecEmulation(Settings::NvdecEmulation backend) {
switch (backend) {
case Settings::NvdecEmulation::Off:
return "Off";
case Settings::NvdecEmulation::CPU:
case Settings::NvdecEmulation::Cpu:
return "CPU";
case Settings::NvdecEmulation::GPU:
case Settings::NvdecEmulation::Gpu:
return "GPU";
}
return "Unknown";
@ -93,9 +91,9 @@ static constexpr const char* TranslateVSyncMode(Settings::VSyncMode mode) {
return "Immediate";
case Settings::VSyncMode::Mailbox:
return "Mailbox";
case Settings::VSyncMode::FIFO:
case Settings::VSyncMode::Fifo:
return "FIFO";
case Settings::VSyncMode::FIFORelaxed:
case Settings::VSyncMode::FifoRelaxed:
return "FIFO Relaxed";
}
return "Unknown";
@ -103,11 +101,11 @@ static constexpr const char* TranslateVSyncMode(Settings::VSyncMode mode) {
static constexpr const char* TranslateASTCDecodeMode(Settings::AstcDecodeMode mode) {
switch (mode) {
case Settings::AstcDecodeMode::CPU:
case Settings::AstcDecodeMode::Cpu:
return "CPU";
case Settings::AstcDecodeMode::GPU:
case Settings::AstcDecodeMode::Gpu:
return "GPU";
case Settings::AstcDecodeMode::CPUAsynchronous:
case Settings::AstcDecodeMode::CpuAsynchronous:
return "CPU Asynchronous";
}
return "Unknown";
@ -255,7 +253,7 @@ void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader,
// Log user configuration information
constexpr auto field_type = Telemetry::FieldType::UserConfig;
AddField(field_type, "Audio_SinkId",
Settings::TranslateEnum(Settings::values.sink_id.GetValue()));
Settings::CanonicalizeEnum(Settings::values.sink_id.GetValue()));
AddField(field_type, "Core_UseMultiCore", Settings::values.use_multi_core.GetValue());
AddField(field_type, "Renderer_Backend",
TranslateRenderer(Settings::values.renderer_backend.GetValue()));

View file

@ -247,7 +247,7 @@ void Codec::Initialize() {
av_codec = avcodec_find_decoder(codec);
InitializeAvCodecContext();
if (Settings::values.nvdec_emulation.GetValue() == Settings::NvdecEmulation::GPU) {
if (Settings::values.nvdec_emulation.GetValue() == Settings::NvdecEmulation::Gpu) {
InitializeGpuDecoder();
}
if (const int res = avcodec_open2(av_codec_ctx, av_codec, nullptr); res < 0) {

View file

@ -84,7 +84,7 @@ std::span<const u8> H264::ComposeFrame(const Host1x::NvdecCommon::NvdecRegisters
// TODO (ameerj): Where do we get this number, it seems to be particular for each stream
const auto nvdec_decoding = Settings::values.nvdec_emulation.GetValue();
const bool uses_gpu_decoding = nvdec_decoding == Settings::NvdecEmulation::GPU;
const bool uses_gpu_decoding = nvdec_decoding == Settings::NvdecEmulation::Gpu;
const u32 max_num_ref_frames = uses_gpu_decoding ? 6u : 16u;
writer.WriteUe(max_num_ref_frames);
writer.WriteBit(false);

View file

@ -34,13 +34,13 @@ ComputePipeline::ComputePipeline(const Device& device, TextureCache& texture_cac
: texture_cache{texture_cache_}, buffer_cache{buffer_cache_},
program_manager{program_manager_}, info{info_} {
switch (device.GetShaderBackend()) {
case Settings::ShaderBackend::GLSL:
case Settings::ShaderBackend::Glsl:
source_program = CreateProgram(code, GL_COMPUTE_SHADER);
break;
case Settings::ShaderBackend::GLASM:
case Settings::ShaderBackend::Glasm:
assembly_program = CompileProgram(code, GL_COMPUTE_PROGRAM_NV);
break;
case Settings::ShaderBackend::SPIRV:
case Settings::ShaderBackend::SpirV:
source_program = CreateProgram(code_v, GL_COMPUTE_SHADER);
break;
}

View file

@ -177,15 +177,15 @@ Device::Device(Core::Frontend::EmuWindow& emu_window) {
has_fast_buffer_sub_data = is_nvidia && !disable_fast_buffer_sub_data;
shader_backend = Settings::values.shader_backend.GetValue();
use_assembly_shaders = shader_backend == Settings::ShaderBackend::GLASM &&
use_assembly_shaders = shader_backend == Settings::ShaderBackend::Glasm &&
GLAD_GL_NV_gpu_program5 && GLAD_GL_NV_compute_program5 &&
GLAD_GL_NV_transform_feedback && GLAD_GL_NV_transform_feedback2;
if (shader_backend == Settings::ShaderBackend::GLASM && !use_assembly_shaders) {
if (shader_backend == Settings::ShaderBackend::Glasm && !use_assembly_shaders) {
LOG_ERROR(Render_OpenGL, "Assembly shaders enabled but not supported");
shader_backend = Settings::ShaderBackend::GLSL;
shader_backend = Settings::ShaderBackend::Glsl;
}
if (shader_backend == Settings::ShaderBackend::GLSL && is_nvidia) {
if (shader_backend == Settings::ShaderBackend::Glsl && is_nvidia) {
const std::string_view driver_version = version.substr(13);
const int version_major =
std::atoi(driver_version.substr(0, driver_version.find(".")).data());

View file

@ -236,18 +236,18 @@ GraphicsPipeline::GraphicsPipeline(const Device& device, TextureCache& texture_c
force_context_flush](ShaderContext::Context*) mutable {
for (size_t stage = 0; stage < 5; ++stage) {
switch (backend) {
case Settings::ShaderBackend::GLSL:
case Settings::ShaderBackend::Glsl:
if (!sources_[stage].empty()) {
source_programs[stage] = CreateProgram(sources_[stage], Stage(stage));
}
break;
case Settings::ShaderBackend::GLASM:
case Settings::ShaderBackend::Glasm:
if (!sources_[stage].empty()) {
assembly_programs[stage] =
CompileProgram(sources_[stage], AssemblyStage(stage));
}
break;
case Settings::ShaderBackend::SPIRV:
case Settings::ShaderBackend::SpirV:
if (!sources_spirv_[stage].empty()) {
source_programs[stage] = CreateProgram(sources_spirv_[stage], Stage(stage));
}

View file

@ -522,14 +522,14 @@ std::unique_ptr<GraphicsPipeline> ShaderCache::CreateGraphicsPipeline(
const auto runtime_info{
MakeRuntimeInfo(key, program, previous_program, glasm_use_storage_buffers, use_glasm)};
switch (device.GetShaderBackend()) {
case Settings::ShaderBackend::GLSL:
case Settings::ShaderBackend::Glsl:
ConvertLegacyToGeneric(program, runtime_info);
sources[stage_index] = EmitGLSL(profile, runtime_info, program, binding);
break;
case Settings::ShaderBackend::GLASM:
case Settings::ShaderBackend::Glasm:
sources[stage_index] = EmitGLASM(profile, runtime_info, program, binding);
break;
case Settings::ShaderBackend::SPIRV:
case Settings::ShaderBackend::SpirV:
ConvertLegacyToGeneric(program, runtime_info);
sources_spirv[stage_index] = EmitSPIRV(profile, runtime_info, program, binding);
break;
@ -582,13 +582,13 @@ std::unique_ptr<ComputePipeline> ShaderCache::CreateComputePipeline(
std::string code{};
std::vector<u32> code_spirv;
switch (device.GetShaderBackend()) {
case Settings::ShaderBackend::GLSL:
case Settings::ShaderBackend::Glsl:
code = EmitGLSL(profile, program);
break;
case Settings::ShaderBackend::GLASM:
case Settings::ShaderBackend::Glasm:
code = EmitGLASM(profile, info, program);
break;
case Settings::ShaderBackend::SPIRV:
case Settings::ShaderBackend::SpirV:
code_spirv = EmitSPIRV(profile, program);
break;
}

View file

@ -232,7 +232,7 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4
[[nodiscard]] bool CanBeAccelerated(const TextureCacheRuntime& runtime,
const VideoCommon::ImageInfo& info) {
if (IsPixelFormatASTC(info.format) && info.size.depth == 1 && !runtime.HasNativeASTC()) {
return Settings::values.accelerate_astc.GetValue() == Settings::AstcDecodeMode::GPU &&
return Settings::values.accelerate_astc.GetValue() == Settings::AstcDecodeMode::Gpu &&
Settings::values.astc_recompression.GetValue() ==
Settings::AstcRecompression::Uncompressed;
}
@ -267,7 +267,7 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4
const VideoCommon::ImageInfo& info) {
if (IsPixelFormatASTC(info.format) && !runtime.HasNativeASTC()) {
return Settings::values.accelerate_astc.GetValue() ==
Settings::AstcDecodeMode::CPUAsynchronous;
Settings::AstcDecodeMode::CpuAsynchronous;
}
return false;
}

View file

@ -45,8 +45,8 @@ static VkPresentModeKHR ChooseSwapPresentMode(bool has_imm, bool has_mailbox,
return mode;
}
switch (mode) {
case Settings::VSyncMode::FIFO:
case Settings::VSyncMode::FIFORelaxed:
case Settings::VSyncMode::Fifo:
case Settings::VSyncMode::FifoRelaxed:
if (has_mailbox) {
return Settings::VSyncMode::Mailbox;
} else if (has_imm) {
@ -59,8 +59,8 @@ static VkPresentModeKHR ChooseSwapPresentMode(bool has_imm, bool has_mailbox,
}();
if ((setting == Settings::VSyncMode::Mailbox && !has_mailbox) ||
(setting == Settings::VSyncMode::Immediate && !has_imm) ||
(setting == Settings::VSyncMode::FIFORelaxed && !has_fifo_relaxed)) {
setting = Settings::VSyncMode::FIFO;
(setting == Settings::VSyncMode::FifoRelaxed && !has_fifo_relaxed)) {
setting = Settings::VSyncMode::Fifo;
}
switch (setting) {
@ -68,9 +68,9 @@ static VkPresentModeKHR ChooseSwapPresentMode(bool has_imm, bool has_mailbox,
return VK_PRESENT_MODE_IMMEDIATE_KHR;
case Settings::VSyncMode::Mailbox:
return VK_PRESENT_MODE_MAILBOX_KHR;
case Settings::VSyncMode::FIFO:
case Settings::VSyncMode::Fifo:
return VK_PRESENT_MODE_FIFO_KHR;
case Settings::VSyncMode::FIFORelaxed:
case Settings::VSyncMode::FifoRelaxed:
return VK_PRESENT_MODE_FIFO_RELAXED_KHR;
default:
return VK_PRESENT_MODE_FIFO_KHR;

View file

@ -817,7 +817,7 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched
: device{device_}, scheduler{scheduler_}, memory_allocator{memory_allocator_},
staging_buffer_pool{staging_buffer_pool_}, blit_image_helper{blit_image_helper_},
render_pass_cache{render_pass_cache_}, resolution{Settings::values.resolution_info} {
if (Settings::values.accelerate_astc.GetValue() == Settings::AstcDecodeMode::GPU) {
if (Settings::values.accelerate_astc.GetValue() == Settings::AstcDecodeMode::Gpu) {
astc_decoder_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool,
compute_pass_descriptor_queue, memory_allocator);
}
@ -1302,14 +1302,14 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu
aspect_mask(ImageAspectMask(info.format)) {
if (IsPixelFormatASTC(info.format) && !runtime->device.IsOptimalAstcSupported()) {
switch (Settings::values.accelerate_astc.GetValue()) {
case Settings::AstcDecodeMode::GPU:
case Settings::AstcDecodeMode::Gpu:
if (Settings::values.astc_recompression.GetValue() ==
Settings::AstcRecompression::Uncompressed &&
info.size.depth == 1) {
flags |= VideoCommon::ImageFlagBits::AcceleratedUpload;
}
break;
case Settings::AstcDecodeMode::CPUAsynchronous:
case Settings::AstcDecodeMode::CpuAsynchronous:
flags |= VideoCommon::ImageFlagBits::AsynchronousDecode;
break;
default:

View file

@ -89,10 +89,10 @@ const std::map<bool, QString> Config::use_docked_mode_texts_map = {
{false, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Handheld"))},
};
const std::map<Settings::GPUAccuracy, QString> Config::gpu_accuracy_texts_map = {
{Settings::GPUAccuracy::Normal, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Normal"))},
{Settings::GPUAccuracy::High, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "High"))},
{Settings::GPUAccuracy::Extreme, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Extreme"))},
const std::map<Settings::GpuAccuracy, QString> Config::gpu_accuracy_texts_map = {
{Settings::GpuAccuracy::Normal, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Normal"))},
{Settings::GpuAccuracy::High, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "High"))},
{Settings::GpuAccuracy::Extreme, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Extreme"))},
};
const std::map<Settings::RendererBackend, QString> Config::renderer_backend_texts_map = {

View file

@ -52,7 +52,7 @@ public:
static const std::map<Settings::AntiAliasing, QString> anti_aliasing_texts_map;
static const std::map<Settings::ScalingFilter, QString> scaling_filter_texts_map;
static const std::map<bool, QString> use_docked_mode_texts_map;
static const std::map<Settings::GPUAccuracy, QString> gpu_accuracy_texts_map;
static const std::map<Settings::GpuAccuracy, QString> gpu_accuracy_texts_map;
static const std::map<Settings::RendererBackend, QString> renderer_backend_texts_map;
static const std::map<Settings::ShaderBackend, QString> shader_backend_texts_map;
@ -211,8 +211,8 @@ private:
};
// These metatype declarations cannot be in common/settings.h because core is devoid of QT
Q_DECLARE_METATYPE(Settings::CPUAccuracy);
Q_DECLARE_METATYPE(Settings::GPUAccuracy);
Q_DECLARE_METATYPE(Settings::CpuAccuracy);
Q_DECLARE_METATYPE(Settings::GpuAccuracy);
Q_DECLARE_METATYPE(Settings::FullscreenMode);
Q_DECLARE_METATYPE(Settings::NvdecEmulation);
Q_DECLARE_METATYPE(Settings::ResolutionSetup);

View file

@ -188,7 +188,7 @@ void ConfigureAudio::InitializeAudioSinkComboBox() {
sink_combo_box->addItem(QString::fromUtf8(AudioCore::Sink::auto_device_name));
for (const auto& id : AudioCore::Sink::GetSinkIDs()) {
sink_combo_box->addItem(QString::fromStdString(Settings::TranslateEnum(id)));
sink_combo_box->addItem(QString::fromStdString(Settings::CanonicalizeEnum(id)));
}
}

View file

@ -73,9 +73,9 @@ void ConfigureCpu::Setup() {
}
void ConfigureCpu::UpdateGroup(int index) {
const auto accuracy = static_cast<Settings::CPUAccuracy>(
combobox_translations.at(typeid(Settings::CPUAccuracy))[index].first);
ui->unsafe_group->setVisible(accuracy == Settings::CPUAccuracy::Unsafe);
const auto accuracy = static_cast<Settings::CpuAccuracy>(
combobox_translations.at(typeid(Settings::CpuAccuracy))[index].first);
ui->unsafe_group->setVisible(accuracy == Settings::CpuAccuracy::Unsafe);
}
void ConfigureCpu::ApplyConfiguration() {

View file

@ -51,9 +51,9 @@ static constexpr VkPresentModeKHR VSyncSettingToMode(Settings::VSyncMode mode) {
return VK_PRESENT_MODE_IMMEDIATE_KHR;
case Settings::VSyncMode::Mailbox:
return VK_PRESENT_MODE_MAILBOX_KHR;
case Settings::VSyncMode::FIFO:
case Settings::VSyncMode::Fifo:
return VK_PRESENT_MODE_FIFO_KHR;
case Settings::VSyncMode::FIFORelaxed:
case Settings::VSyncMode::FifoRelaxed:
return VK_PRESENT_MODE_FIFO_RELAXED_KHR;
default:
return VK_PRESENT_MODE_FIFO_KHR;
@ -67,11 +67,11 @@ static constexpr Settings::VSyncMode PresentModeToSetting(VkPresentModeKHR mode)
case VK_PRESENT_MODE_MAILBOX_KHR:
return Settings::VSyncMode::Mailbox;
case VK_PRESENT_MODE_FIFO_KHR:
return Settings::VSyncMode::FIFO;
return Settings::VSyncMode::Fifo;
case VK_PRESENT_MODE_FIFO_RELAXED_KHR:
return Settings::VSyncMode::FIFORelaxed;
return Settings::VSyncMode::FifoRelaxed;
default:
return Settings::VSyncMode::FIFO;
return Settings::VSyncMode::Fifo;
}
}

View file

@ -177,9 +177,9 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QWidget* parent) {
translations->insert(
{typeid(Settings::AstcDecodeMode),
{
{static_cast<u32>(Settings::AstcDecodeMode::CPU), tr("CPU")},
{static_cast<u32>(Settings::AstcDecodeMode::GPU), tr("GPU")},
{static_cast<u32>(Settings::AstcDecodeMode::CPUAsynchronous), tr("CPU Asynchronous")},
{static_cast<u32>(Settings::AstcDecodeMode::Cpu), tr("CPU")},
{static_cast<u32>(Settings::AstcDecodeMode::Gpu), tr("GPU")},
{static_cast<u32>(Settings::AstcDecodeMode::CpuAsynchronous), tr("CPU Asynchronous")},
}});
translations->insert(
{typeid(Settings::AstcRecompression),
@ -199,24 +199,24 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QWidget* parent) {
}});
translations->insert({typeid(Settings::ShaderBackend),
{
{static_cast<u32>(Settings::ShaderBackend::GLSL), tr("GLSL")},
{static_cast<u32>(Settings::ShaderBackend::GLASM),
{static_cast<u32>(Settings::ShaderBackend::Glsl), tr("GLSL")},
{static_cast<u32>(Settings::ShaderBackend::Glasm),
tr("GLASM (Assembly Shaders, NVIDIA Only)")},
{static_cast<u32>(Settings::ShaderBackend::SPIRV),
{static_cast<u32>(Settings::ShaderBackend::SpirV),
tr("SPIR-V (Experimental, Mesa Only)")},
}});
translations->insert({typeid(Settings::GPUAccuracy),
translations->insert({typeid(Settings::GpuAccuracy),
{
{static_cast<u32>(Settings::GPUAccuracy::Normal), tr("Normal")},
{static_cast<u32>(Settings::GPUAccuracy::High), tr("High")},
{static_cast<u32>(Settings::GPUAccuracy::Extreme), tr("Extreme")},
{static_cast<u32>(Settings::GpuAccuracy::Normal), tr("Normal")},
{static_cast<u32>(Settings::GpuAccuracy::High), tr("High")},
{static_cast<u32>(Settings::GpuAccuracy::Extreme), tr("Extreme")},
}});
translations->insert({typeid(Settings::CPUAccuracy),
translations->insert({typeid(Settings::CpuAccuracy),
{
{static_cast<u32>(Settings::CPUAccuracy::Auto), tr("Auto")},
{static_cast<u32>(Settings::CPUAccuracy::Accurate), tr("Accurate")},
{static_cast<u32>(Settings::CPUAccuracy::Unsafe), tr("Unsafe")},
{static_cast<u32>(Settings::CPUAccuracy::Paranoid),
{static_cast<u32>(Settings::CpuAccuracy::Auto), tr("Auto")},
{static_cast<u32>(Settings::CpuAccuracy::Accurate), tr("Accurate")},
{static_cast<u32>(Settings::CpuAccuracy::Unsafe), tr("Unsafe")},
{static_cast<u32>(Settings::CpuAccuracy::Paranoid),
tr("Paranoid (disables most optimizations)")},
}});
translations->insert(
@ -229,8 +229,8 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QWidget* parent) {
{typeid(Settings::NvdecEmulation),
{
{static_cast<u32>(Settings::NvdecEmulation::Off), tr("No Video Output")},
{static_cast<u32>(Settings::NvdecEmulation::CPU), tr("CPU Video Decoding")},
{static_cast<u32>(Settings::NvdecEmulation::GPU), tr("GPU Video Decoding (Default)")},
{static_cast<u32>(Settings::NvdecEmulation::Cpu), tr("CPU Video Decoding")},
{static_cast<u32>(Settings::NvdecEmulation::Gpu), tr("GPU Video Decoding (Default)")},
}});
translations->insert(
{typeid(Settings::ResolutionSetup),
@ -313,7 +313,7 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QWidget* parent) {
translations->insert({typeid(Settings::Region),
{
{static_cast<u32>(Settings::Region::Japan), tr("Japan")},
{static_cast<u32>(Settings::Region::USA), tr("USA")},
{static_cast<u32>(Settings::Region::Usa), tr("USA")},
{static_cast<u32>(Settings::Region::Europe), tr("Europe")},
{static_cast<u32>(Settings::Region::Australia), tr("Australia")},
{static_cast<u32>(Settings::Region::China), tr("China")},

View file

@ -1183,7 +1183,7 @@ void GMainWindow::InitializeWidgets() {
QMenu context_menu;
for (auto const& gpu_accuracy_pair : Config::gpu_accuracy_texts_map) {
if (gpu_accuracy_pair.first == Settings::GPUAccuracy::Extreme) {
if (gpu_accuracy_pair.first == Settings::GpuAccuracy::Extreme) {
continue;
}
context_menu.addAction(gpu_accuracy_pair.second, [this, gpu_accuracy_pair] {
@ -3651,14 +3651,14 @@ void GMainWindow::OnToggleDockedMode() {
void GMainWindow::OnToggleGpuAccuracy() {
switch (Settings::values.gpu_accuracy.GetValue()) {
case Settings::GPUAccuracy::High: {
Settings::values.gpu_accuracy.SetValue(Settings::GPUAccuracy::Normal);
case Settings::GpuAccuracy::High: {
Settings::values.gpu_accuracy.SetValue(Settings::GpuAccuracy::Normal);
break;
}
case Settings::GPUAccuracy::Normal:
case Settings::GPUAccuracy::Extreme:
case Settings::GpuAccuracy::Normal:
case Settings::GpuAccuracy::Extreme:
default: {
Settings::values.gpu_accuracy.SetValue(Settings::GPUAccuracy::High);
Settings::values.gpu_accuracy.SetValue(Settings::GpuAccuracy::High);
break;
}
}
@ -4071,7 +4071,7 @@ void GMainWindow::UpdateGPUAccuracyButton() {
const auto gpu_accuracy = Settings::values.gpu_accuracy.GetValue();
const auto gpu_accuracy_text = Config::gpu_accuracy_texts_map.find(gpu_accuracy)->second;
gpu_accuracy_button->setText(gpu_accuracy_text.toUpper());
gpu_accuracy_button->setChecked(gpu_accuracy != Settings::GPUAccuracy::Normal);
gpu_accuracy_button->setChecked(gpu_accuracy != Settings::GpuAccuracy::Normal);
}
void GMainWindow::UpdateDockedButton() {