summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar lat9nq2023-05-07 12:03:40 -0400
committerGravatar lat9nq2023-07-21 10:56:07 -0400
commitf8435d676f0073dee4d2ea87c84767a53911fbe6 (patch)
tree1ee636d7b2263f88b914a93dc4cf4ddb5c4d833a /src
parentsettings: Recategorize a bit (diff)
downloadyuzu-f8435d676f0073dee4d2ea87c84767a53911fbe6.tar.gz
yuzu-f8435d676f0073dee4d2ea87c84767a53911fbe6.tar.xz
yuzu-f8435d676f0073dee4d2ea87c84767a53911fbe6.zip
configure_graphics: Partial runtime implementation
Diffstat (limited to 'src')
-rw-r--r--src/common/settings.h2
-rw-r--r--src/yuzu/configuration/configuration_shared.cpp72
-rw-r--r--src/yuzu/configuration/configuration_shared.h18
-rw-r--r--src/yuzu/configuration/configure_dialog.cpp2
-rw-r--r--src/yuzu/configuration/configure_graphics.cpp785
-rw-r--r--src/yuzu/configuration/configure_graphics.h16
-rw-r--r--src/yuzu/configuration/configure_graphics.ui751
-rw-r--r--src/yuzu/configuration/configure_graphics_advanced.cpp4
-rw-r--r--src/yuzu/configuration/configure_per_game.cpp2
-rw-r--r--src/yuzu/configuration/shared_translation.cpp9
10 files changed, 513 insertions, 1148 deletions
diff --git a/src/common/settings.h b/src/common/settings.h
index 70ab8d584..8f02fa9af 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -733,7 +733,7 @@ struct Values {
733 linkage, ShaderBackend::GLSL, ShaderBackend::GLSL, ShaderBackend::SPIRV, 733 linkage, ShaderBackend::GLSL, ShaderBackend::GLSL, ShaderBackend::SPIRV,
734 "shader_backend", Category::Renderer}; 734 "shader_backend", Category::Renderer};
735 SwitchableSetting<bool> use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders", 735 SwitchableSetting<bool> use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders",
736 Category::Renderer}; 736 Category::RendererAdvanced};
737 SwitchableSetting<bool, false, true, true> use_fast_gpu_time{linkage, true, "use_fast_gpu_time", 737 SwitchableSetting<bool, false, true, true> use_fast_gpu_time{linkage, true, "use_fast_gpu_time",
738 Category::RendererAdvanced}; 738 Category::RendererAdvanced};
739 SwitchableSetting<bool, false, true, true> use_vulkan_driver_pipeline_cache{ 739 SwitchableSetting<bool, false, true, true> use_vulkan_driver_pipeline_cache{
diff --git a/src/yuzu/configuration/configuration_shared.cpp b/src/yuzu/configuration/configuration_shared.cpp
index dc11a318a..575d239eb 100644
--- a/src/yuzu/configuration/configuration_shared.cpp
+++ b/src/yuzu/configuration/configuration_shared.cpp
@@ -5,6 +5,7 @@
5#include <QCheckBox> 5#include <QCheckBox>
6#include <QHBoxLayout> 6#include <QHBoxLayout>
7#include <QLabel> 7#include <QLabel>
8#include <QLineEdit>
8#include <QObject> 9#include <QObject>
9#include <QString> 10#include <QString>
10#include <QWidget> 11#include <QWidget>
@@ -55,9 +56,8 @@ static std::pair<QWidget*, std::function<void()>> CreateCheckBox(Settings::Basic
55 return {checkbox, load_func}; 56 return {checkbox, load_func};
56} 57}
57 58
58static std::pair<QWidget*, std::function<void()>> CreateCombobox(Settings::BasicSetting* setting, 59static std::tuple<QWidget*, void*, std::function<void()>> CreateCombobox(
59 const QString& label, 60 Settings::BasicSetting* setting, const QString& label, QWidget* parent) {
60 QWidget* parent) {
61 const auto type = setting->TypeId(); 61 const auto type = setting->TypeId();
62 62
63 QWidget* group = new QWidget(parent); 63 QWidget* group = new QWidget(parent);
@@ -110,15 +110,34 @@ static std::pair<QWidget*, std::function<void()>> CreateCombobox(Settings::Basic
110 } 110 }
111 }; 111 };
112 112
113 return {group, load_func}; 113 return {group, combobox, load_func};
114}
115
116static std::tuple<QWidget*, void*, std::function<void()>> CreateLineEdit(
117 Settings::BasicSetting* setting, const QString& label, QWidget* parent) {
118 QWidget* widget = new QWidget(parent);
119 QHBoxLayout* layout = new QHBoxLayout(widget);
120
121 QLabel* q_label = new QLabel(label, widget);
122 QLineEdit* line_edit = new QLineEdit(widget);
123
124 layout->addWidget(q_label);
125 layout->addStretch();
126 layout->addWidget(line_edit);
127
128 layout->setContentsMargins(0, 0, 0, 0);
129
130 return {widget, line_edit, []() {}};
114} 131}
115 132
116QWidget* CreateWidget(Settings::BasicSetting* setting, const TranslationMap& translations, 133std::pair<QWidget*, void*> CreateWidget(Settings::BasicSetting* setting,
117 QWidget* parent, bool runtime_lock, 134 const TranslationMap& translations, QWidget* parent,
118 std::forward_list<std::function<void(bool)>>& apply_funcs, 135 bool runtime_lock,
119 std::list<CheckState>& trackers) { 136 std::forward_list<std::function<void(bool)>>& apply_funcs,
137 std::list<CheckState>& trackers, RequestType request) {
120 const auto type = setting->TypeId(); 138 const auto type = setting->TypeId();
121 QWidget* widget{nullptr}; 139 QWidget* widget{nullptr};
140 void* extra{nullptr};
122 141
123 std::function<void()> load_func; 142 std::function<void()> load_func;
124 143
@@ -135,7 +154,7 @@ QWidget* CreateWidget(Settings::BasicSetting* setting, const TranslationMap& tra
135 if (label == QStringLiteral("")) { 154 if (label == QStringLiteral("")) {
136 LOG_DEBUG(Frontend, "Translation table has emtpy entry for \"{}\", skipping...", 155 LOG_DEBUG(Frontend, "Translation table has emtpy entry for \"{}\", skipping...",
137 setting->GetLabel()); 156 setting->GetLabel());
138 return widget; 157 return {nullptr, nullptr};
139 } 158 }
140 159
141 if (type == typeid(bool)) { 160 if (type == typeid(bool)) {
@@ -143,14 +162,36 @@ QWidget* CreateWidget(Settings::BasicSetting* setting, const TranslationMap& tra
143 widget = pair.first; 162 widget = pair.first;
144 load_func = pair.second; 163 load_func = pair.second;
145 } else if (setting->IsEnum()) { 164 } else if (setting->IsEnum()) {
146 auto pair = CreateCombobox(setting, label, parent); 165 auto tuple = CreateCombobox(setting, label, parent);
147 widget = pair.first; 166 widget = std::get<0>(tuple);
148 load_func = pair.second; 167 extra = std::get<1>(tuple);
168 load_func = std::get<2>(tuple);
169 } else if (type == typeid(u32) || type == typeid(int)) {
170 switch (request) {
171 case RequestType::Default: {
172 auto tuple = CreateLineEdit(setting, label, parent);
173 widget = std::get<0>(tuple);
174 extra = std::get<1>(tuple);
175 load_func = std::get<2>(tuple);
176 break;
177 }
178 case RequestType::ComboBox: {
179 auto tuple = CreateCombobox(setting, label, parent);
180 widget = std::get<0>(tuple);
181 extra = std::get<1>(tuple);
182 load_func = std::get<2>(tuple);
183 break;
184 }
185 case RequestType::SpinBox:
186 case RequestType::Slider:
187 case RequestType::MaxEnum:
188 break;
189 }
149 } 190 }
150 191
151 if (widget == nullptr) { 192 if (widget == nullptr) {
152 LOG_ERROR(Frontend, "No widget was created for \"{}\"", setting->GetLabel()); 193 LOG_ERROR(Frontend, "No widget was created for \"{}\"", setting->GetLabel());
153 return widget; 194 return {nullptr, nullptr};
154 } 195 }
155 196
156 apply_funcs.push_front([load_func, setting](bool powered_on) { 197 apply_funcs.push_front([load_func, setting](bool powered_on) {
@@ -162,13 +203,14 @@ QWidget* CreateWidget(Settings::BasicSetting* setting, const TranslationMap& tra
162 bool enable = runtime_lock || setting->RuntimeModfiable(); 203 bool enable = runtime_lock || setting->RuntimeModfiable();
163 enable &= 204 enable &=
164 setting->Switchable() && !(Settings::IsConfiguringGlobal() && !setting->UsingGlobal()); 205 setting->Switchable() && !(Settings::IsConfiguringGlobal() && !setting->UsingGlobal());
165 206 enable |= !setting->Switchable() && Settings::IsConfiguringGlobal() && runtime_lock;
166 widget->setEnabled(enable); 207 widget->setEnabled(enable);
208
167 widget->setVisible(Settings::IsConfiguringGlobal() || setting->Switchable()); 209 widget->setVisible(Settings::IsConfiguringGlobal() || setting->Switchable());
168 210
169 widget->setToolTip(tooltip); 211 widget->setToolTip(tooltip);
170 212
171 return widget; 213 return {widget, extra};
172} 214}
173 215
174Tab::Tab(std::shared_ptr<std::forward_list<Tab*>> group_, QWidget* parent) 216Tab::Tab(std::shared_ptr<std::forward_list<Tab*>> group_, QWidget* parent)
diff --git a/src/yuzu/configuration/configuration_shared.h b/src/yuzu/configuration/configuration_shared.h
index 7040673ea..d0fe6ea38 100644
--- a/src/yuzu/configuration/configuration_shared.h
+++ b/src/yuzu/configuration/configuration_shared.h
@@ -41,10 +41,20 @@ enum class CheckState {
41 Count, // Simply the number of states, not a valid checkbox state 41 Count, // Simply the number of states, not a valid checkbox state
42}; 42};
43 43
44QWidget* CreateWidget(Settings::BasicSetting* setting, const TranslationMap& translations, 44enum class RequestType {
45 QWidget* parent, bool runtime_lock, 45 Default,
46 std::forward_list<std::function<void(bool)>>& apply_funcs, 46 ComboBox,
47 std::list<CheckState>& trackers); 47 SpinBox,
48 Slider,
49 MaxEnum,
50};
51
52std::pair<QWidget*, void*> CreateWidget(Settings::BasicSetting* setting,
53 const TranslationMap& translations, QWidget* parent,
54 bool runtime_lock,
55 std::forward_list<std::function<void(bool)>>& apply_funcs,
56 std::list<CheckState>& trackers,
57 RequestType request = RequestType::Default);
48 58
49// Global-aware apply and set functions 59// Global-aware apply and set functions
50 60
diff --git a/src/yuzu/configuration/configure_dialog.cpp b/src/yuzu/configuration/configure_dialog.cpp
index b3f4764c7..5b356a074 100644
--- a/src/yuzu/configuration/configure_dialog.cpp
+++ b/src/yuzu/configuration/configure_dialog.cpp
@@ -43,7 +43,7 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_,
43 std::make_unique<ConfigureGraphicsAdvanced>(system_, nullptr, *translations, this)}, 43 std::make_unique<ConfigureGraphicsAdvanced>(system_, nullptr, *translations, this)},
44 graphics_tab{std::make_unique<ConfigureGraphics>( 44 graphics_tab{std::make_unique<ConfigureGraphics>(
45 system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, 45 system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); },
46 nullptr, this)}, 46 nullptr, *translations, this)},
47 hotkeys_tab{std::make_unique<ConfigureHotkeys>(system_.HIDCore(), this)}, 47 hotkeys_tab{std::make_unique<ConfigureHotkeys>(system_.HIDCore(), this)},
48 input_tab{std::make_unique<ConfigureInput>(system_, this)}, 48 input_tab{std::make_unique<ConfigureInput>(system_, this)},
49 network_tab{std::make_unique<ConfigureNetwork>(system_, this)}, 49 network_tab{std::make_unique<ConfigureNetwork>(system_, this)},
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp
index a8c5b1d9f..8128a4047 100644
--- a/src/yuzu/configuration/configure_graphics.cpp
+++ b/src/yuzu/configuration/configure_graphics.cpp
@@ -55,100 +55,123 @@ static constexpr VkPresentModeKHR VSyncSettingToMode(Settings::VSyncMode mode) {
55 } 55 }
56} 56}
57 57
58static constexpr Settings::VSyncMode PresentModeToSetting(VkPresentModeKHR mode) { 58// static constexpr Settings::VSyncMode PresentModeToSetting(VkPresentModeKHR mode) {
59 switch (mode) { 59// switch (mode) {
60 case VK_PRESENT_MODE_IMMEDIATE_KHR: 60// case VK_PRESENT_MODE_IMMEDIATE_KHR:
61 return Settings::VSyncMode::Immediate; 61// return Settings::VSyncMode::Immediate;
62 case VK_PRESENT_MODE_MAILBOX_KHR: 62// case VK_PRESENT_MODE_MAILBOX_KHR:
63 return Settings::VSyncMode::Mailbox; 63// return Settings::VSyncMode::Mailbox;
64 case VK_PRESENT_MODE_FIFO_KHR: 64// case VK_PRESENT_MODE_FIFO_KHR:
65 return Settings::VSyncMode::FIFO; 65// return Settings::VSyncMode::FIFO;
66 case VK_PRESENT_MODE_FIFO_RELAXED_KHR: 66// case VK_PRESENT_MODE_FIFO_RELAXED_KHR:
67 return Settings::VSyncMode::FIFORelaxed; 67// return Settings::VSyncMode::FIFORelaxed;
68 default: 68// default:
69 return Settings::VSyncMode::FIFO; 69// return Settings::VSyncMode::FIFO;
70 } 70// }
71} 71// }
72 72
73ConfigureGraphics::ConfigureGraphics( 73ConfigureGraphics::ConfigureGraphics(
74 const Core::System& system_, std::vector<VkDeviceInfo::Record>& records_, 74 const Core::System& system_, std::vector<VkDeviceInfo::Record>& records_,
75 const std::function<void()>& expose_compute_option_, 75 const std::function<void()>& expose_compute_option_,
76 std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, QWidget* parent) 76 std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group,
77 const ConfigurationShared::TranslationMap& translations_, QWidget* parent)
77 : ConfigurationShared::Tab(group, parent), ui{std::make_unique<Ui::ConfigureGraphics>()}, 78 : ConfigurationShared::Tab(group, parent), ui{std::make_unique<Ui::ConfigureGraphics>()},
78 records{records_}, expose_compute_option{expose_compute_option_}, system{system_} { 79 records{records_}, expose_compute_option{expose_compute_option_}, system{system_},
80 translations{translations_} {
79 vulkan_device = Settings::values.vulkan_device.GetValue(); 81 vulkan_device = Settings::values.vulkan_device.GetValue();
80 RetrieveVulkanDevices(); 82 RetrieveVulkanDevices();
81 83
82 ui->setupUi(this); 84 ui->setupUi(this);
83 85
86 SetConfiguration();
87
84 for (const auto& device : vulkan_devices) { 88 for (const auto& device : vulkan_devices) {
85 ui->device->addItem(device); 89 vulkan_device_combobox->addItem(device);
86 } 90 }
87 91
88 ui->backend->addItem(QStringLiteral("GLSL")); 92 UpdateBackgroundColorButton(QColor::fromRgb(Settings::values.bg_red.GetValue(),
89 ui->backend->addItem(tr("GLASM (Assembly Shaders, NVIDIA Only)")); 93 Settings::values.bg_green.GetValue(),
90 ui->backend->addItem(tr("SPIR-V (Experimental, Mesa Only)")); 94 Settings::values.bg_blue.GetValue()));
95 UpdateAPILayout();
96 PopulateVSyncModeSelection(); //< must happen after UpdateAPILayout
97 // SetFSRIndicatorText(ui->fsr_sharpening_slider->sliderPosition());
91 98
92 SetupPerGameUI(); 99 // VSync setting needs to be determined after populating the VSync combobox
100 if (Settings::IsConfiguringGlobal()) {
101 const auto vsync_mode_setting = Settings::values.vsync_mode.GetValue();
102 const auto vsync_mode = VSyncSettingToMode(vsync_mode_setting);
103 int index{};
104 for (const auto mode : vsync_mode_combobox_enum_map) {
105 if (mode == vsync_mode) {
106 break;
107 }
108 index++;
109 }
110 if (static_cast<unsigned long>(index) < vsync_mode_combobox_enum_map.size()) {
111 vsync_mode_combobox->setCurrentIndex(index);
112 }
113 }
93 114
94 SetConfiguration(); 115 SetupPerGameUI();
95 116
96 connect(ui->api, qOverload<int>(&QComboBox::currentIndexChanged), this, [this] { 117 connect(api_combobox, qOverload<int>(&QComboBox::currentIndexChanged), this, [this] {
97 UpdateAPILayout(); 118 UpdateAPILayout();
98 PopulateVSyncModeSelection(); 119 PopulateVSyncModeSelection();
99 if (!Settings::IsConfiguringGlobal()) { 120 if (!Settings::IsConfiguringGlobal()) {
100 ConfigurationShared::SetHighlight( 121 ConfigurationShared::SetHighlight(ui->api_widget,
101 ui->api_widget, ui->api->currentIndex() != ConfigurationShared::USE_GLOBAL_INDEX); 122 api_combobox->currentIndex() !=
123 ConfigurationShared::USE_GLOBAL_INDEX);
102 } 124 }
103 }); 125 });
104 connect(ui->device, qOverload<int>(&QComboBox::activated), this, [this](int device) { 126 connect(vulkan_device_combobox, qOverload<int>(&QComboBox::activated), this,
105 UpdateDeviceSelection(device); 127 [this](int device) {
106 PopulateVSyncModeSelection(); 128 UpdateDeviceSelection(device);
107 }); 129 PopulateVSyncModeSelection();
108 connect(ui->backend, qOverload<int>(&QComboBox::activated), this, 130 });
131 connect(shader_backend_combobox, qOverload<int>(&QComboBox::activated), this,
109 [this](int backend) { UpdateShaderBackendSelection(backend); }); 132 [this](int backend) { UpdateShaderBackendSelection(backend); });
110 133
111 connect(ui->bg_button, &QPushButton::clicked, this, [this] { 134 // connect(ui->bg_button, &QPushButton::clicked, this, [this] {
112 const QColor new_bg_color = QColorDialog::getColor(bg_color); 135 // const QColor new_bg_color = QColorDialog::getColor(bg_color);
113 if (!new_bg_color.isValid()) { 136 // if (!new_bg_color.isValid()) {
114 return; 137 // return;
115 } 138 // }
116 UpdateBackgroundColorButton(new_bg_color); 139 // UpdateBackgroundColorButton(new_bg_color);
117 }); 140 // });
118 141
119 ui->api->setEnabled(!UISettings::values.has_broken_vulkan && ui->api->isEnabled()); 142 api_combobox->setEnabled(!UISettings::values.has_broken_vulkan && api_combobox->isEnabled());
120 ui->api_widget->setEnabled( 143 ui->api_widget->setEnabled(
121 (!UISettings::values.has_broken_vulkan || Settings::IsConfiguringGlobal()) && 144 (!UISettings::values.has_broken_vulkan || Settings::IsConfiguringGlobal()) &&
122 ui->api_widget->isEnabled()); 145 ui->api_widget->isEnabled());
123 ui->bg_label->setVisible(Settings::IsConfiguringGlobal()); 146 // ui->bg_label->setVisible(Settings::IsConfiguringGlobal());
124 ui->bg_combobox->setVisible(!Settings::IsConfiguringGlobal()); 147 // ui->bg_combobox->setVisible(!Settings::IsConfiguringGlobal());
125 148
126 connect(ui->fsr_sharpening_slider, &QSlider::valueChanged, this, 149 // connect(ui->fsr_sharpening_slider, &QSlider::valueChanged, this,
127 &ConfigureGraphics::SetFSRIndicatorText); 150 // &ConfigureGraphics::SetFSRIndicatorText);
128 ui->fsr_sharpening_combobox->setVisible(!Settings::IsConfiguringGlobal()); 151 // ui->fsr_sharpening_combobox->setVisible(!Settings::IsConfiguringGlobal());
129 ui->fsr_sharpening_label->setVisible(Settings::IsConfiguringGlobal()); 152 // ui->fsr_sharpening_label->setVisible(Settings::IsConfiguringGlobal());
130} 153}
131 154
132void ConfigureGraphics::PopulateVSyncModeSelection() { 155void ConfigureGraphics::PopulateVSyncModeSelection() {
133 const Settings::RendererBackend backend{GetCurrentGraphicsBackend()}; 156 const Settings::RendererBackend backend{GetCurrentGraphicsBackend()};
134 if (backend == Settings::RendererBackend::Null) { 157 if (backend == Settings::RendererBackend::Null) {
135 ui->vsync_mode_combobox->setEnabled(false); 158 vsync_mode_combobox->setEnabled(false);
136 return; 159 return;
137 } 160 }
138 ui->vsync_mode_combobox->setEnabled(true); 161 vsync_mode_combobox->setEnabled(true);
139 162
140 const int current_index = //< current selected vsync mode from combobox 163 const int current_index = //< current selected vsync mode from combobox
141 ui->vsync_mode_combobox->currentIndex(); 164 vsync_mode_combobox->currentIndex();
142 const auto current_mode = //< current selected vsync mode as a VkPresentModeKHR 165 const auto current_mode = //< current selected vsync mode as a VkPresentModeKHR
143 current_index == -1 ? VSyncSettingToMode(Settings::values.vsync_mode.GetValue()) 166 current_index == -1 ? VSyncSettingToMode(Settings::values.vsync_mode.GetValue())
144 : vsync_mode_combobox_enum_map[current_index]; 167 : vsync_mode_combobox_enum_map[current_index];
145 int index{}; 168 int index{};
146 const int device{ui->device->currentIndex()}; //< current selected Vulkan device 169 const int device{vulkan_device_combobox->currentIndex()}; //< current selected Vulkan device
147 const auto& present_modes = //< relevant vector of present modes for the selected device or API 170 const auto& present_modes = //< relevant vector of present modes for the selected device or API
148 backend == Settings::RendererBackend::Vulkan ? device_present_modes[device] 171 backend == Settings::RendererBackend::Vulkan ? device_present_modes[device]
149 : default_present_modes; 172 : default_present_modes;
150 173
151 ui->vsync_mode_combobox->clear(); 174 vsync_mode_combobox->clear();
152 vsync_mode_combobox_enum_map.clear(); 175 vsync_mode_combobox_enum_map.clear();
153 vsync_mode_combobox_enum_map.reserve(present_modes.size()); 176 vsync_mode_combobox_enum_map.reserve(present_modes.size());
154 for (const auto present_mode : present_modes) { 177 for (const auto present_mode : present_modes) {
@@ -157,10 +180,10 @@ void ConfigureGraphics::PopulateVSyncModeSelection() {
157 continue; 180 continue;
158 } 181 }
159 182
160 ui->vsync_mode_combobox->insertItem(index, mode_name); 183 vsync_mode_combobox->insertItem(index, mode_name);
161 vsync_mode_combobox_enum_map.push_back(present_mode); 184 vsync_mode_combobox_enum_map.push_back(present_mode);
162 if (present_mode == current_mode) { 185 if (present_mode == current_mode) {
163 ui->vsync_mode_combobox->setCurrentIndex(index); 186 vsync_mode_combobox->setCurrentIndex(index);
164 } 187 }
165 index++; 188 index++;
166 } 189 }
@@ -188,114 +211,137 @@ ConfigureGraphics::~ConfigureGraphics() = default;
188 211
189void ConfigureGraphics::SetConfiguration() { 212void ConfigureGraphics::SetConfiguration() {
190 const bool runtime_lock = !system.IsPoweredOn(); 213 const bool runtime_lock = !system.IsPoweredOn();
214 QLayout& api_layout = *ui->api_widget->layout();
215 QLayout& graphics_layout = *ui->graphics_widget->layout();
191 216
192 ui->api_widget->setEnabled(runtime_lock); 217 std::map<std::string, QWidget*> hold_graphics;
193 ui->use_asynchronous_gpu_emulation->setEnabled(runtime_lock);
194 ui->use_disk_shader_cache->setEnabled(runtime_lock);
195 ui->nvdec_emulation_widget->setEnabled(runtime_lock);
196 ui->resolution_combobox->setEnabled(runtime_lock);
197 ui->astc_decode_mode_combobox->setEnabled(runtime_lock);
198 ui->vsync_mode_layout->setEnabled(runtime_lock ||
199 Settings::values.renderer_backend.GetValue() ==
200 Settings::RendererBackend::Vulkan);
201 ui->use_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache.GetValue());
202 ui->use_asynchronous_gpu_emulation->setChecked(
203 Settings::values.use_asynchronous_gpu_emulation.GetValue());
204 218
205 if (Settings::IsConfiguringGlobal()) { 219 for (const auto setting : Settings::values.linkage.by_category[Settings::Category::Renderer]) {
206 ui->api->setCurrentIndex(static_cast<int>(Settings::values.renderer_backend.GetValue())); 220 const auto& setting_label = setting->GetLabel();
207 ui->fullscreen_mode_combobox->setCurrentIndex(
208 static_cast<int>(Settings::values.fullscreen_mode.GetValue()));
209 ui->nvdec_emulation->setCurrentIndex(
210 static_cast<int>(Settings::values.nvdec_emulation.GetValue()));
211 ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio.GetValue());
212 ui->resolution_combobox->setCurrentIndex(
213 static_cast<int>(Settings::values.resolution_setup.GetValue()));
214 ui->scaling_filter_combobox->setCurrentIndex(
215 static_cast<int>(Settings::values.scaling_filter.GetValue()));
216 ui->fsr_sharpening_slider->setValue(Settings::values.fsr_sharpening_slider.GetValue());
217 ui->anti_aliasing_combobox->setCurrentIndex(
218 static_cast<int>(Settings::values.anti_aliasing.GetValue()));
219 } else {
220 ConfigurationShared::SetPerGameSetting(ui->api, &Settings::values.renderer_backend);
221 ConfigurationShared::SetHighlight(ui->api_widget,
222 !Settings::values.renderer_backend.UsingGlobal());
223
224 ConfigurationShared::SetPerGameSetting(ui->astc_decode_mode_combobox,
225 &Settings::values.accelerate_astc);
226 ConfigurationShared::SetHighlight(ui->astc_decode_mode_layout,
227 !Settings::values.accelerate_astc.UsingGlobal());
228
229 ConfigurationShared::SetPerGameSetting(ui->nvdec_emulation,
230 &Settings::values.nvdec_emulation);
231 ConfigurationShared::SetHighlight(ui->nvdec_emulation_widget,
232 !Settings::values.nvdec_emulation.UsingGlobal());
233
234 ConfigurationShared::SetPerGameSetting(ui->fullscreen_mode_combobox,
235 &Settings::values.fullscreen_mode);
236 ConfigurationShared::SetHighlight(ui->fullscreen_mode_label,
237 !Settings::values.fullscreen_mode.UsingGlobal());
238
239 ConfigurationShared::SetPerGameSetting(ui->aspect_ratio_combobox,
240 &Settings::values.aspect_ratio);
241 ConfigurationShared::SetHighlight(ui->ar_label,
242 !Settings::values.aspect_ratio.UsingGlobal());
243
244 ConfigurationShared::SetPerGameSetting(ui->resolution_combobox,
245 &Settings::values.resolution_setup);
246 ConfigurationShared::SetHighlight(ui->resolution_label,
247 !Settings::values.resolution_setup.UsingGlobal());
248
249 ConfigurationShared::SetPerGameSetting(ui->scaling_filter_combobox,
250 &Settings::values.scaling_filter);
251 ConfigurationShared::SetHighlight(ui->scaling_filter_label,
252 !Settings::values.scaling_filter.UsingGlobal());
253
254 ConfigurationShared::SetPerGameSetting(ui->anti_aliasing_combobox,
255 &Settings::values.anti_aliasing);
256 ConfigurationShared::SetHighlight(ui->anti_aliasing_label,
257 !Settings::values.anti_aliasing.UsingGlobal());
258
259 ui->fsr_sharpening_combobox->setCurrentIndex(
260 Settings::values.fsr_sharpening_slider.UsingGlobal() ? 0 : 1);
261 ui->fsr_sharpening_slider->setEnabled(
262 !Settings::values.fsr_sharpening_slider.UsingGlobal());
263 ui->fsr_sharpening_value->setEnabled(!Settings::values.fsr_sharpening_slider.UsingGlobal());
264 ConfigurationShared::SetHighlight(ui->fsr_sharpening_layout,
265 !Settings::values.fsr_sharpening_slider.UsingGlobal());
266 ui->fsr_sharpening_slider->setValue(Settings::values.fsr_sharpening_slider.GetValue());
267
268 ui->bg_combobox->setCurrentIndex(Settings::values.bg_red.UsingGlobal() ? 0 : 1);
269 ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal());
270 ConfigurationShared::SetHighlight(ui->bg_layout, !Settings::values.bg_red.UsingGlobal());
271 }
272 UpdateBackgroundColorButton(QColor::fromRgb(Settings::values.bg_red.GetValue(),
273 Settings::values.bg_green.GetValue(),
274 Settings::values.bg_blue.GetValue()));
275 UpdateAPILayout();
276 PopulateVSyncModeSelection(); //< must happen after UpdateAPILayout
277 SetFSRIndicatorText(ui->fsr_sharpening_slider->sliderPosition());
278 221
279 // VSync setting needs to be determined after populating the VSync combobox 222 auto [widget, extra] = [&]() {
280 if (Settings::IsConfiguringGlobal()) { 223 if (setting_label == "vulkan_device") {
281 const auto vsync_mode_setting = Settings::values.vsync_mode.GetValue(); 224 return ConfigurationShared::CreateWidget(
282 const auto vsync_mode = VSyncSettingToMode(vsync_mode_setting); 225 setting, translations, this, runtime_lock, apply_funcs, trackers,
283 int index{}; 226 ConfigurationShared::RequestType::ComboBox);
284 for (const auto mode : vsync_mode_combobox_enum_map) {
285 if (mode == vsync_mode) {
286 break;
287 } 227 }
288 index++; 228 return ConfigurationShared::CreateWidget(setting, translations, this, runtime_lock,
229 apply_funcs, trackers);
230 }();
231
232 if (widget == nullptr) {
233 continue;
289 } 234 }
290 if (static_cast<unsigned long>(index) < vsync_mode_combobox_enum_map.size()) { 235
291 ui->vsync_mode_combobox->setCurrentIndex(index); 236 if (setting_label == "backend") {
237 api_layout.addWidget(widget);
238 api_combobox = reinterpret_cast<QComboBox*>(extra);
239 } else if (setting_label == "vulkan_device") {
240 api_layout.addWidget(widget);
241 vulkan_device_combobox = reinterpret_cast<QComboBox*>(extra);
242 vulkan_device_widget = widget;
243 } else if (setting_label == "shader_backend") {
244 api_layout.addWidget(widget);
245 shader_backend_combobox = reinterpret_cast<QComboBox*>(extra);
246 shader_backend_widget = widget;
247 } else {
248 hold_graphics.insert(std::pair(setting_label, widget));
292 } 249 }
250
251 if (setting_label == "use_vsync") {
252 vsync_mode_combobox = reinterpret_cast<QComboBox*>(extra);
253 }
254 }
255
256 for (const auto& [label, widget] : hold_graphics) {
257 graphics_layout.addWidget(widget);
293 } 258 }
259
260 // ui->api_widget->setEnabled(runtime_lock);
261 // ui->use_asynchronous_gpu_emulation->setEnabled(runtime_lock);
262 // ui->use_disk_shader_cache->setEnabled(runtime_lock);
263 // ui->nvdec_emulation_widget->setEnabled(runtime_lock);
264 // ui->resolution_combobox->setEnabled(runtime_lock);
265 // ui->astc_decode_mode_combobox->setEnabled(runtime_lock);
266 // ui->vsync_mode_layout->setEnabled(runtime_lock ||
267 // Settings::values.renderer_backend.GetValue() ==
268 // Settings::RendererBackend::Vulkan);
269 // ui->use_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache.GetValue());
270 // ui->use_asynchronous_gpu_emulation->setChecked(
271 // Settings::values.use_asynchronous_gpu_emulation.GetValue());
272
273 // if (Settings::IsConfiguringGlobal()) {
274 // api_combobox->setCurrentIndex(static_cast<int>(Settings::values.renderer_backend.GetValue()));
275 // ui->fullscreen_mode_combobox->setCurrentIndex(
276 // static_cast<int>(Settings::values.fullscreen_mode.GetValue()));
277 // ui->nvdec_emulation->setCurrentIndex(
278 // static_cast<int>(Settings::values.nvdec_emulation.GetValue()));
279 // ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio.GetValue());
280 // ui->resolution_combobox->setCurrentIndex(
281 // static_cast<int>(Settings::values.resolution_setup.GetValue()));
282 // ui->scaling_filter_combobox->setCurrentIndex(
283 // static_cast<int>(Settings::values.scaling_filter.GetValue()));
284 // ui->fsr_sharpening_slider->setValue(Settings::values.fsr_sharpening_slider.GetValue());
285 // ui->anti_aliasing_combobox->setCurrentIndex(
286 // static_cast<int>(Settings::values.anti_aliasing.GetValue()));
287 // } else {
288 // ConfigurationShared::SetPerGameSetting(api_combobox, &Settings::values.renderer_backend);
289 // ConfigurationShared::SetHighlight(ui->api_widget,
290 // !Settings::values.renderer_backend.UsingGlobal());
291
292 // ConfigurationShared::SetPerGameSetting(ui->astc_decode_mode_combobox,
293 // &Settings::values.accelerate_astc);
294 // ConfigurationShared::SetHighlight(ui->astc_decode_mode_layout,
295 // !Settings::values.accelerate_astc.UsingGlobal());
296
297 // ConfigurationShared::SetPerGameSetting(ui->nvdec_emulation,
298 // &Settings::values.nvdec_emulation);
299 // ConfigurationShared::SetHighlight(ui->nvdec_emulation_widget,
300 // !Settings::values.nvdec_emulation.UsingGlobal());
301
302 // ConfigurationShared::SetPerGameSetting(ui->fullscreen_mode_combobox,
303 // &Settings::values.fullscreen_mode);
304 // ConfigurationShared::SetHighlight(ui->fullscreen_mode_label,
305 // !Settings::values.fullscreen_mode.UsingGlobal());
306
307 // ConfigurationShared::SetPerGameSetting(ui->aspect_ratio_combobox,
308 // &Settings::values.aspect_ratio);
309 // ConfigurationShared::SetHighlight(ui->ar_label,
310 // !Settings::values.aspect_ratio.UsingGlobal());
311
312 // ConfigurationShared::SetPerGameSetting(ui->resolution_combobox,
313 // &Settings::values.resolution_setup);
314 // ConfigurationShared::SetHighlight(ui->resolution_label,
315 // !Settings::values.resolution_setup.UsingGlobal());
316
317 // ConfigurationShared::SetPerGameSetting(ui->scaling_filter_combobox,
318 // &Settings::values.scaling_filter);
319 // ConfigurationShared::SetHighlight(ui->scaling_filter_label,
320 // !Settings::values.scaling_filter.UsingGlobal());
321
322 // ConfigurationShared::SetPerGameSetting(ui->anti_aliasing_combobox,
323 // &Settings::values.anti_aliasing);
324 // ConfigurationShared::SetHighlight(ui->anti_aliasing_label,
325 // !Settings::values.anti_aliasing.UsingGlobal());
326
327 // ui->fsr_sharpening_combobox->setCurrentIndex(
328 // Settings::values.fsr_sharpening_slider.UsingGlobal() ? 0 : 1);
329 // ui->fsr_sharpening_slider->setEnabled(
330 // !Settings::values.fsr_sharpening_slider.UsingGlobal());
331 // ui->fsr_sharpening_value->setEnabled(!Settings::values.fsr_sharpening_slider.UsingGlobal());
332 // ConfigurationShared::SetHighlight(ui->fsr_sharpening_layout,
333 // !Settings::values.fsr_sharpening_slider.UsingGlobal());
334 // ui->fsr_sharpening_slider->setValue(Settings::values.fsr_sharpening_slider.GetValue());
335
336 // ui->bg_combobox->setCurrentIndex(Settings::values.bg_red.UsingGlobal() ? 0 : 1);
337 // ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal());
338 // ConfigurationShared::SetHighlight(ui->bg_layout, !Settings::values.bg_red.UsingGlobal());
339 // }
294} 340}
295 341
296void ConfigureGraphics::SetFSRIndicatorText(int percentage) { 342void ConfigureGraphics::SetFSRIndicatorText(int percentage) {
297 ui->fsr_sharpening_value->setText( 343 // ui->fsr_sharpening_value->setText(
298 tr("%1%", "FSR sharpening percentage (e.g. 50%)").arg(100 - (percentage / 2))); 344 // tr("%1%", "FSR sharpening percentage (e.g. 50%)").arg(100 - (percentage / 2)));
299} 345}
300 346
301const QString ConfigureGraphics::TranslateVSyncMode(VkPresentModeKHR mode, 347const QString ConfigureGraphics::TranslateVSyncMode(VkPresentModeKHR mode,
@@ -320,131 +366,134 @@ const QString ConfigureGraphics::TranslateVSyncMode(VkPresentModeKHR mode,
320} 366}
321 367
322void ConfigureGraphics::ApplyConfiguration() { 368void ConfigureGraphics::ApplyConfiguration() {
323 const auto resolution_setup = static_cast<Settings::ResolutionSetup>( 369 // const auto resolution_setup = static_cast<Settings::ResolutionSetup>(
324 ui->resolution_combobox->currentIndex() - 370 // ui->resolution_combobox->currentIndex() -
325 ((Settings::IsConfiguringGlobal()) ? 0 : ConfigurationShared::USE_GLOBAL_OFFSET)); 371 // ((Settings::IsConfiguringGlobal()) ? 0 : ConfigurationShared::USE_GLOBAL_OFFSET));
326 372
327 const auto scaling_filter = static_cast<Settings::ScalingFilter>( 373 // const auto scaling_filter = static_cast<Settings::ScalingFilter>(
328 ui->scaling_filter_combobox->currentIndex() - 374 // ui->scaling_filter_combobox->currentIndex() -
329 ((Settings::IsConfiguringGlobal()) ? 0 : ConfigurationShared::USE_GLOBAL_OFFSET)); 375 // ((Settings::IsConfiguringGlobal()) ? 0 : ConfigurationShared::USE_GLOBAL_OFFSET));
330 376
331 const auto anti_aliasing = static_cast<Settings::AntiAliasing>( 377 // const auto anti_aliasing = static_cast<Settings::AntiAliasing>(
332 ui->anti_aliasing_combobox->currentIndex() - 378 // ui->anti_aliasing_combobox->currentIndex() -
333 ((Settings::IsConfiguringGlobal()) ? 0 : ConfigurationShared::USE_GLOBAL_OFFSET)); 379 // ((Settings::IsConfiguringGlobal()) ? 0 : ConfigurationShared::USE_GLOBAL_OFFSET));
334 380
335 ConfigurationShared::ApplyPerGameSetting(&Settings::values.fullscreen_mode, 381 // ConfigurationShared::ApplyPerGameSetting(&Settings::values.fullscreen_mode,
336 ui->fullscreen_mode_combobox); 382 // ui->fullscreen_mode_combobox);
337 ConfigurationShared::ApplyPerGameSetting(&Settings::values.aspect_ratio, 383 // ConfigurationShared::ApplyPerGameSetting(&Settings::values.aspect_ratio,
338 ui->aspect_ratio_combobox); 384 // ui->aspect_ratio_combobox);
339 ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_disk_shader_cache, 385 // ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_disk_shader_cache,
340 ui->use_disk_shader_cache, use_disk_shader_cache); 386 // ui->use_disk_shader_cache, use_disk_shader_cache);
341 ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_asynchronous_gpu_emulation, 387 // ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_asynchronous_gpu_emulation,
342 ui->use_asynchronous_gpu_emulation, 388 // ui->use_asynchronous_gpu_emulation,
343 use_asynchronous_gpu_emulation); 389 // use_asynchronous_gpu_emulation);
344 ConfigurationShared::ApplyPerGameSetting(&Settings::values.accelerate_astc, 390 // ConfigurationShared::ApplyPerGameSetting(&Settings::values.accelerate_astc,
345 ui->astc_decode_mode_combobox); 391 // ui->astc_decode_mode_combobox);
346 392
347 if (Settings::IsConfiguringGlobal()) { 393 // if (Settings::IsConfiguringGlobal()) {
348 // Guard if during game and set to game-specific value 394 // // Guard if during game and set to game-specific value
349 if (Settings::values.renderer_backend.UsingGlobal()) { 395 // if (Settings::values.renderer_backend.UsingGlobal()) {
350 Settings::values.renderer_backend.SetValue(GetCurrentGraphicsBackend()); 396 // Settings::values.renderer_backend.SetValue(GetCurrentGraphicsBackend());
351 } 397 // }
352 if (Settings::values.nvdec_emulation.UsingGlobal()) { 398 // if (Settings::values.nvdec_emulation.UsingGlobal()) {
353 Settings::values.nvdec_emulation.SetValue(GetCurrentNvdecEmulation()); 399 // Settings::values.nvdec_emulation.SetValue(GetCurrentNvdecEmulation());
354 } 400 // }
355 if (Settings::values.shader_backend.UsingGlobal()) { 401 // if (Settings::values.shader_backend.UsingGlobal()) {
356 Settings::values.shader_backend.SetValue(shader_backend); 402 // Settings::values.shader_backend.SetValue(shader_backend);
357 } 403 // }
358 if (Settings::values.vulkan_device.UsingGlobal()) { 404 // if (Settings::values.vulkan_device.UsingGlobal()) {
359 Settings::values.vulkan_device.SetValue(vulkan_device); 405 // Settings::values.vulkan_device.SetValue(vulkan_device);
360 } 406 // }
361 if (Settings::values.bg_red.UsingGlobal()) { 407 // if (Settings::values.bg_red.UsingGlobal()) {
362 Settings::values.bg_red.SetValue(static_cast<u8>(bg_color.red())); 408 // Settings::values.bg_red.SetValue(static_cast<u8>(bg_color.red()));
363 Settings::values.bg_green.SetValue(static_cast<u8>(bg_color.green())); 409 // Settings::values.bg_green.SetValue(static_cast<u8>(bg_color.green()));
364 Settings::values.bg_blue.SetValue(static_cast<u8>(bg_color.blue())); 410 // Settings::values.bg_blue.SetValue(static_cast<u8>(bg_color.blue()));
365 } 411 // }
366 if (Settings::values.resolution_setup.UsingGlobal()) { 412 // if (Settings::values.resolution_setup.UsingGlobal()) {
367 Settings::values.resolution_setup.SetValue(resolution_setup); 413 // Settings::values.resolution_setup.SetValue(resolution_setup);
368 } 414 // }
369 if (Settings::values.scaling_filter.UsingGlobal()) { 415 // if (Settings::values.scaling_filter.UsingGlobal()) {
370 Settings::values.scaling_filter.SetValue(scaling_filter); 416 // Settings::values.scaling_filter.SetValue(scaling_filter);
371 } 417 // }
372 if (Settings::values.anti_aliasing.UsingGlobal()) { 418 // if (Settings::values.anti_aliasing.UsingGlobal()) {
373 Settings::values.anti_aliasing.SetValue(anti_aliasing); 419 // Settings::values.anti_aliasing.SetValue(anti_aliasing);
374 } 420 // }
375 Settings::values.fsr_sharpening_slider.SetValue(ui->fsr_sharpening_slider->value()); 421 // Settings::values.fsr_sharpening_slider.SetValue(ui->fsr_sharpening_slider->value());
376 422
377 const auto mode = vsync_mode_combobox_enum_map[ui->vsync_mode_combobox->currentIndex()]; 423 // const auto mode = vsync_mode_combobox_enum_map[vsync_mode_combobox->currentIndex()];
378 const auto vsync_mode = PresentModeToSetting(mode); 424 // const auto vsync_mode = PresentModeToSetting(mode);
379 Settings::values.vsync_mode.SetValue(vsync_mode); 425 // Settings::values.vsync_mode.SetValue(vsync_mode);
380 } else { 426 // } else {
381 if (ui->resolution_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { 427 // if (ui->resolution_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) {
382 Settings::values.resolution_setup.SetGlobal(true); 428 // Settings::values.resolution_setup.SetGlobal(true);
383 } else { 429 // } else {
384 Settings::values.resolution_setup.SetGlobal(false); 430 // Settings::values.resolution_setup.SetGlobal(false);
385 Settings::values.resolution_setup.SetValue(resolution_setup); 431 // Settings::values.resolution_setup.SetValue(resolution_setup);
386 } 432 // }
387 if (ui->scaling_filter_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { 433 // if (ui->scaling_filter_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX)
388 Settings::values.scaling_filter.SetGlobal(true); 434 // {
389 } else { 435 // Settings::values.scaling_filter.SetGlobal(true);
390 Settings::values.scaling_filter.SetGlobal(false); 436 // } else {
391 Settings::values.scaling_filter.SetValue(scaling_filter); 437 // Settings::values.scaling_filter.SetGlobal(false);
392 } 438 // Settings::values.scaling_filter.SetValue(scaling_filter);
393 if (ui->anti_aliasing_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { 439 // }
394 Settings::values.anti_aliasing.SetGlobal(true); 440 // if (ui->anti_aliasing_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX)
395 } else { 441 // {
396 Settings::values.anti_aliasing.SetGlobal(false); 442 // Settings::values.anti_aliasing.SetGlobal(true);
397 Settings::values.anti_aliasing.SetValue(anti_aliasing); 443 // } else {
398 } 444 // Settings::values.anti_aliasing.SetGlobal(false);
399 if (ui->api->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { 445 // Settings::values.anti_aliasing.SetValue(anti_aliasing);
400 Settings::values.renderer_backend.SetGlobal(true); 446 // }
401 Settings::values.shader_backend.SetGlobal(true); 447 // if (api_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) {
402 Settings::values.vulkan_device.SetGlobal(true); 448 // Settings::values.renderer_backend.SetGlobal(true);
403 } else { 449 // Settings::values.shader_backend.SetGlobal(true);
404 Settings::values.renderer_backend.SetGlobal(false); 450 // Settings::values.vulkan_device.SetGlobal(true);
405 Settings::values.renderer_backend.SetValue(GetCurrentGraphicsBackend()); 451 // } else {
406 switch (GetCurrentGraphicsBackend()) { 452 // Settings::values.renderer_backend.SetGlobal(false);
407 case Settings::RendererBackend::OpenGL: 453 // Settings::values.renderer_backend.SetValue(GetCurrentGraphicsBackend());
408 case Settings::RendererBackend::Null: 454 // switch (GetCurrentGraphicsBackend()) {
409 Settings::values.shader_backend.SetGlobal(false); 455 // case Settings::RendererBackend::OpenGL:
410 Settings::values.vulkan_device.SetGlobal(true); 456 // case Settings::RendererBackend::Null:
411 Settings::values.shader_backend.SetValue(shader_backend); 457 // Settings::values.shader_backend.SetGlobal(false);
412 break; 458 // Settings::values.vulkan_device.SetGlobal(true);
413 case Settings::RendererBackend::Vulkan: 459 // Settings::values.shader_backend.SetValue(shader_backend);
414 Settings::values.shader_backend.SetGlobal(true); 460 // break;
415 Settings::values.vulkan_device.SetGlobal(false); 461 // case Settings::RendererBackend::Vulkan:
416 Settings::values.vulkan_device.SetValue(vulkan_device); 462 // Settings::values.shader_backend.SetGlobal(true);
417 break; 463 // Settings::values.vulkan_device.SetGlobal(false);
418 } 464 // Settings::values.vulkan_device.SetValue(vulkan_device);
419 } 465 // break;
420 466 // }
421 if (ui->nvdec_emulation->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { 467 // }
422 Settings::values.nvdec_emulation.SetGlobal(true); 468
423 } else { 469 // if (ui->nvdec_emulation->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) {
424 Settings::values.nvdec_emulation.SetGlobal(false); 470 // Settings::values.nvdec_emulation.SetGlobal(true);
425 Settings::values.nvdec_emulation.SetValue(GetCurrentNvdecEmulation()); 471 // } else {
426 } 472 // Settings::values.nvdec_emulation.SetGlobal(false);
427 473 // Settings::values.nvdec_emulation.SetValue(GetCurrentNvdecEmulation());
428 if (ui->bg_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { 474 // }
429 Settings::values.bg_red.SetGlobal(true); 475
430 Settings::values.bg_green.SetGlobal(true); 476 // if (ui->bg_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) {
431 Settings::values.bg_blue.SetGlobal(true); 477 // Settings::values.bg_red.SetGlobal(true);
432 } else { 478 // Settings::values.bg_green.SetGlobal(true);
433 Settings::values.bg_red.SetGlobal(false); 479 // Settings::values.bg_blue.SetGlobal(true);
434 Settings::values.bg_green.SetGlobal(false); 480 // } else {
435 Settings::values.bg_blue.SetGlobal(false); 481 // Settings::values.bg_red.SetGlobal(false);
436 Settings::values.bg_red.SetValue(static_cast<u8>(bg_color.red())); 482 // Settings::values.bg_green.SetGlobal(false);
437 Settings::values.bg_green.SetValue(static_cast<u8>(bg_color.green())); 483 // Settings::values.bg_blue.SetGlobal(false);
438 Settings::values.bg_blue.SetValue(static_cast<u8>(bg_color.blue())); 484 // Settings::values.bg_red.SetValue(static_cast<u8>(bg_color.red()));
439 } 485 // Settings::values.bg_green.SetValue(static_cast<u8>(bg_color.green()));
440 486 // Settings::values.bg_blue.SetValue(static_cast<u8>(bg_color.blue()));
441 if (ui->fsr_sharpening_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { 487 // }
442 Settings::values.fsr_sharpening_slider.SetGlobal(true); 488
443 } else { 489 // if (ui->fsr_sharpening_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX)
444 Settings::values.fsr_sharpening_slider.SetGlobal(false); 490 // {
445 Settings::values.fsr_sharpening_slider.SetValue(ui->fsr_sharpening_slider->value()); 491 // Settings::values.fsr_sharpening_slider.SetGlobal(true);
446 } 492 // } else {
447 } 493 // Settings::values.fsr_sharpening_slider.SetGlobal(false);
494 // Settings::values.fsr_sharpening_slider.SetValue(ui->fsr_sharpening_slider->value());
495 // }
496 // }
448} 497}
449 498
450void ConfigureGraphics::changeEvent(QEvent* event) { 499void ConfigureGraphics::changeEvent(QEvent* event) {
@@ -462,43 +511,43 @@ void ConfigureGraphics::RetranslateUI() {
462void ConfigureGraphics::UpdateBackgroundColorButton(QColor color) { 511void ConfigureGraphics::UpdateBackgroundColorButton(QColor color) {
463 bg_color = color; 512 bg_color = color;
464 513
465 QPixmap pixmap(ui->bg_button->size()); 514 // QPixmap pixmap(ui->bg_button->size());
466 pixmap.fill(bg_color); 515 // pixmap.fill(bg_color);
467 516
468 const QIcon color_icon(pixmap); 517 // const QIcon color_icon(pixmap);
469 ui->bg_button->setIcon(color_icon); 518 // ui->bg_button->setIcon(color_icon);
470} 519}
471 520
472void ConfigureGraphics::UpdateAPILayout() { 521void ConfigureGraphics::UpdateAPILayout() {
473 if (!Settings::IsConfiguringGlobal() && 522 if (!Settings::IsConfiguringGlobal() &&
474 ui->api->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { 523 api_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) {
475 vulkan_device = Settings::values.vulkan_device.GetValue(true); 524 vulkan_device = Settings::values.vulkan_device.GetValue(true);
476 shader_backend = Settings::values.shader_backend.GetValue(true); 525 shader_backend = Settings::values.shader_backend.GetValue(true);
477 ui->device_widget->setEnabled(false); 526 vulkan_device_widget->setEnabled(false);
478 ui->backend_widget->setEnabled(false); 527 shader_backend_widget->setEnabled(false);
479 } else { 528 } else {
480 vulkan_device = Settings::values.vulkan_device.GetValue(); 529 vulkan_device = Settings::values.vulkan_device.GetValue();
481 shader_backend = Settings::values.shader_backend.GetValue(); 530 shader_backend = Settings::values.shader_backend.GetValue();
482 ui->device_widget->setEnabled(true); 531 vulkan_device_widget->setEnabled(true);
483 ui->backend_widget->setEnabled(true); 532 shader_backend_widget->setEnabled(true);
484 } 533 }
485 534
486 switch (GetCurrentGraphicsBackend()) { 535 switch (GetCurrentGraphicsBackend()) {
487 case Settings::RendererBackend::OpenGL: 536 case Settings::RendererBackend::OpenGL:
488 ui->backend->setCurrentIndex(static_cast<u32>(shader_backend)); 537 shader_backend_combobox->setCurrentIndex(static_cast<u32>(shader_backend));
489 ui->device_widget->setVisible(false); 538 vulkan_device_widget->setVisible(false);
490 ui->backend_widget->setVisible(true); 539 shader_backend_widget->setVisible(true);
491 break; 540 break;
492 case Settings::RendererBackend::Vulkan: 541 case Settings::RendererBackend::Vulkan:
493 if (static_cast<int>(vulkan_device) < ui->device->count()) { 542 if (static_cast<int>(vulkan_device) < vulkan_device_combobox->count()) {
494 ui->device->setCurrentIndex(vulkan_device); 543 vulkan_device_combobox->setCurrentIndex(vulkan_device);
495 } 544 }
496 ui->device_widget->setVisible(true); 545 vulkan_device_widget->setVisible(true);
497 ui->backend_widget->setVisible(false); 546 shader_backend_widget->setVisible(false);
498 break; 547 break;
499 case Settings::RendererBackend::Null: 548 case Settings::RendererBackend::Null:
500 ui->device_widget->setVisible(false); 549 vulkan_device_widget->setVisible(false);
501 ui->backend_widget->setVisible(false); 550 shader_backend_widget->setVisible(false);
502 break; 551 break;
503 } 552 }
504} 553}
@@ -520,92 +569,94 @@ void ConfigureGraphics::RetrieveVulkanDevices() {
520 569
521Settings::RendererBackend ConfigureGraphics::GetCurrentGraphicsBackend() const { 570Settings::RendererBackend ConfigureGraphics::GetCurrentGraphicsBackend() const {
522 if (Settings::IsConfiguringGlobal()) { 571 if (Settings::IsConfiguringGlobal()) {
523 return static_cast<Settings::RendererBackend>(ui->api->currentIndex()); 572 return static_cast<Settings::RendererBackend>(api_combobox->currentIndex());
524 } 573 }
525 574
526 if (ui->api->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { 575 if (api_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) {
527 Settings::values.renderer_backend.SetGlobal(true); 576 Settings::values.renderer_backend.SetGlobal(true);
528 return Settings::values.renderer_backend.GetValue(); 577 return Settings::values.renderer_backend.GetValue();
529 } 578 }
530 Settings::values.renderer_backend.SetGlobal(false); 579 Settings::values.renderer_backend.SetGlobal(false);
531 return static_cast<Settings::RendererBackend>(ui->api->currentIndex() - 580 return static_cast<Settings::RendererBackend>(api_combobox->currentIndex() -
532 ConfigurationShared::USE_GLOBAL_OFFSET); 581 ConfigurationShared::USE_GLOBAL_OFFSET);
533} 582}
534 583
535Settings::NvdecEmulation ConfigureGraphics::GetCurrentNvdecEmulation() const { 584Settings::NvdecEmulation ConfigureGraphics::GetCurrentNvdecEmulation() const {
536 if (Settings::IsConfiguringGlobal()) { 585 return Settings::NvdecEmulation::CPU;
537 return static_cast<Settings::NvdecEmulation>(ui->nvdec_emulation->currentIndex()); 586 // if (Settings::IsConfiguringGlobal()) {
538 } 587 // return static_cast<Settings::NvdecEmulation>(ui->nvdec_emulation->currentIndex());
539 588 // }
540 if (ui->nvdec_emulation->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { 589
541 Settings::values.nvdec_emulation.SetGlobal(true); 590 // if (ui->nvdec_emulation->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) {
542 return Settings::values.nvdec_emulation.GetValue(); 591 // Settings::values.nvdec_emulation.SetGlobal(true);
543 } 592 // return Settings::values.nvdec_emulation.GetValue();
544 Settings::values.nvdec_emulation.SetGlobal(false); 593 // }
545 return static_cast<Settings::NvdecEmulation>(ui->nvdec_emulation->currentIndex() - 594 // Settings::values.nvdec_emulation.SetGlobal(false);
546 ConfigurationShared::USE_GLOBAL_OFFSET); 595 // return static_cast<Settings::NvdecEmulation>(ui->nvdec_emulation->currentIndex() -
596 // ConfigurationShared::USE_GLOBAL_OFFSET);
547} 597}
548 598
549void ConfigureGraphics::SetupPerGameUI() { 599void ConfigureGraphics::SetupPerGameUI() {
550 if (Settings::IsConfiguringGlobal()) { 600 // if (Settings::IsConfiguringGlobal()) {
551 ui->api->setEnabled(Settings::values.renderer_backend.UsingGlobal()); 601 // api_combobox->setEnabled(Settings::values.renderer_backend.UsingGlobal());
552 ui->device->setEnabled(Settings::values.renderer_backend.UsingGlobal()); 602 // vulkan_device_combobox->setEnabled(Settings::values.renderer_backend.UsingGlobal());
553 ui->fullscreen_mode_combobox->setEnabled(Settings::values.fullscreen_mode.UsingGlobal()); 603 // ui->fullscreen_mode_combobox->setEnabled(Settings::values.fullscreen_mode.UsingGlobal());
554 ui->aspect_ratio_combobox->setEnabled(Settings::values.aspect_ratio.UsingGlobal()); 604 // ui->aspect_ratio_combobox->setEnabled(Settings::values.aspect_ratio.UsingGlobal());
555 ui->resolution_combobox->setEnabled(Settings::values.resolution_setup.UsingGlobal()); 605 // ui->resolution_combobox->setEnabled(Settings::values.resolution_setup.UsingGlobal());
556 ui->scaling_filter_combobox->setEnabled(Settings::values.scaling_filter.UsingGlobal()); 606 // ui->scaling_filter_combobox->setEnabled(Settings::values.scaling_filter.UsingGlobal());
557 ui->fsr_sharpening_slider->setEnabled(Settings::values.fsr_sharpening_slider.UsingGlobal()); 607 // ui->fsr_sharpening_slider->setEnabled(Settings::values.fsr_sharpening_slider.UsingGlobal());
558 ui->anti_aliasing_combobox->setEnabled(Settings::values.anti_aliasing.UsingGlobal()); 608 // ui->anti_aliasing_combobox->setEnabled(Settings::values.anti_aliasing.UsingGlobal());
559 ui->use_asynchronous_gpu_emulation->setEnabled( 609 // ui->use_asynchronous_gpu_emulation->setEnabled(
560 Settings::values.use_asynchronous_gpu_emulation.UsingGlobal()); 610 // Settings::values.use_asynchronous_gpu_emulation.UsingGlobal());
561 ui->nvdec_emulation->setEnabled(Settings::values.nvdec_emulation.UsingGlobal()); 611 // ui->nvdec_emulation->setEnabled(Settings::values.nvdec_emulation.UsingGlobal());
562 ui->astc_decode_mode_combobox->setEnabled(Settings::values.accelerate_astc.UsingGlobal()); 612 // ui->astc_decode_mode_combobox->setEnabled(Settings::values.accelerate_astc.UsingGlobal());
563 ui->use_disk_shader_cache->setEnabled(Settings::values.use_disk_shader_cache.UsingGlobal()); 613 // ui->use_disk_shader_cache->setEnabled(Settings::values.use_disk_shader_cache.UsingGlobal());
564 ui->bg_button->setEnabled(Settings::values.bg_red.UsingGlobal()); 614 // ui->bg_button->setEnabled(Settings::values.bg_red.UsingGlobal());
565 ui->fsr_slider_layout->setEnabled(Settings::values.fsr_sharpening_slider.UsingGlobal()); 615 // ui->fsr_slider_layout->setEnabled(Settings::values.fsr_sharpening_slider.UsingGlobal());
566 616
567 return; 617 // return;
568 } 618 // }
569 619
570 connect(ui->bg_combobox, qOverload<int>(&QComboBox::activated), this, [this](int index) { 620 // connect(ui->bg_combobox, qOverload<int>(&QComboBox::activated), this, [this](int index) {
571 ui->bg_button->setEnabled(index == 1); 621 // ui->bg_button->setEnabled(index == 1);
572 ConfigurationShared::SetHighlight(ui->bg_layout, index == 1); 622 // ConfigurationShared::SetHighlight(ui->bg_layout, index == 1);
573 }); 623 // });
574 624
575 connect(ui->fsr_sharpening_combobox, qOverload<int>(&QComboBox::activated), this, 625 // connect(ui->fsr_sharpening_combobox, qOverload<int>(&QComboBox::activated), this,
576 [this](int index) { 626 // [this](int index) {
577 ui->fsr_sharpening_slider->setEnabled(index == 1); 627 // ui->fsr_sharpening_slider->setEnabled(index == 1);
578 ui->fsr_sharpening_value->setEnabled(index == 1); 628 // ui->fsr_sharpening_value->setEnabled(index == 1);
579 ConfigurationShared::SetHighlight(ui->fsr_sharpening_layout, index == 1); 629 // ConfigurationShared::SetHighlight(ui->fsr_sharpening_layout, index == 1);
580 }); 630 // });
581 631
582 ConfigurationShared::SetColoredTristate( 632 // ConfigurationShared::SetColoredTristate(
583 ui->use_disk_shader_cache, Settings::values.use_disk_shader_cache, use_disk_shader_cache); 633 // ui->use_disk_shader_cache, Settings::values.use_disk_shader_cache,
584 ConfigurationShared::SetColoredTristate(ui->use_asynchronous_gpu_emulation, 634 // use_disk_shader_cache);
585 Settings::values.use_asynchronous_gpu_emulation, 635 // ConfigurationShared::SetColoredTristate(ui->use_asynchronous_gpu_emulation,
586 use_asynchronous_gpu_emulation); 636 // Settings::values.use_asynchronous_gpu_emulation,
587 637 // use_asynchronous_gpu_emulation);
588 ConfigurationShared::SetColoredComboBox(ui->aspect_ratio_combobox, ui->ar_label, 638
589 Settings::values.aspect_ratio.GetValue(true)); 639 // ConfigurationShared::SetColoredComboBox(ui->aspect_ratio_combobox, ui->ar_label,
590 ConfigurationShared::SetColoredComboBox( 640 // Settings::values.aspect_ratio.GetValue(true));
591 ui->fullscreen_mode_combobox, ui->fullscreen_mode_label, 641 // ConfigurationShared::SetColoredComboBox(
592 static_cast<int>(Settings::values.fullscreen_mode.GetValue(true))); 642 // ui->fullscreen_mode_combobox, ui->fullscreen_mode_label,
593 ConfigurationShared::SetColoredComboBox( 643 // static_cast<int>(Settings::values.fullscreen_mode.GetValue(true)));
594 ui->resolution_combobox, ui->resolution_label, 644 // ConfigurationShared::SetColoredComboBox(
595 static_cast<int>(Settings::values.resolution_setup.GetValue(true))); 645 // ui->resolution_combobox, ui->resolution_label,
596 ConfigurationShared::SetColoredComboBox( 646 // static_cast<int>(Settings::values.resolution_setup.GetValue(true)));
597 ui->scaling_filter_combobox, ui->scaling_filter_label, 647 // ConfigurationShared::SetColoredComboBox(
598 static_cast<int>(Settings::values.scaling_filter.GetValue(true))); 648 // ui->scaling_filter_combobox, ui->scaling_filter_label,
599 ConfigurationShared::SetColoredComboBox( 649 // static_cast<int>(Settings::values.scaling_filter.GetValue(true)));
600 ui->anti_aliasing_combobox, ui->anti_aliasing_label, 650 // ConfigurationShared::SetColoredComboBox(
601 static_cast<int>(Settings::values.anti_aliasing.GetValue(true))); 651 // ui->anti_aliasing_combobox, ui->anti_aliasing_label,
602 ConfigurationShared::SetColoredComboBox( 652 // static_cast<int>(Settings::values.anti_aliasing.GetValue(true)));
603 ui->astc_decode_mode_combobox, ui->astc_decode_mode_label, 653 // ConfigurationShared::SetColoredComboBox(
604 static_cast<int>(Settings::values.accelerate_astc.GetValue(true))); 654 // ui->astc_decode_mode_combobox, ui->astc_decode_mode_label,
605 ConfigurationShared::InsertGlobalItem( 655 // static_cast<int>(Settings::values.accelerate_astc.GetValue(true)));
606 ui->api, static_cast<int>(Settings::values.renderer_backend.GetValue(true))); 656 // ConfigurationShared::InsertGlobalItem(
607 ConfigurationShared::InsertGlobalItem( 657 // api_combobox, static_cast<int>(Settings::values.renderer_backend.GetValue(true)));
608 ui->nvdec_emulation, static_cast<int>(Settings::values.nvdec_emulation.GetValue(true))); 658 // ConfigurationShared::InsertGlobalItem(
609 659 // ui->nvdec_emulation, static_cast<int>(Settings::values.nvdec_emulation.GetValue(true)));
610 ui->vsync_mode_layout->setVisible(false); 660
661 // ui->vsync_mode_layout->setVisible(false);
611} 662}
diff --git a/src/yuzu/configuration/configure_graphics.h b/src/yuzu/configuration/configure_graphics.h
index adc3faffa..30dfb6163 100644
--- a/src/yuzu/configuration/configure_graphics.h
+++ b/src/yuzu/configuration/configure_graphics.h
@@ -17,6 +17,7 @@
17 17
18class QEvent; 18class QEvent;
19class QObject; 19class QObject;
20class QComboBox;
20 21
21namespace Settings { 22namespace Settings {
22enum class NvdecEmulation : u32; 23enum class NvdecEmulation : u32;
@@ -38,6 +39,7 @@ public:
38 std::vector<VkDeviceInfo::Record>& records, 39 std::vector<VkDeviceInfo::Record>& records,
39 const std::function<void()>& expose_compute_option_, 40 const std::function<void()>& expose_compute_option_,
40 std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, 41 std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group,
42 const ConfigurationShared::TranslationMap& translations_,
41 QWidget* parent = nullptr); 43 QWidget* parent = nullptr);
42 ~ConfigureGraphics() override; 44 ~ConfigureGraphics() override;
43 45
@@ -70,10 +72,8 @@ private:
70 std::unique_ptr<Ui::ConfigureGraphics> ui; 72 std::unique_ptr<Ui::ConfigureGraphics> ui;
71 QColor bg_color; 73 QColor bg_color;
72 74
73 ConfigurationShared::CheckState use_nvdec_emulation; 75 std::list<ConfigurationShared::CheckState> trackers{};
74 ConfigurationShared::CheckState accelerate_astc; 76 std::forward_list<std::function<void(bool)>> apply_funcs{};
75 ConfigurationShared::CheckState use_disk_shader_cache;
76 ConfigurationShared::CheckState use_asynchronous_gpu_emulation;
77 77
78 std::vector<VkDeviceInfo::Record>& records; 78 std::vector<VkDeviceInfo::Record>& records;
79 std::vector<QString> vulkan_devices; 79 std::vector<QString> vulkan_devices;
@@ -86,4 +86,12 @@ private:
86 const std::function<void()>& expose_compute_option; 86 const std::function<void()>& expose_compute_option;
87 87
88 const Core::System& system; 88 const Core::System& system;
89 const ConfigurationShared::TranslationMap& translations;
90
91 QComboBox* vulkan_device_combobox;
92 QComboBox* api_combobox;
93 QComboBox* shader_backend_combobox;
94 QComboBox* vsync_mode_combobox;
95 QWidget* vulkan_device_widget;
96 QWidget* shader_backend_widget;
89}; 97};
diff --git a/src/yuzu/configuration/configure_graphics.ui b/src/yuzu/configuration/configure_graphics.ui
index 91b09625b..565429c98 100644
--- a/src/yuzu/configuration/configure_graphics.ui
+++ b/src/yuzu/configuration/configure_graphics.ui
@@ -43,112 +43,6 @@
43 <property name="horizontalSpacing"> 43 <property name="horizontalSpacing">
44 <number>6</number> 44 <number>6</number>
45 </property> 45 </property>
46 <item row="4" column="0">
47 <widget class="QWidget" name="backend_widget" native="true">
48 <layout class="QHBoxLayout" name="backend_layout">
49 <property name="leftMargin">
50 <number>0</number>
51 </property>
52 <property name="topMargin">
53 <number>0</number>
54 </property>
55 <property name="rightMargin">
56 <number>0</number>
57 </property>
58 <property name="bottomMargin">
59 <number>0</number>
60 </property>
61 <item>
62 <widget class="QLabel" name="backend_label">
63 <property name="text">
64 <string>Shader Backend:</string>
65 </property>
66 </widget>
67 </item>
68 <item>
69 <widget class="QComboBox" name="backend"/>
70 </item>
71 </layout>
72 </widget>
73 </item>
74 <item row="2" column="0">
75 <widget class="QWidget" name="device_widget" native="true">
76 <layout class="QHBoxLayout" name="device_layout">
77 <property name="leftMargin">
78 <number>0</number>
79 </property>
80 <property name="topMargin">
81 <number>0</number>
82 </property>
83 <property name="rightMargin">
84 <number>0</number>
85 </property>
86 <property name="bottomMargin">
87 <number>0</number>
88 </property>
89 <item>
90 <widget class="QLabel" name="device_label">
91 <property name="text">
92 <string>Device:</string>
93 </property>
94 </widget>
95 </item>
96 <item>
97 <widget class="QComboBox" name="device"/>
98 </item>
99 </layout>
100 </widget>
101 </item>
102 <item row="0" column="0">
103 <widget class="QWidget" name="api_layout_2" native="true">
104 <layout class="QHBoxLayout" name="api_layout">
105 <property name="leftMargin">
106 <number>0</number>
107 </property>
108 <property name="topMargin">
109 <number>0</number>
110 </property>
111 <property name="rightMargin">
112 <number>0</number>
113 </property>
114 <property name="bottomMargin">
115 <number>0</number>
116 </property>
117 <item>
118 <widget class="QLabel" name="api_label">
119 <property name="text">
120 <string>API:</string>
121 </property>
122 </widget>
123 </item>
124 <item>
125 <widget class="QComboBox" name="api">
126 <property name="sizePolicy">
127 <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
128 <horstretch>0</horstretch>
129 <verstretch>0</verstretch>
130 </sizepolicy>
131 </property>
132 <item>
133 <property name="text">
134 <string notr="true">OpenGL</string>
135 </property>
136 </item>
137 <item>
138 <property name="text">
139 <string notr="true">Vulkan</string>
140 </property>
141 </item>
142 <item>
143 <property name="text">
144 <string>None</string>
145 </property>
146 </item>
147 </widget>
148 </item>
149 </layout>
150 </widget>
151 </item>
152 </layout> 46 </layout>
153 </widget> 47 </widget>
154 </item> 48 </item>
@@ -168,649 +62,8 @@
168 </property> 62 </property>
169 <layout class="QVBoxLayout" name="verticalLayout_4"> 63 <layout class="QVBoxLayout" name="verticalLayout_4">
170 <item> 64 <item>
171 <widget class="QCheckBox" name="use_disk_shader_cache"> 65 <widget class="QWidget" name="graphics_widget" native="true">
172 <property name="text"> 66 <layout class="QVBoxLayout" name="verticalLayout"/>
173 <string>Use disk pipeline cache</string>
174 </property>
175 </widget>
176 </item>
177 <item>
178 <widget class="QCheckBox" name="use_asynchronous_gpu_emulation">
179 <property name="text">
180 <string>Use asynchronous GPU emulation</string>
181 </property>
182 </widget>
183 </item>
184 <item>
185 <widget class="QWidget" name="vsync_mode_layout" native="true">
186 <layout class="QHBoxLayout" name="horizontalLayout_4">
187 <property name="leftMargin">
188 <number>0</number>
189 </property>
190 <property name="topMargin">
191 <number>0</number>
192 </property>
193 <property name="rightMargin">
194 <number>0</number>
195 </property>
196 <property name="bottomMargin">
197 <number>0</number>
198 </property>
199 <item>
200 <widget class="QLabel" name="vsync_mode_label">
201 <property name="text">
202 <string>VSync Mode:</string>
203 </property>
204 </widget>
205 </item>
206 <item>
207 <widget class="QComboBox" name="vsync_mode_combobox">
208 <property name="toolTip">
209 <string>FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh rate.
210FIFO Relaxed is similar to FIFO but allows tearing as it recovers from a slow down.
211Mailbox can have lower latency than FIFO and does not tear but may drop frames.
212Immediate (no synchronization) just presents whatever is available and can exhibit tearing.</string>
213 </property>
214 <property name="currentText">
215 <string/>
216 </property>
217 </widget>
218 </item>
219 </layout>
220 </widget>
221 </item>
222 <item>
223 <widget class="QWidget" name="astc_decode_mode_layout" native="true">
224 <layout class="QHBoxLayout" name="horizontalLayout_8">
225 <property name="leftMargin">
226 <number>0</number>
227 </property>
228 <property name="topMargin">
229 <number>0</number>
230 </property>
231 <property name="rightMargin">
232 <number>0</number>
233 </property>
234 <property name="bottomMargin">
235 <number>0</number>
236 </property>
237 <item>
238 <widget class="QLabel" name="astc_decode_mode_label">
239 <property name="text">
240 <string>ASTC Texture Decoding Method:</string>
241 </property>
242 </widget>
243 </item>
244 <item>
245 <widget class="QComboBox" name="astc_decode_mode_combobox">
246 <item>
247 <property name="text">
248 <string>CPU</string>
249 </property>
250 </item>
251 <item>
252 <property name="text">
253 <string>GPU Compute</string>
254 </property>
255 </item>
256 <item>
257 <property name="text">
258 <string>CPU Asynchronous (Hack)</string>
259 </property>
260 </item>
261 </widget>
262 </item>
263 </layout>
264 </widget>
265 </item>
266 <item>
267 <widget class="QWidget" name="nvdec_emulation_widget" native="true">
268 <layout class="QHBoxLayout" name="nvdec_emulation_layout">
269 <property name="leftMargin">
270 <number>0</number>
271 </property>
272 <property name="topMargin">
273 <number>0</number>
274 </property>
275 <property name="rightMargin">
276 <number>0</number>
277 </property>
278 <property name="bottomMargin">
279 <number>0</number>
280 </property>
281 <item>
282 <widget class="QLabel" name="nvdec_emulation_label">
283 <property name="text">
284 <string>NVDEC emulation:</string>
285 </property>
286 </widget>
287 </item>
288 <item>
289 <widget class="QComboBox" name="nvdec_emulation">
290 <item>
291 <property name="text">
292 <string>No Video Output</string>
293 </property>
294 </item>
295 <item>
296 <property name="text">
297 <string>CPU Video Decoding</string>
298 </property>
299 </item>
300 <item>
301 <property name="text">
302 <string>GPU Video Decoding (Default)</string>
303 </property>
304 </item>
305 </widget>
306 </item>
307 </layout>
308 </widget>
309 </item>
310 <item>
311 <widget class="QWidget" name="fullscreen_mode_layout" native="true">
312 <layout class="QHBoxLayout" name="horizontalLayout_1">
313 <property name="leftMargin">
314 <number>0</number>
315 </property>
316 <property name="topMargin">
317 <number>0</number>
318 </property>
319 <property name="rightMargin">
320 <number>0</number>
321 </property>
322 <property name="bottomMargin">
323 <number>0</number>
324 </property>
325 <item>
326 <widget class="QLabel" name="fullscreen_mode_label">
327 <property name="text">
328 <string>Fullscreen Mode:</string>
329 </property>
330 </widget>
331 </item>
332 <item>
333 <widget class="QComboBox" name="fullscreen_mode_combobox">
334 <item>
335 <property name="text">
336 <string>Borderless Windowed</string>
337 </property>
338 </item>
339 <item>
340 <property name="text">
341 <string>Exclusive Fullscreen</string>
342 </property>
343 </item>
344 </widget>
345 </item>
346 </layout>
347 </widget>
348 </item>
349 <item>
350 <widget class="QWidget" name="aspect_ratio_layout" native="true">
351 <layout class="QHBoxLayout" name="horizontalLayout_2">
352 <property name="leftMargin">
353 <number>0</number>
354 </property>
355 <property name="topMargin">
356 <number>0</number>
357 </property>
358 <property name="rightMargin">
359 <number>0</number>
360 </property>
361 <property name="bottomMargin">
362 <number>0</number>
363 </property>
364 <item>
365 <widget class="QLabel" name="ar_label">
366 <property name="text">
367 <string>Aspect Ratio:</string>
368 </property>
369 </widget>
370 </item>
371 <item>
372 <widget class="QComboBox" name="aspect_ratio_combobox">
373 <item>
374 <property name="text">
375 <string>Default (16:9)</string>
376 </property>
377 </item>
378 <item>
379 <property name="text">
380 <string>Force 4:3</string>
381 </property>
382 </item>
383 <item>
384 <property name="text">
385 <string>Force 21:9</string>
386 </property>
387 </item>
388 <item>
389 <property name="text">
390 <string>Force 16:10</string>
391 </property>
392 </item>
393 <item>
394 <property name="text">
395 <string>Stretch to Window</string>
396 </property>
397 </item>
398 </widget>
399 </item>
400 </layout>
401 </widget>
402 </item>
403 <item>
404 <widget class="QWidget" name="resolution_layout" native="true">
405 <layout class="QHBoxLayout" name="horizontalLayout_5">
406 <property name="leftMargin">
407 <number>0</number>
408 </property>
409 <property name="topMargin">
410 <number>0</number>
411 </property>
412 <property name="rightMargin">
413 <number>0</number>
414 </property>
415 <property name="bottomMargin">
416 <number>0</number>
417 </property>
418 <item>
419 <widget class="QLabel" name="resolution_label">
420 <property name="text">
421 <string>Resolution:</string>
422 </property>
423 </widget>
424 </item>
425 <item>
426 <widget class="QComboBox" name="resolution_combobox">
427 <item>
428 <property name="text">
429 <string>0.5X (360p/540p) [EXPERIMENTAL]</string>
430 </property>
431 </item>
432 <item>
433 <property name="text">
434 <string>0.75X (540p/810p) [EXPERIMENTAL]</string>
435 </property>
436 </item>
437 <item>
438 <property name="text">
439 <string>1X (720p/1080p)</string>
440 </property>
441 </item>
442 <item>
443 <property name="text">
444 <string>1.5X (1080p/1620p) [EXPERIMENTAL]</string>
445 </property>
446 </item>
447 <item>
448 <property name="text">
449 <string>2X (1440p/2160p)</string>
450 </property>
451 </item>
452 <item>
453 <property name="text">
454 <string>3X (2160p/3240p)</string>
455 </property>
456 </item>
457 <item>
458 <property name="text">
459 <string>4X (2880p/4320p)</string>
460 </property>
461 </item>
462 <item>
463 <property name="text">
464 <string>5X (3600p/5400p)</string>
465 </property>
466 </item>
467 <item>
468 <property name="text">
469 <string>6X (4320p/6480p)</string>
470 </property>
471 </item>
472 <item>
473 <property name="text">
474 <string>7X (5040p/7560p)</string>
475 </property>
476 </item>
477 <item>
478 <property name="text">
479 <string>8X (5760p/8640p)</string>
480 </property>
481 </item>
482 </widget>
483 </item>
484 </layout>
485 </widget>
486 </item>
487 <item>
488 <widget class="QWidget" name="scaling_filter_layout" native="true">
489 <layout class="QHBoxLayout" name="horizontalLayout_6">
490 <property name="leftMargin">
491 <number>0</number>
492 </property>
493 <property name="topMargin">
494 <number>0</number>
495 </property>
496 <property name="rightMargin">
497 <number>0</number>
498 </property>
499 <property name="bottomMargin">
500 <number>0</number>
501 </property>
502 <item>
503 <widget class="QLabel" name="scaling_filter_label">
504 <property name="text">
505 <string>Window Adapting Filter:</string>
506 </property>
507 </widget>
508 </item>
509 <item>
510 <widget class="QComboBox" name="scaling_filter_combobox">
511 <item>
512 <property name="text">
513 <string>Nearest Neighbor</string>
514 </property>
515 </item>
516 <item>
517 <property name="text">
518 <string>Bilinear</string>
519 </property>
520 </item>
521 <item>
522 <property name="text">
523 <string>Bicubic</string>
524 </property>
525 </item>
526 <item>
527 <property name="text">
528 <string>Gaussian</string>
529 </property>
530 </item>
531 <item>
532 <property name="text">
533 <string>ScaleForce</string>
534 </property>
535 </item>
536 <item>
537 <property name="text">
538 <string>AMD FidelityFX™️ Super Resolution</string>
539 </property>
540 </item>
541 </widget>
542 </item>
543 </layout>
544 </widget>
545 </item>
546 <item>
547 <widget class="QWidget" name="anti_aliasing_layout" native="true">
548 <layout class="QHBoxLayout" name="horizontalLayout_7">
549 <property name="leftMargin">
550 <number>0</number>
551 </property>
552 <property name="topMargin">
553 <number>0</number>
554 </property>
555 <property name="rightMargin">
556 <number>0</number>
557 </property>
558 <property name="bottomMargin">
559 <number>0</number>
560 </property>
561 <item>
562 <widget class="QLabel" name="anti_aliasing_label">
563 <property name="text">
564 <string>Anti-Aliasing Method:</string>
565 </property>
566 </widget>
567 </item>
568 <item>
569 <widget class="QComboBox" name="anti_aliasing_combobox">
570 <item>
571 <property name="text">
572 <string>None</string>
573 </property>
574 </item>
575 <item>
576 <property name="text">
577 <string>FXAA</string>
578 </property>
579 </item>
580 <item>
581 <property name="text">
582 <string>SMAA</string>
583 </property>
584 </item>
585 </widget>
586 </item>
587 </layout>
588 </widget>
589 </item>
590 <item>
591 <widget class="QWidget" name="fsr_sharpening_layout" native="true">
592 <property name="enabled">
593 <bool>true</bool>
594 </property>
595 <property name="sizePolicy">
596 <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
597 <horstretch>0</horstretch>
598 <verstretch>0</verstretch>
599 </sizepolicy>
600 </property>
601 <layout class="QHBoxLayout" name="horizontalLayout">
602 <property name="spacing">
603 <number>6</number>
604 </property>
605 <property name="sizeConstraint">
606 <enum>QLayout::SetDefaultConstraint</enum>
607 </property>
608 <property name="leftMargin">
609 <number>0</number>
610 </property>
611 <property name="topMargin">
612 <number>0</number>
613 </property>
614 <property name="rightMargin">
615 <number>0</number>
616 </property>
617 <property name="bottomMargin">
618 <number>0</number>
619 </property>
620 <item>
621 <layout class="QHBoxLayout" name="fsr_sharpening_label_group">
622 <property name="rightMargin">
623 <number>0</number>
624 </property>
625 <property name="bottomMargin">
626 <number>0</number>
627 </property>
628 <item>
629 <widget class="QComboBox" name="fsr_sharpening_combobox">
630 <property name="sizePolicy">
631 <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
632 <horstretch>0</horstretch>
633 <verstretch>0</verstretch>
634 </sizepolicy>
635 </property>
636 <item>
637 <property name="text">
638 <string>Use global FSR Sharpness</string>
639 </property>
640 </item>
641 <item>
642 <property name="text">
643 <string>Set FSR Sharpness</string>
644 </property>
645 </item>
646 </widget>
647 </item>
648 <item>
649 <widget class="QLabel" name="fsr_sharpening_label">
650 <property name="sizePolicy">
651 <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
652 <horstretch>0</horstretch>
653 <verstretch>0</verstretch>
654 </sizepolicy>
655 </property>
656 <property name="text">
657 <string>FSR Sharpness:</string>
658 </property>
659 </widget>
660 </item>
661 <item>
662 <spacer name="horizontalSpacer_2">
663 <property name="orientation">
664 <enum>Qt::Horizontal</enum>
665 </property>
666 <property name="sizeHint" stdset="0">
667 <size>
668 <width>40</width>
669 <height>20</height>
670 </size>
671 </property>
672 </spacer>
673 </item>
674 </layout>
675 </item>
676 <item>
677 <layout class="QHBoxLayout" name="fsr_slider_layout">
678 <property name="spacing">
679 <number>6</number>
680 </property>
681 <item>
682 <widget class="QSlider" name="fsr_sharpening_slider">
683 <property name="sizePolicy">
684 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
685 <horstretch>0</horstretch>
686 <verstretch>0</verstretch>
687 </sizepolicy>
688 </property>
689 <property name="baseSize">
690 <size>
691 <width>0</width>
692 <height>0</height>
693 </size>
694 </property>
695 <property name="maximum">
696 <number>200</number>
697 </property>
698 <property name="sliderPosition">
699 <number>25</number>
700 </property>
701 <property name="orientation">
702 <enum>Qt::Horizontal</enum>
703 </property>
704 <property name="invertedAppearance">
705 <bool>true</bool>
706 </property>
707 </widget>
708 </item>
709 <item>
710 <widget class="QLabel" name="fsr_sharpening_value">
711 <property name="sizePolicy">
712 <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
713 <horstretch>0</horstretch>
714 <verstretch>0</verstretch>
715 </sizepolicy>
716 </property>
717 <property name="minimumSize">
718 <size>
719 <width>32</width>
720 <height>0</height>
721 </size>
722 </property>
723 <property name="text">
724 <string>100%</string>
725 </property>
726 <property name="alignment">
727 <set>Qt::AlignCenter</set>
728 </property>
729 </widget>
730 </item>
731 </layout>
732 </item>
733 </layout>
734 </widget>
735 </item>
736 <item>
737 <widget class="QWidget" name="bg_layout" native="true">
738 <property name="sizePolicy">
739 <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
740 <horstretch>0</horstretch>
741 <verstretch>0</verstretch>
742 </sizepolicy>
743 </property>
744 <layout class="QHBoxLayout" name="horizontalLayout_3">
745 <property name="spacing">
746 <number>6</number>
747 </property>
748 <property name="leftMargin">
749 <number>0</number>
750 </property>
751 <property name="topMargin">
752 <number>0</number>
753 </property>
754 <property name="rightMargin">
755 <number>0</number>
756 </property>
757 <property name="bottomMargin">
758 <number>0</number>
759 </property>
760 <item>
761 <widget class="QComboBox" name="bg_combobox">
762 <property name="currentText">
763 <string>Use global background color</string>
764 </property>
765 <property name="currentIndex">
766 <number>0</number>
767 </property>
768 <property name="maxVisibleItems">
769 <number>10</number>
770 </property>
771 <item>
772 <property name="text">
773 <string>Use global background color</string>
774 </property>
775 </item>
776 <item>
777 <property name="text">
778 <string>Set background color:</string>
779 </property>
780 </item>
781 </widget>
782 </item>
783 <item>
784 <widget class="QLabel" name="bg_label">
785 <property name="text">
786 <string>Background Color:</string>
787 </property>
788 </widget>
789 </item>
790 <item>
791 <spacer name="horizontalSpacer">
792 <property name="orientation">
793 <enum>Qt::Horizontal</enum>
794 </property>
795 <property name="sizeHint" stdset="0">
796 <size>
797 <width>40</width>
798 <height>20</height>
799 </size>
800 </property>
801 </spacer>
802 </item>
803 <item>
804 <widget class="QPushButton" name="bg_button">
805 <property name="maximumSize">
806 <size>
807 <width>40</width>
808 <height>16777215</height>
809 </size>
810 </property>
811 </widget>
812 </item>
813 </layout>
814 </widget> 67 </widget>
815 </item> 68 </item>
816 </layout> 69 </layout>
diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp
index 7d79044d4..8a9495109 100644
--- a/src/yuzu/configuration/configure_graphics_advanced.cpp
+++ b/src/yuzu/configuration/configure_graphics_advanced.cpp
@@ -32,8 +32,8 @@ void ConfigureGraphicsAdvanced::SetConfiguration() {
32 32
33 for (auto setting : 33 for (auto setting :
34 Settings::values.linkage.by_category[Settings::Category::RendererAdvanced]) { 34 Settings::values.linkage.by_category[Settings::Category::RendererAdvanced]) {
35 QWidget* widget = ConfigurationShared::CreateWidget(setting, translations, this, 35 auto [widget, extra] = ConfigurationShared::CreateWidget(
36 runtime_lock, apply_funcs, trackers); 36 setting, translations, this, runtime_lock, apply_funcs, trackers);
37 37
38 if (widget == nullptr) { 38 if (widget == nullptr) {
39 continue; 39 continue;
diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp
index 339768017..9e229977d 100644
--- a/src/yuzu/configuration/configure_per_game.cpp
+++ b/src/yuzu/configuration/configure_per_game.cpp
@@ -58,7 +58,7 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st
58 std::make_unique<ConfigureGraphicsAdvanced>(system_, tab_group, *translations, this); 58 std::make_unique<ConfigureGraphicsAdvanced>(system_, tab_group, *translations, this);
59 graphics_tab = std::make_unique<ConfigureGraphics>( 59 graphics_tab = std::make_unique<ConfigureGraphics>(
60 system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, 60 system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); },
61 tab_group, this); 61 tab_group, *translations, this);
62 input_tab = std::make_unique<ConfigureInputPerGame>(system_, game_config.get(), this); 62 input_tab = std::make_unique<ConfigureInputPerGame>(system_, game_config.get(), this);
63 system_tab = std::make_unique<ConfigureSystem>(system_, tab_group, this); 63 system_tab = std::make_unique<ConfigureSystem>(system_, tab_group, this);
64 64
diff --git a/src/yuzu/configuration/shared_translation.cpp b/src/yuzu/configuration/shared_translation.cpp
index ddc7569f1..73c3086ae 100644
--- a/src/yuzu/configuration/shared_translation.cpp
+++ b/src/yuzu/configuration/shared_translation.cpp
@@ -36,6 +36,7 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QWidget* parent) {
36 36
37 // Cpu 37 // Cpu
38 INSERT("cpu_accuracy", "Accuracy:", ""); 38 INSERT("cpu_accuracy", "Accuracy:", "");
39 INSERT("cpu_accuracy_first_time", "", "");
39 40
40 // Cpu Debug 41 // Cpu Debug
41 INSERT("cpu_debug_mode", "Enable CPU Debugging", ""); 42 INSERT("cpu_debug_mode", "Enable CPU Debugging", "");
@@ -75,13 +76,16 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QWidget* parent) {
75 INSERT("use_disk_shader_cache", "Use disk pipeline cache", ""); 76 INSERT("use_disk_shader_cache", "Use disk pipeline cache", "");
76 INSERT("use_asynchronous_gpu_emulation", "Use asynchronous GPU emulation", ""); 77 INSERT("use_asynchronous_gpu_emulation", "Use asynchronous GPU emulation", "");
77 INSERT("nvdec_emulation", "NVDEC emulation:", ""); 78 INSERT("nvdec_emulation", "NVDEC emulation:", "");
78 INSERT("acclerate_astc", "ASTC Decoding Method:", ""); 79 INSERT("accelerate_astc", "ASTC Decoding Method:", "");
79 INSERT( 80 INSERT(
80 "use_vsync", "VSync Mode:", 81 "use_vsync", "VSync Mode:",
81 "FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh " 82 "FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen refresh "
82 "rate. FIFO Relaxed is similar to FIFO but allows tearing as it recovers from a slow down. " 83 "rate. FIFO Relaxed is similar to FIFO but allows tearing as it recovers from a slow down. "
83 "Mailbox can have lower latency than FIFO and does not tear but may drop frames. Immediate " 84 "Mailbox can have lower latency than FIFO and does not tear but may drop frames. Immediate "
84 "(no synchronization) just presents whatever is available and can exhibit tearing."); 85 "(no synchronization) just presents whatever is available and can exhibit tearing.");
86 INSERT("bg_red", "", "");
87 INSERT("bg_green", "", "");
88 INSERT("bg_blue", "", "");
85 89
86 // Renderer (Advanced Graphics) 90 // Renderer (Advanced Graphics)
87 INSERT("async_presentation", "Enable asynchronous presentation (Vulkan only)", ""); 91 INSERT("async_presentation", "Enable asynchronous presentation (Vulkan only)", "");
@@ -104,9 +108,6 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QWidget* parent) {
104 "Enable compute pipelines, required by some games.\nThis setting only exists for Intel " 108 "Enable compute pipelines, required by some games.\nThis setting only exists for Intel "
105 "proprietary drivers, and may crash if enabled.\nCompute pipelines are always enabled " 109 "proprietary drivers, and may crash if enabled.\nCompute pipelines are always enabled "
106 "on all other drivers."); 110 "on all other drivers.");
107 INSERT("bg_red", "Background Color:", "");
108 INSERT("bg_green", "Background Color:", "");
109 INSERT("bg_blue", "Background Color:", "");
110 111
111 // Renderer (Debug) 112 // Renderer (Debug)
112 INSERT("debug", "Enable Graphics Debugging", 113 INSERT("debug", "Enable Graphics Debugging",