summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlat9nq <22451773+lat9nq@users.noreply.github.com>2021-05-16 02:46:48 +0200
committerlat9nq <22451773+lat9nq@users.noreply.github.com>2021-05-16 02:46:48 +0200
commite169fdad4f89675f5b56a3ca5004d593792426a0 (patch)
treee52425c637fd16bacb4ee72fa18922c10b0fc5b9
parentMerge pull request #6300 from Morph1984/mbedtls (diff)
downloadyuzu-e169fdad4f89675f5b56a3ca5004d593792426a0.tar
yuzu-e169fdad4f89675f5b56a3ca5004d593792426a0.tar.gz
yuzu-e169fdad4f89675f5b56a3ca5004d593792426a0.tar.bz2
yuzu-e169fdad4f89675f5b56a3ca5004d593792426a0.tar.lz
yuzu-e169fdad4f89675f5b56a3ca5004d593792426a0.tar.xz
yuzu-e169fdad4f89675f5b56a3ca5004d593792426a0.tar.zst
yuzu-e169fdad4f89675f5b56a3ca5004d593792426a0.zip
-rw-r--r--src/common/settings.cpp2
-rw-r--r--src/common/settings.h8
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic_32.cpp10
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic_64.cpp10
-rw-r--r--src/yuzu/configuration/config.cpp33
-rw-r--r--src/yuzu/configuration/config.h1
-rw-r--r--src/yuzu/configuration/configure_cpu.cpp24
7 files changed, 47 insertions, 41 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp
index 702b6598d..b9a549c81 100644
--- a/src/common/settings.cpp
+++ b/src/common/settings.cpp
@@ -42,7 +42,7 @@ void LogSettings() {
log_setting("System_RegionIndex", values.region_index.GetValue());
log_setting("System_TimeZoneIndex", values.time_zone_index.GetValue());
log_setting("Core_UseMultiCore", values.use_multi_core.GetValue());
- log_setting("CPU_Accuracy", values.cpu_accuracy);
+ log_setting("CPU_Accuracy", values.cpu_accuracy.GetValue());
log_setting("Renderer_UseResolutionFactor", values.resolution_factor.GetValue());
log_setting("Renderer_UseFrameLimit", values.use_frame_limit.GetValue());
log_setting("Renderer_FrameLimit", values.frame_limit.GetValue());
diff --git a/src/common/settings.h b/src/common/settings.h
index d39b4aa45..68dc2ea7d 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -115,7 +115,7 @@ struct Values {
Setting<bool> use_multi_core;
// Cpu
- CPUAccuracy cpu_accuracy;
+ Setting<CPUAccuracy> cpu_accuracy;
bool cpuopt_page_tables;
bool cpuopt_block_linking;
@@ -126,9 +126,9 @@ struct Values {
bool cpuopt_misc_ir;
bool cpuopt_reduce_misalign_checks;
- bool cpuopt_unsafe_unfuse_fma;
- bool cpuopt_unsafe_reduce_fp_error;
- bool cpuopt_unsafe_inaccurate_nan;
+ Setting<bool> cpuopt_unsafe_unfuse_fma;
+ Setting<bool> cpuopt_unsafe_reduce_fp_error;
+ Setting<bool> cpuopt_unsafe_inaccurate_nan;
// Renderer
Setting<RendererBackend> renderer_backend;
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp
index 42a37e84f..3535a3d11 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp
+++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp
@@ -142,7 +142,7 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable*
config.far_code_offset = 256 * 1024 * 1024;
// Safe optimizations
- if (Settings::values.cpu_accuracy == Settings::CPUAccuracy::DebugMode) {
+ if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::DebugMode) {
if (!Settings::values.cpuopt_page_tables) {
config.page_table = nullptr;
}
@@ -170,15 +170,15 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable*
}
// Unsafe optimizations
- if (Settings::values.cpu_accuracy == Settings::CPUAccuracy::Unsafe) {
+ if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::Unsafe) {
config.unsafe_optimizations = true;
- if (Settings::values.cpuopt_unsafe_unfuse_fma) {
+ if (Settings::values.cpuopt_unsafe_unfuse_fma.GetValue()) {
config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_UnfuseFMA;
}
- if (Settings::values.cpuopt_unsafe_reduce_fp_error) {
+ if (Settings::values.cpuopt_unsafe_reduce_fp_error.GetValue()) {
config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_ReducedErrorFP;
}
- if (Settings::values.cpuopt_unsafe_inaccurate_nan) {
+ if (Settings::values.cpuopt_unsafe_inaccurate_nan.GetValue()) {
config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_InaccurateNaN;
}
}
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp
index 653bb7a77..7e1f654db 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp
+++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp
@@ -182,7 +182,7 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable*
config.far_code_offset = 256 * 1024 * 1024;
// Safe optimizations
- if (Settings::values.cpu_accuracy == Settings::CPUAccuracy::DebugMode) {
+ if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::DebugMode) {
if (!Settings::values.cpuopt_page_tables) {
config.page_table = nullptr;
}
@@ -210,15 +210,15 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable*
}
// Unsafe optimizations
- if (Settings::values.cpu_accuracy == Settings::CPUAccuracy::Unsafe) {
+ if (Settings::values.cpu_accuracy.GetValue() == Settings::CPUAccuracy::Unsafe) {
config.unsafe_optimizations = true;
- if (Settings::values.cpuopt_unsafe_unfuse_fma) {
+ if (Settings::values.cpuopt_unsafe_unfuse_fma.GetValue()) {
config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_UnfuseFMA;
}
- if (Settings::values.cpuopt_unsafe_reduce_fp_error) {
+ if (Settings::values.cpuopt_unsafe_reduce_fp_error.GetValue()) {
config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_ReducedErrorFP;
}
- if (Settings::values.cpuopt_unsafe_inaccurate_nan) {
+ if (Settings::values.cpuopt_unsafe_inaccurate_nan.GetValue()) {
config.optimizations |= Dynarmic::OptimizationFlag::Unsafe_InaccurateNaN;
}
}
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index e80a3df77..24d46c7cc 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -737,8 +737,7 @@ void Config::ReadCpuValues() {
qt_config->beginGroup(QStringLiteral("Cpu"));
if (global) {
- Settings::values.cpu_accuracy = static_cast<Settings::CPUAccuracy>(
- ReadSetting(QStringLiteral("cpu_accuracy"), 0).toInt());
+ ReadSettingGlobal(Settings::values.cpu_accuracy, QStringLiteral("cpu_accuracy"), 0);
Settings::values.cpuopt_page_tables =
ReadSetting(QStringLiteral("cpuopt_page_tables"), true).toBool();
@@ -757,12 +756,12 @@ void Config::ReadCpuValues() {
Settings::values.cpuopt_reduce_misalign_checks =
ReadSetting(QStringLiteral("cpuopt_reduce_misalign_checks"), true).toBool();
- Settings::values.cpuopt_unsafe_unfuse_fma =
- ReadSetting(QStringLiteral("cpuopt_unsafe_unfuse_fma"), true).toBool();
- Settings::values.cpuopt_unsafe_reduce_fp_error =
- ReadSetting(QStringLiteral("cpuopt_unsafe_reduce_fp_error"), true).toBool();
- Settings::values.cpuopt_unsafe_inaccurate_nan =
- ReadSetting(QStringLiteral("cpuopt_unsafe_inaccurate_nan"), true).toBool();
+ ReadSettingGlobal(Settings::values.cpuopt_unsafe_unfuse_fma,
+ QStringLiteral("cpuopt_unsafe_unfuse_fma"), true);
+ ReadSettingGlobal(Settings::values.cpuopt_unsafe_reduce_fp_error,
+ QStringLiteral("cpuopt_unsafe_reduce_fp_error"), true);
+ ReadSettingGlobal(Settings::values.cpuopt_unsafe_inaccurate_nan,
+ QStringLiteral("cpuopt_unsafe_inaccurate_nan"), true);
}
qt_config->endGroup();
@@ -1314,8 +1313,10 @@ void Config::SaveCpuValues() {
qt_config->beginGroup(QStringLiteral("Cpu"));
if (global) {
- WriteSetting(QStringLiteral("cpu_accuracy"),
- static_cast<int>(Settings::values.cpu_accuracy), 0);
+ WriteSettingGlobal(QStringLiteral("cpu_accuracy"),
+ static_cast<u32>(Settings::values.cpu_accuracy.GetValue(global)),
+ Settings::values.renderer_backend.UsingGlobal(),
+ static_cast<u32>(Settings::CPUAccuracy::Accurate));
WriteSetting(QStringLiteral("cpuopt_page_tables"), Settings::values.cpuopt_page_tables,
true);
@@ -1332,12 +1333,12 @@ void Config::SaveCpuValues() {
WriteSetting(QStringLiteral("cpuopt_reduce_misalign_checks"),
Settings::values.cpuopt_reduce_misalign_checks, true);
- WriteSetting(QStringLiteral("cpuopt_unsafe_unfuse_fma"),
- Settings::values.cpuopt_unsafe_unfuse_fma, true);
- WriteSetting(QStringLiteral("cpuopt_unsafe_reduce_fp_error"),
- Settings::values.cpuopt_unsafe_reduce_fp_error, true);
- WriteSetting(QStringLiteral("cpuopt_unsafe_inaccurate_nan"),
- Settings::values.cpuopt_unsafe_inaccurate_nan, true);
+ WriteSettingGlobal(QStringLiteral("cpuopt_unsafe_unfuse_fma"),
+ Settings::values.cpuopt_unsafe_unfuse_fma, true);
+ WriteSettingGlobal(QStringLiteral("cpuopt_unsafe_reduce_fp_error"),
+ Settings::values.cpuopt_unsafe_reduce_fp_error, true);
+ WriteSettingGlobal(QStringLiteral("cpuopt_unsafe_inaccurate_nan"),
+ Settings::values.cpuopt_unsafe_inaccurate_nan, true);
}
qt_config->endGroup();
diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h
index 5a2c026b3..ce3355588 100644
--- a/src/yuzu/configuration/config.h
+++ b/src/yuzu/configuration/config.h
@@ -132,5 +132,6 @@ 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::RendererBackend);
Q_DECLARE_METATYPE(Settings::GPUAccuracy);
diff --git a/src/yuzu/configuration/configure_cpu.cpp b/src/yuzu/configuration/configure_cpu.cpp
index 4f99bc80f..a59ea3087 100644
--- a/src/yuzu/configuration/configure_cpu.cpp
+++ b/src/yuzu/configuration/configure_cpu.cpp
@@ -29,15 +29,17 @@ void ConfigureCpu::SetConfiguration() {
const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn();
ui->accuracy->setEnabled(runtime_lock);
- ui->accuracy->setCurrentIndex(static_cast<int>(Settings::values.cpu_accuracy));
- UpdateGroup(static_cast<int>(Settings::values.cpu_accuracy));
+ ui->accuracy->setCurrentIndex(static_cast<int>(Settings::values.cpu_accuracy.GetValue()));
+ UpdateGroup(static_cast<int>(Settings::values.cpu_accuracy.GetValue()));
ui->cpuopt_unsafe_unfuse_fma->setEnabled(runtime_lock);
- ui->cpuopt_unsafe_unfuse_fma->setChecked(Settings::values.cpuopt_unsafe_unfuse_fma);
+ ui->cpuopt_unsafe_unfuse_fma->setChecked(Settings::values.cpuopt_unsafe_unfuse_fma.GetValue());
ui->cpuopt_unsafe_reduce_fp_error->setEnabled(runtime_lock);
- ui->cpuopt_unsafe_reduce_fp_error->setChecked(Settings::values.cpuopt_unsafe_reduce_fp_error);
+ ui->cpuopt_unsafe_reduce_fp_error->setChecked(
+ Settings::values.cpuopt_unsafe_reduce_fp_error.GetValue());
ui->cpuopt_unsafe_inaccurate_nan->setEnabled(runtime_lock);
- ui->cpuopt_unsafe_inaccurate_nan->setChecked(Settings::values.cpuopt_unsafe_inaccurate_nan);
+ ui->cpuopt_unsafe_inaccurate_nan->setChecked(
+ Settings::values.cpuopt_unsafe_inaccurate_nan.GetValue());
}
void ConfigureCpu::AccuracyUpdated(int index) {
@@ -59,11 +61,13 @@ void ConfigureCpu::UpdateGroup(int index) {
}
void ConfigureCpu::ApplyConfiguration() {
- Settings::values.cpu_accuracy =
- static_cast<Settings::CPUAccuracy>(ui->accuracy->currentIndex());
- Settings::values.cpuopt_unsafe_unfuse_fma = ui->cpuopt_unsafe_unfuse_fma->isChecked();
- Settings::values.cpuopt_unsafe_reduce_fp_error = ui->cpuopt_unsafe_reduce_fp_error->isChecked();
- Settings::values.cpuopt_unsafe_inaccurate_nan = ui->cpuopt_unsafe_inaccurate_nan->isChecked();
+ Settings::values.cpu_accuracy.SetValue(
+ static_cast<Settings::CPUAccuracy>(ui->accuracy->currentIndex()));
+ Settings::values.cpuopt_unsafe_unfuse_fma.SetValue(ui->cpuopt_unsafe_unfuse_fma->isChecked());
+ Settings::values.cpuopt_unsafe_reduce_fp_error.SetValue(
+ ui->cpuopt_unsafe_reduce_fp_error->isChecked());
+ Settings::values.cpuopt_unsafe_inaccurate_nan.SetValue(
+ ui->cpuopt_unsafe_inaccurate_nan->isChecked());
}
void ConfigureCpu::changeEvent(QEvent* event) {