forked from suyu/suyu
qt: add cpu_backend configuration
This commit is contained in:
parent
15f35b8657
commit
a76a8fb5fe
9 changed files with 59 additions and 6 deletions
|
@ -260,6 +260,11 @@ if (UNIX)
|
|||
add_definitions(-DYUZU_UNIX=1)
|
||||
endif()
|
||||
|
||||
if (ARCHITECTURE_arm64 AND (ANDROID OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux"))
|
||||
set(HAS_NCE 1)
|
||||
add_definitions(-DHAS_NCE=1)
|
||||
endif()
|
||||
|
||||
# Configure C++ standard
|
||||
# ===========================
|
||||
|
||||
|
|
|
@ -199,7 +199,7 @@ if(ARCHITECTURE_x86_64)
|
|||
target_link_libraries(common PRIVATE xbyak::xbyak)
|
||||
endif()
|
||||
|
||||
if (ARCHITECTURE_arm64 AND (ANDROID OR LINUX))
|
||||
if (HAS_NCE)
|
||||
target_sources(common
|
||||
PRIVATE
|
||||
arm64/native_clock.cpp
|
||||
|
|
|
@ -182,7 +182,7 @@ struct Values {
|
|||
// Cpu
|
||||
SwitchableSetting<CpuBackend, true> cpu_backend{
|
||||
linkage, CpuBackend::Dynarmic, CpuBackend::Dynarmic,
|
||||
#ifdef ARCHITECTURE_arm64
|
||||
#ifdef HAS_NCE
|
||||
CpuBackend::Nce,
|
||||
#else
|
||||
CpuBackend::Dynarmic,
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "common/x64/rdtsc.h"
|
||||
#endif
|
||||
|
||||
#if defined(ARCHITECTURE_arm64) && defined(__linux__)
|
||||
#ifdef HAS_NCE
|
||||
#include "common/arm64/native_clock.h"
|
||||
#endif
|
||||
|
||||
|
@ -68,7 +68,7 @@ std::unique_ptr<WallClock> CreateOptimalClock() {
|
|||
// - Is not more precise than 1 GHz (1ns resolution)
|
||||
return std::make_unique<StandardWallClock>();
|
||||
}
|
||||
#elif defined(ARCHITECTURE_arm64) && defined(__linux__)
|
||||
#elif defined(HAS_NCE)
|
||||
return std::make_unique<Arm64::NativeClock>();
|
||||
#else
|
||||
return std::make_unique<StandardWallClock>();
|
||||
|
|
|
@ -926,8 +926,7 @@ if (ENABLE_WEB_SERVICE)
|
|||
target_link_libraries(core PRIVATE web_service)
|
||||
endif()
|
||||
|
||||
if (ARCHITECTURE_arm64 AND (ANDROID OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux"))
|
||||
target_compile_definitions(core PRIVATE -DHAS_NCE)
|
||||
if (HAS_NCE)
|
||||
enable_language(C ASM)
|
||||
set(CMAKE_ASM_FLAGS "${CFLAGS} -x assembler-with-cpp")
|
||||
|
||||
|
|
|
@ -27,6 +27,13 @@ ConfigureCpu::ConfigureCpu(const Core::System& system_,
|
|||
|
||||
connect(accuracy_combobox, qOverload<int>(&QComboBox::currentIndexChanged), this,
|
||||
&ConfigureCpu::UpdateGroup);
|
||||
|
||||
connect(backend_combobox, qOverload<int>(&QComboBox::currentIndexChanged), this,
|
||||
&ConfigureCpu::UpdateGroup);
|
||||
|
||||
#ifdef HAS_NCE
|
||||
ui->backend_group->setVisible(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
ConfigureCpu::~ConfigureCpu() = default;
|
||||
|
@ -34,6 +41,7 @@ ConfigureCpu::~ConfigureCpu() = default;
|
|||
void ConfigureCpu::SetConfiguration() {}
|
||||
void ConfigureCpu::Setup(const ConfigurationShared::Builder& builder) {
|
||||
auto* accuracy_layout = ui->widget_accuracy->layout();
|
||||
auto* backend_layout = ui->widget_backend->layout();
|
||||
auto* unsafe_layout = ui->unsafe_widget->layout();
|
||||
std::map<u32, QWidget*> unsafe_hold{};
|
||||
|
||||
|
@ -62,6 +70,9 @@ void ConfigureCpu::Setup(const ConfigurationShared::Builder& builder) {
|
|||
// Keep track of cpu_accuracy combobox to display/hide the unsafe settings
|
||||
accuracy_layout->addWidget(widget);
|
||||
accuracy_combobox = widget->combobox;
|
||||
} else if (setting->Id() == Settings::values.cpu_backend.Id()) {
|
||||
backend_layout->addWidget(widget);
|
||||
backend_combobox = widget->combobox;
|
||||
} else {
|
||||
// Presently, all other settings here are unsafe checkboxes
|
||||
unsafe_hold.insert({setting->Id(), widget});
|
||||
|
@ -73,6 +84,7 @@ void ConfigureCpu::Setup(const ConfigurationShared::Builder& builder) {
|
|||
}
|
||||
|
||||
UpdateGroup(accuracy_combobox->currentIndex());
|
||||
UpdateGroup(backend_combobox->currentIndex());
|
||||
}
|
||||
|
||||
void ConfigureCpu::UpdateGroup(int index) {
|
||||
|
|
|
@ -49,4 +49,5 @@ private:
|
|||
std::vector<std::function<void(bool)>> apply_funcs{};
|
||||
|
||||
QComboBox* accuracy_combobox;
|
||||
QComboBox* backend_combobox;
|
||||
};
|
||||
|
|
|
@ -59,6 +59,36 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="backend_group">
|
||||
<property name="title">
|
||||
<string>CPU Backend</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_backend" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout1">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="unsafe_group">
|
||||
<property name="title">
|
||||
|
|
|
@ -44,6 +44,7 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QWidget* parent) {
|
|||
|
||||
// Cpu
|
||||
INSERT(Settings, cpu_accuracy, tr("Accuracy:"), QStringLiteral());
|
||||
INSERT(Settings, cpu_backend, tr("Backend:"), QStringLiteral());
|
||||
|
||||
// Cpu Debug
|
||||
|
||||
|
@ -240,6 +241,11 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QWidget* parent) {
|
|||
PAIR(CpuAccuracy, Unsafe, tr("Unsafe")),
|
||||
PAIR(CpuAccuracy, Paranoid, tr("Paranoid (disables most optimizations)")),
|
||||
}});
|
||||
translations->insert({Settings::EnumMetadata<Settings::CpuBackend>::Index(),
|
||||
{
|
||||
PAIR(CpuBackend, Dynarmic, tr("Dynarmic")),
|
||||
PAIR(CpuBackend, Nce, tr("NCE")),
|
||||
}});
|
||||
translations->insert({Settings::EnumMetadata<Settings::FullscreenMode>::Index(),
|
||||
{
|
||||
PAIR(FullscreenMode, Borderless, tr("Borderless Windowed")),
|
||||
|
|
Loading…
Reference in a new issue