diff options
Diffstat (limited to '')
| -rw-r--r-- | CMakeLists.txt | 5 | ||||
| -rw-r--r-- | src/common/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/common/settings.h | 2 | ||||
| -rw-r--r-- | src/common/wall_clock.cpp | 4 | ||||
| -rw-r--r-- | src/core/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu.cpp | 12 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu.h | 1 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_cpu.ui | 30 | ||||
| -rw-r--r-- | src/yuzu/configuration/shared_translation.cpp | 6 |
9 files changed, 59 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e5cac8fe9..325f39e1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -260,6 +260,11 @@ if (UNIX) | |||
| 260 | add_definitions(-DYUZU_UNIX=1) | 260 | add_definitions(-DYUZU_UNIX=1) |
| 261 | endif() | 261 | endif() |
| 262 | 262 | ||
| 263 | if (ARCHITECTURE_arm64 AND (ANDROID OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")) | ||
| 264 | set(HAS_NCE 1) | ||
| 265 | add_definitions(-DHAS_NCE=1) | ||
| 266 | endif() | ||
| 267 | |||
| 263 | # Configure C++ standard | 268 | # Configure C++ standard |
| 264 | # =========================== | 269 | # =========================== |
| 265 | 270 | ||
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 98fd5f1e4..d38d5c6d1 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -199,7 +199,7 @@ if(ARCHITECTURE_x86_64) | |||
| 199 | target_link_libraries(common PRIVATE xbyak::xbyak) | 199 | target_link_libraries(common PRIVATE xbyak::xbyak) |
| 200 | endif() | 200 | endif() |
| 201 | 201 | ||
| 202 | if (ARCHITECTURE_arm64 AND (ANDROID OR LINUX)) | 202 | if (HAS_NCE) |
| 203 | target_sources(common | 203 | target_sources(common |
| 204 | PRIVATE | 204 | PRIVATE |
| 205 | arm64/native_clock.cpp | 205 | arm64/native_clock.cpp |
diff --git a/src/common/settings.h b/src/common/settings.h index fea639ee3..508615011 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -182,7 +182,7 @@ struct Values { | |||
| 182 | // Cpu | 182 | // Cpu |
| 183 | SwitchableSetting<CpuBackend, true> cpu_backend{ | 183 | SwitchableSetting<CpuBackend, true> cpu_backend{ |
| 184 | linkage, CpuBackend::Dynarmic, CpuBackend::Dynarmic, | 184 | linkage, CpuBackend::Dynarmic, CpuBackend::Dynarmic, |
| 185 | #ifdef ARCHITECTURE_arm64 | 185 | #ifdef HAS_NCE |
| 186 | CpuBackend::Nce, | 186 | CpuBackend::Nce, |
| 187 | #else | 187 | #else |
| 188 | CpuBackend::Dynarmic, | 188 | CpuBackend::Dynarmic, |
diff --git a/src/common/wall_clock.cpp b/src/common/wall_clock.cpp index caca9a123..012fdc1e0 100644 --- a/src/common/wall_clock.cpp +++ b/src/common/wall_clock.cpp | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | #include "common/x64/rdtsc.h" | 10 | #include "common/x64/rdtsc.h" |
| 11 | #endif | 11 | #endif |
| 12 | 12 | ||
| 13 | #if defined(ARCHITECTURE_arm64) && defined(__linux__) | 13 | #ifdef HAS_NCE |
| 14 | #include "common/arm64/native_clock.h" | 14 | #include "common/arm64/native_clock.h" |
| 15 | #endif | 15 | #endif |
| 16 | 16 | ||
| @@ -68,7 +68,7 @@ std::unique_ptr<WallClock> CreateOptimalClock() { | |||
| 68 | // - Is not more precise than 1 GHz (1ns resolution) | 68 | // - Is not more precise than 1 GHz (1ns resolution) |
| 69 | return std::make_unique<StandardWallClock>(); | 69 | return std::make_unique<StandardWallClock>(); |
| 70 | } | 70 | } |
| 71 | #elif defined(ARCHITECTURE_arm64) && defined(__linux__) | 71 | #elif defined(HAS_NCE) |
| 72 | return std::make_unique<Arm64::NativeClock>(); | 72 | return std::make_unique<Arm64::NativeClock>(); |
| 73 | #else | 73 | #else |
| 74 | return std::make_unique<StandardWallClock>(); | 74 | return std::make_unique<StandardWallClock>(); |
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index e0bfb5b95..c3ab5ecf9 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -926,8 +926,7 @@ if (ENABLE_WEB_SERVICE) | |||
| 926 | target_link_libraries(core PRIVATE web_service) | 926 | target_link_libraries(core PRIVATE web_service) |
| 927 | endif() | 927 | endif() |
| 928 | 928 | ||
| 929 | if (ARCHITECTURE_arm64 AND (ANDROID OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")) | 929 | if (HAS_NCE) |
| 930 | target_compile_definitions(core PRIVATE -DHAS_NCE) | ||
| 931 | enable_language(C ASM) | 930 | enable_language(C ASM) |
| 932 | set(CMAKE_ASM_FLAGS "${CFLAGS} -x assembler-with-cpp") | 931 | set(CMAKE_ASM_FLAGS "${CFLAGS} -x assembler-with-cpp") |
| 933 | 932 | ||
diff --git a/src/yuzu/configuration/configure_cpu.cpp b/src/yuzu/configuration/configure_cpu.cpp index a51359903..7e16cf17d 100644 --- a/src/yuzu/configuration/configure_cpu.cpp +++ b/src/yuzu/configuration/configure_cpu.cpp | |||
| @@ -27,6 +27,13 @@ ConfigureCpu::ConfigureCpu(const Core::System& system_, | |||
| 27 | 27 | ||
| 28 | connect(accuracy_combobox, qOverload<int>(&QComboBox::currentIndexChanged), this, | 28 | connect(accuracy_combobox, qOverload<int>(&QComboBox::currentIndexChanged), this, |
| 29 | &ConfigureCpu::UpdateGroup); | 29 | &ConfigureCpu::UpdateGroup); |
| 30 | |||
| 31 | connect(backend_combobox, qOverload<int>(&QComboBox::currentIndexChanged), this, | ||
| 32 | &ConfigureCpu::UpdateGroup); | ||
| 33 | |||
| 34 | #ifdef HAS_NCE | ||
| 35 | ui->backend_group->setVisible(true); | ||
| 36 | #endif | ||
| 30 | } | 37 | } |
| 31 | 38 | ||
| 32 | ConfigureCpu::~ConfigureCpu() = default; | 39 | ConfigureCpu::~ConfigureCpu() = default; |
| @@ -34,6 +41,7 @@ ConfigureCpu::~ConfigureCpu() = default; | |||
| 34 | void ConfigureCpu::SetConfiguration() {} | 41 | void ConfigureCpu::SetConfiguration() {} |
| 35 | void ConfigureCpu::Setup(const ConfigurationShared::Builder& builder) { | 42 | void ConfigureCpu::Setup(const ConfigurationShared::Builder& builder) { |
| 36 | auto* accuracy_layout = ui->widget_accuracy->layout(); | 43 | auto* accuracy_layout = ui->widget_accuracy->layout(); |
| 44 | auto* backend_layout = ui->widget_backend->layout(); | ||
| 37 | auto* unsafe_layout = ui->unsafe_widget->layout(); | 45 | auto* unsafe_layout = ui->unsafe_widget->layout(); |
| 38 | std::map<u32, QWidget*> unsafe_hold{}; | 46 | std::map<u32, QWidget*> unsafe_hold{}; |
| 39 | 47 | ||
| @@ -62,6 +70,9 @@ void ConfigureCpu::Setup(const ConfigurationShared::Builder& builder) { | |||
| 62 | // Keep track of cpu_accuracy combobox to display/hide the unsafe settings | 70 | // Keep track of cpu_accuracy combobox to display/hide the unsafe settings |
| 63 | accuracy_layout->addWidget(widget); | 71 | accuracy_layout->addWidget(widget); |
| 64 | accuracy_combobox = widget->combobox; | 72 | accuracy_combobox = widget->combobox; |
| 73 | } else if (setting->Id() == Settings::values.cpu_backend.Id()) { | ||
| 74 | backend_layout->addWidget(widget); | ||
| 75 | backend_combobox = widget->combobox; | ||
| 65 | } else { | 76 | } else { |
| 66 | // Presently, all other settings here are unsafe checkboxes | 77 | // Presently, all other settings here are unsafe checkboxes |
| 67 | unsafe_hold.insert({setting->Id(), widget}); | 78 | unsafe_hold.insert({setting->Id(), widget}); |
| @@ -73,6 +84,7 @@ void ConfigureCpu::Setup(const ConfigurationShared::Builder& builder) { | |||
| 73 | } | 84 | } |
| 74 | 85 | ||
| 75 | UpdateGroup(accuracy_combobox->currentIndex()); | 86 | UpdateGroup(accuracy_combobox->currentIndex()); |
| 87 | UpdateGroup(backend_combobox->currentIndex()); | ||
| 76 | } | 88 | } |
| 77 | 89 | ||
| 78 | void ConfigureCpu::UpdateGroup(int index) { | 90 | void ConfigureCpu::UpdateGroup(int index) { |
diff --git a/src/yuzu/configuration/configure_cpu.h b/src/yuzu/configuration/configure_cpu.h index 61a6de7aa..a102b4c1f 100644 --- a/src/yuzu/configuration/configure_cpu.h +++ b/src/yuzu/configuration/configure_cpu.h | |||
| @@ -49,4 +49,5 @@ private: | |||
| 49 | std::vector<std::function<void(bool)>> apply_funcs{}; | 49 | std::vector<std::function<void(bool)>> apply_funcs{}; |
| 50 | 50 | ||
| 51 | QComboBox* accuracy_combobox; | 51 | QComboBox* accuracy_combobox; |
| 52 | QComboBox* backend_combobox; | ||
| 52 | }; | 53 | }; |
diff --git a/src/yuzu/configuration/configure_cpu.ui b/src/yuzu/configuration/configure_cpu.ui index f734e842e..13fd43605 100644 --- a/src/yuzu/configuration/configure_cpu.ui +++ b/src/yuzu/configuration/configure_cpu.ui | |||
| @@ -60,6 +60,36 @@ | |||
| 60 | </widget> | 60 | </widget> |
| 61 | </item> | 61 | </item> |
| 62 | <item> | 62 | <item> |
| 63 | <widget class="QGroupBox" name="backend_group"> | ||
| 64 | <property name="title"> | ||
| 65 | <string>CPU Backend</string> | ||
| 66 | </property> | ||
| 67 | <layout class="QVBoxLayout"> | ||
| 68 | <item> | ||
| 69 | <widget class="QWidget" name="widget_backend" native="true"> | ||
| 70 | <layout class="QVBoxLayout" name="verticalLayout1"> | ||
| 71 | <property name="leftMargin"> | ||
| 72 | <number>0</number> | ||
| 73 | </property> | ||
| 74 | <property name="topMargin"> | ||
| 75 | <number>0</number> | ||
| 76 | </property> | ||
| 77 | <property name="rightMargin"> | ||
| 78 | <number>0</number> | ||
| 79 | </property> | ||
| 80 | <property name="bottomMargin"> | ||
| 81 | <number>0</number> | ||
| 82 | </property> | ||
| 83 | </layout> | ||
| 84 | </widget> | ||
| 85 | </item> | ||
| 86 | </layout> | ||
| 87 | <property name="visible"> | ||
| 88 | <bool>false</bool> | ||
| 89 | </property> | ||
| 90 | </widget> | ||
| 91 | </item> | ||
| 92 | <item> | ||
| 63 | <widget class="QGroupBox" name="unsafe_group"> | 93 | <widget class="QGroupBox" name="unsafe_group"> |
| 64 | <property name="title"> | 94 | <property name="title"> |
| 65 | <string>Unsafe CPU Optimization Settings</string> | 95 | <string>Unsafe CPU Optimization Settings</string> |
diff --git a/src/yuzu/configuration/shared_translation.cpp b/src/yuzu/configuration/shared_translation.cpp index a7b5def32..daf0e1663 100644 --- a/src/yuzu/configuration/shared_translation.cpp +++ b/src/yuzu/configuration/shared_translation.cpp | |||
| @@ -44,6 +44,7 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QWidget* parent) { | |||
| 44 | 44 | ||
| 45 | // Cpu | 45 | // Cpu |
| 46 | INSERT(Settings, cpu_accuracy, tr("Accuracy:"), QStringLiteral()); | 46 | INSERT(Settings, cpu_accuracy, tr("Accuracy:"), QStringLiteral()); |
| 47 | INSERT(Settings, cpu_backend, tr("Backend:"), QStringLiteral()); | ||
| 47 | 48 | ||
| 48 | // Cpu Debug | 49 | // Cpu Debug |
| 49 | 50 | ||
| @@ -240,6 +241,11 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QWidget* parent) { | |||
| 240 | PAIR(CpuAccuracy, Unsafe, tr("Unsafe")), | 241 | PAIR(CpuAccuracy, Unsafe, tr("Unsafe")), |
| 241 | PAIR(CpuAccuracy, Paranoid, tr("Paranoid (disables most optimizations)")), | 242 | PAIR(CpuAccuracy, Paranoid, tr("Paranoid (disables most optimizations)")), |
| 242 | }}); | 243 | }}); |
| 244 | translations->insert({Settings::EnumMetadata<Settings::CpuBackend>::Index(), | ||
| 245 | { | ||
| 246 | PAIR(CpuBackend, Dynarmic, tr("Dynarmic")), | ||
| 247 | PAIR(CpuBackend, Nce, tr("NCE")), | ||
| 248 | }}); | ||
| 243 | translations->insert({Settings::EnumMetadata<Settings::FullscreenMode>::Index(), | 249 | translations->insert({Settings::EnumMetadata<Settings::FullscreenMode>::Index(), |
| 244 | { | 250 | { |
| 245 | PAIR(FullscreenMode, Borderless, tr("Borderless Windowed")), | 251 | PAIR(FullscreenMode, Borderless, tr("Borderless Windowed")), |