summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/settings.cpp4
-rw-r--r--src/common/settings.h8
-rw-r--r--src/core/telemetry_session.cpp4
-rw-r--r--src/video_core/renderer_opengl/gl_device.cpp10
-rw-r--r--src/yuzu/configuration/config.cpp7
-rw-r--r--src/yuzu/configuration/config.h3
-rw-r--r--src/yuzu/configuration/configure_graphics.cpp76
-rw-r--r--src/yuzu/configuration/configure_graphics.h4
-rw-r--r--src/yuzu/configuration/configure_graphics.ui118
-rw-r--r--src/yuzu/configuration/configure_graphics_advanced.cpp7
-rw-r--r--src/yuzu/configuration/configure_graphics_advanced.h1
-rw-r--r--src/yuzu/configuration/configure_graphics_advanced.ui18
-rw-r--r--src/yuzu_cmd/config.cpp2
-rw-r--r--src/yuzu_cmd/default_ini.h7
14 files changed, 182 insertions, 87 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp
index bf5514386..66268ea0f 100644
--- a/src/common/settings.cpp
+++ b/src/common/settings.cpp
@@ -57,7 +57,7 @@ void LogSettings() {
57 log_setting("Renderer_UseNvdecEmulation", values.use_nvdec_emulation.GetValue()); 57 log_setting("Renderer_UseNvdecEmulation", values.use_nvdec_emulation.GetValue());
58 log_setting("Renderer_AccelerateASTC", values.accelerate_astc.GetValue()); 58 log_setting("Renderer_AccelerateASTC", values.accelerate_astc.GetValue());
59 log_setting("Renderer_UseVsync", values.use_vsync.GetValue()); 59 log_setting("Renderer_UseVsync", values.use_vsync.GetValue());
60 log_setting("Renderer_UseAssemblyShaders", values.use_assembly_shaders.GetValue()); 60 log_setting("Renderer_ShaderBackend", values.shader_backend.GetValue());
61 log_setting("Renderer_UseAsynchronousShaders", values.use_asynchronous_shaders.GetValue()); 61 log_setting("Renderer_UseAsynchronousShaders", values.use_asynchronous_shaders.GetValue());
62 log_setting("Renderer_UseGarbageCollection", values.use_caches_gc.GetValue()); 62 log_setting("Renderer_UseGarbageCollection", values.use_caches_gc.GetValue());
63 log_setting("Renderer_AnisotropicFilteringLevel", values.max_anisotropy.GetValue()); 63 log_setting("Renderer_AnisotropicFilteringLevel", values.max_anisotropy.GetValue());
@@ -140,7 +140,7 @@ void RestoreGlobalState(bool is_powered_on) {
140 values.use_nvdec_emulation.SetGlobal(true); 140 values.use_nvdec_emulation.SetGlobal(true);
141 values.accelerate_astc.SetGlobal(true); 141 values.accelerate_astc.SetGlobal(true);
142 values.use_vsync.SetGlobal(true); 142 values.use_vsync.SetGlobal(true);
143 values.use_assembly_shaders.SetGlobal(true); 143 values.shader_backend.SetGlobal(true);
144 values.use_asynchronous_shaders.SetGlobal(true); 144 values.use_asynchronous_shaders.SetGlobal(true);
145 values.use_fast_gpu_time.SetGlobal(true); 145 values.use_fast_gpu_time.SetGlobal(true);
146 values.use_caches_gc.SetGlobal(true); 146 values.use_caches_gc.SetGlobal(true);
diff --git a/src/common/settings.h b/src/common/settings.h
index ac0590690..32dfb1d9f 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -24,6 +24,12 @@ enum class RendererBackend : u32 {
24 Vulkan = 1, 24 Vulkan = 1,
25}; 25};
26 26
27enum class ShaderBackend : u32 {
28 GLSL = 0,
29 GLASM = 1,
30 SPIRV = 2,
31};
32
27enum class GPUAccuracy : u32 { 33enum class GPUAccuracy : u32 {
28 Normal = 0, 34 Normal = 0,
29 High = 1, 35 High = 1,
@@ -334,7 +340,7 @@ struct Values {
334 Setting<bool> accelerate_astc{true, "accelerate_astc"}; 340 Setting<bool> accelerate_astc{true, "accelerate_astc"};
335 Setting<bool> use_vsync{true, "use_vsync"}; 341 Setting<bool> use_vsync{true, "use_vsync"};
336 BasicSetting<bool> disable_fps_limit{false, "disable_fps_limit"}; 342 BasicSetting<bool> disable_fps_limit{false, "disable_fps_limit"};
337 Setting<bool> use_assembly_shaders{false, "use_assembly_shaders"}; 343 Setting<ShaderBackend> shader_backend{ShaderBackend::GLASM, "shader_backend"};
338 Setting<bool> use_asynchronous_shaders{false, "use_asynchronous_shaders"}; 344 Setting<bool> use_asynchronous_shaders{false, "use_asynchronous_shaders"};
339 Setting<bool> use_fast_gpu_time{true, "use_fast_gpu_time"}; 345 Setting<bool> use_fast_gpu_time{true, "use_fast_gpu_time"};
340 Setting<bool> use_caches_gc{false, "use_caches_gc"}; 346 Setting<bool> use_caches_gc{false, "use_caches_gc"};
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp
index 066cb23e4..422de3a7d 100644
--- a/src/core/telemetry_session.cpp
+++ b/src/core/telemetry_session.cpp
@@ -233,8 +233,8 @@ void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader,
233 Settings::values.use_nvdec_emulation.GetValue()); 233 Settings::values.use_nvdec_emulation.GetValue());
234 AddField(field_type, "Renderer_AccelerateASTC", Settings::values.accelerate_astc.GetValue()); 234 AddField(field_type, "Renderer_AccelerateASTC", Settings::values.accelerate_astc.GetValue());
235 AddField(field_type, "Renderer_UseVsync", Settings::values.use_vsync.GetValue()); 235 AddField(field_type, "Renderer_UseVsync", Settings::values.use_vsync.GetValue());
236 AddField(field_type, "Renderer_UseAssemblyShaders", 236 AddField(field_type, "Renderer_ShaderBackend",
237 Settings::values.use_assembly_shaders.GetValue()); 237 static_cast<u32>(Settings::values.shader_backend.GetValue()));
238 AddField(field_type, "Renderer_UseAsynchronousShaders", 238 AddField(field_type, "Renderer_UseAsynchronousShaders",
239 Settings::values.use_asynchronous_shaders.GetValue()); 239 Settings::values.use_asynchronous_shaders.GetValue());
240 AddField(field_type, "System_UseDockedMode", Settings::values.use_docked_mode.GetValue()); 240 AddField(field_type, "System_UseDockedMode", Settings::values.use_docked_mode.GetValue());
diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp
index 6818951f2..c4eeed53b 100644
--- a/src/video_core/renderer_opengl/gl_device.cpp
+++ b/src/video_core/renderer_opengl/gl_device.cpp
@@ -172,9 +172,10 @@ Device::Device() {
172 // uniform buffers as "push constants" 172 // uniform buffers as "push constants"
173 has_fast_buffer_sub_data = is_nvidia && !disable_fast_buffer_sub_data; 173 has_fast_buffer_sub_data = is_nvidia && !disable_fast_buffer_sub_data;
174 174
175 use_assembly_shaders = Settings::values.use_assembly_shaders.GetValue() && 175 use_assembly_shaders =
176 GLAD_GL_NV_gpu_program5 && GLAD_GL_NV_compute_program5 && 176 Settings::values.shader_backend.GetValue() == Settings::ShaderBackend::GLASM &&
177 GLAD_GL_NV_transform_feedback && GLAD_GL_NV_transform_feedback2; 177 GLAD_GL_NV_gpu_program5 && GLAD_GL_NV_compute_program5 && GLAD_GL_NV_transform_feedback &&
178 GLAD_GL_NV_transform_feedback2;
178 179
179 // Blocks AMD and Intel OpenGL drivers on Windows from using asynchronous shader compilation. 180 // Blocks AMD and Intel OpenGL drivers on Windows from using asynchronous shader compilation.
180 use_asynchronous_shaders = Settings::values.use_asynchronous_shaders.GetValue() && 181 use_asynchronous_shaders = Settings::values.use_asynchronous_shaders.GetValue() &&
@@ -187,7 +188,8 @@ Device::Device() {
187 LOG_INFO(Render_OpenGL, "Renderer_BrokenTextureViewFormats: {}", 188 LOG_INFO(Render_OpenGL, "Renderer_BrokenTextureViewFormats: {}",
188 has_broken_texture_view_formats); 189 has_broken_texture_view_formats);
189 190
190 if (Settings::values.use_assembly_shaders.GetValue() && !use_assembly_shaders) { 191 if (Settings::values.shader_backend.GetValue() == Settings::ShaderBackend::GLASM &&
192 !use_assembly_shaders) {
191 LOG_ERROR(Render_OpenGL, "Assembly shaders enabled but not supported"); 193 LOG_ERROR(Render_OpenGL, "Assembly shaders enabled but not supported");
192 } 194 }
193 195
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index dc69574a9..52b3ed02e 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -814,7 +814,7 @@ void Config::ReadRendererValues() {
814 ReadGlobalSetting(Settings::values.use_nvdec_emulation); 814 ReadGlobalSetting(Settings::values.use_nvdec_emulation);
815 ReadGlobalSetting(Settings::values.accelerate_astc); 815 ReadGlobalSetting(Settings::values.accelerate_astc);
816 ReadGlobalSetting(Settings::values.use_vsync); 816 ReadGlobalSetting(Settings::values.use_vsync);
817 ReadGlobalSetting(Settings::values.use_assembly_shaders); 817 ReadGlobalSetting(Settings::values.shader_backend);
818 ReadGlobalSetting(Settings::values.use_asynchronous_shaders); 818 ReadGlobalSetting(Settings::values.use_asynchronous_shaders);
819 ReadGlobalSetting(Settings::values.use_fast_gpu_time); 819 ReadGlobalSetting(Settings::values.use_fast_gpu_time);
820 ReadGlobalSetting(Settings::values.use_caches_gc); 820 ReadGlobalSetting(Settings::values.use_caches_gc);
@@ -1345,7 +1345,10 @@ void Config::SaveRendererValues() {
1345 WriteGlobalSetting(Settings::values.use_nvdec_emulation); 1345 WriteGlobalSetting(Settings::values.use_nvdec_emulation);
1346 WriteGlobalSetting(Settings::values.accelerate_astc); 1346 WriteGlobalSetting(Settings::values.accelerate_astc);
1347 WriteGlobalSetting(Settings::values.use_vsync); 1347 WriteGlobalSetting(Settings::values.use_vsync);
1348 WriteGlobalSetting(Settings::values.use_assembly_shaders); 1348 WriteSetting(QString::fromStdString(Settings::values.shader_backend.GetLabel()),
1349 static_cast<u32>(Settings::values.shader_backend.GetValue(global)),
1350 static_cast<u32>(Settings::values.shader_backend.GetDefault()),
1351 Settings::values.shader_backend.UsingGlobal());
1349 WriteGlobalSetting(Settings::values.use_asynchronous_shaders); 1352 WriteGlobalSetting(Settings::values.use_asynchronous_shaders);
1350 WriteGlobalSetting(Settings::values.use_fast_gpu_time); 1353 WriteGlobalSetting(Settings::values.use_fast_gpu_time);
1351 WriteGlobalSetting(Settings::values.use_caches_gc); 1354 WriteGlobalSetting(Settings::values.use_caches_gc);
diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h
index 96f9b6de1..4bbb9f1cd 100644
--- a/src/yuzu/configuration/config.h
+++ b/src/yuzu/configuration/config.h
@@ -180,5 +180,6 @@ private:
180 180
181// These metatype declarations cannot be in common/settings.h because core is devoid of QT 181// These metatype declarations cannot be in common/settings.h because core is devoid of QT
182Q_DECLARE_METATYPE(Settings::CPUAccuracy); 182Q_DECLARE_METATYPE(Settings::CPUAccuracy);
183Q_DECLARE_METATYPE(Settings::RendererBackend);
184Q_DECLARE_METATYPE(Settings::GPUAccuracy); 183Q_DECLARE_METATYPE(Settings::GPUAccuracy);
184Q_DECLARE_METATYPE(Settings::RendererBackend);
185Q_DECLARE_METATYPE(Settings::ShaderBackend);
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp
index 4d5b4c0e6..463448dbf 100644
--- a/src/yuzu/configuration/configure_graphics.cpp
+++ b/src/yuzu/configuration/configure_graphics.cpp
@@ -26,19 +26,25 @@ ConfigureGraphics::ConfigureGraphics(QWidget* parent)
26 26
27 ui->setupUi(this); 27 ui->setupUi(this);
28 28
29 ui->backend->addItem(QStringLiteral("GLSL"));
30 ui->backend->addItem(tr("GLASM (NVIDIA Only)"));
31 ui->backend->addItem(QStringLiteral("SPIR-V"));
32
29 SetupPerGameUI(); 33 SetupPerGameUI();
30 34
31 SetConfiguration(); 35 SetConfiguration();
32 36
33 connect(ui->api, qOverload<int>(&QComboBox::currentIndexChanged), this, [this] { 37 connect(ui->api, qOverload<int>(&QComboBox::currentIndexChanged), this, [this] {
34 UpdateDeviceComboBox(); 38 UpdateAPILayout();
35 if (!Settings::IsConfiguringGlobal()) { 39 if (!Settings::IsConfiguringGlobal()) {
36 ConfigurationShared::SetHighlight( 40 ConfigurationShared::SetHighlight(
37 ui->api_layout, ui->api->currentIndex() != ConfigurationShared::USE_GLOBAL_INDEX); 41 ui->api_widget, ui->api->currentIndex() != ConfigurationShared::USE_GLOBAL_INDEX);
38 } 42 }
39 }); 43 });
40 connect(ui->device, qOverload<int>(&QComboBox::activated), this, 44 connect(ui->device, qOverload<int>(&QComboBox::activated), this,
41 [this](int device) { UpdateDeviceSelection(device); }); 45 [this](int device) { UpdateDeviceSelection(device); });
46 connect(ui->backend, qOverload<int>(&QComboBox::activated), this,
47 [this](int backend) { UpdateShaderBackendSelection(backend); });
42 48
43 connect(ui->bg_button, &QPushButton::clicked, this, [this] { 49 connect(ui->bg_button, &QPushButton::clicked, this, [this] {
44 const QColor new_bg_color = QColorDialog::getColor(bg_color); 50 const QColor new_bg_color = QColorDialog::getColor(bg_color);
@@ -48,6 +54,10 @@ ConfigureGraphics::ConfigureGraphics(QWidget* parent)
48 UpdateBackgroundColorButton(new_bg_color); 54 UpdateBackgroundColorButton(new_bg_color);
49 }); 55 });
50 56
57 for (const auto& device : vulkan_devices) {
58 ui->device->addItem(device);
59 }
60
51 ui->bg_label->setVisible(Settings::IsConfiguringGlobal()); 61 ui->bg_label->setVisible(Settings::IsConfiguringGlobal());
52 ui->bg_combobox->setVisible(!Settings::IsConfiguringGlobal()); 62 ui->bg_combobox->setVisible(!Settings::IsConfiguringGlobal());
53} 63}
@@ -61,12 +71,21 @@ void ConfigureGraphics::UpdateDeviceSelection(int device) {
61 } 71 }
62} 72}
63 73
74void ConfigureGraphics::UpdateShaderBackendSelection(int backend) {
75 if (backend == -1) {
76 return;
77 }
78 if (GetCurrentGraphicsBackend() == Settings::RendererBackend::OpenGL) {
79 shader_backend = static_cast<Settings::ShaderBackend>(backend);
80 }
81}
82
64ConfigureGraphics::~ConfigureGraphics() = default; 83ConfigureGraphics::~ConfigureGraphics() = default;
65 84
66void ConfigureGraphics::SetConfiguration() { 85void ConfigureGraphics::SetConfiguration() {
67 const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn(); 86 const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn();
68 87
69 ui->api->setEnabled(runtime_lock); 88 ui->api_widget->setEnabled(runtime_lock);
70 ui->use_asynchronous_gpu_emulation->setEnabled(runtime_lock); 89 ui->use_asynchronous_gpu_emulation->setEnabled(runtime_lock);
71 ui->use_disk_shader_cache->setEnabled(runtime_lock); 90 ui->use_disk_shader_cache->setEnabled(runtime_lock);
72 ui->use_nvdec_emulation->setEnabled(runtime_lock); 91 ui->use_nvdec_emulation->setEnabled(runtime_lock);
@@ -83,7 +102,7 @@ void ConfigureGraphics::SetConfiguration() {
83 ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio.GetValue()); 102 ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio.GetValue());
84 } else { 103 } else {
85 ConfigurationShared::SetPerGameSetting(ui->api, &Settings::values.renderer_backend); 104 ConfigurationShared::SetPerGameSetting(ui->api, &Settings::values.renderer_backend);
86 ConfigurationShared::SetHighlight(ui->api_layout, 105 ConfigurationShared::SetHighlight(ui->api_widget,
87 !Settings::values.renderer_backend.UsingGlobal()); 106 !Settings::values.renderer_backend.UsingGlobal());
88 107
89 ConfigurationShared::SetPerGameSetting(ui->fullscreen_mode_combobox, 108 ConfigurationShared::SetPerGameSetting(ui->fullscreen_mode_combobox,
@@ -100,11 +119,10 @@ void ConfigureGraphics::SetConfiguration() {
100 ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal()); 119 ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal());
101 ConfigurationShared::SetHighlight(ui->bg_layout, !Settings::values.bg_red.UsingGlobal()); 120 ConfigurationShared::SetHighlight(ui->bg_layout, !Settings::values.bg_red.UsingGlobal());
102 } 121 }
103
104 UpdateBackgroundColorButton(QColor::fromRgb(Settings::values.bg_red.GetValue(), 122 UpdateBackgroundColorButton(QColor::fromRgb(Settings::values.bg_red.GetValue(),
105 Settings::values.bg_green.GetValue(), 123 Settings::values.bg_green.GetValue(),
106 Settings::values.bg_blue.GetValue())); 124 Settings::values.bg_blue.GetValue()));
107 UpdateDeviceComboBox(); 125 UpdateAPILayout();
108} 126}
109 127
110void ConfigureGraphics::ApplyConfiguration() { 128void ConfigureGraphics::ApplyConfiguration() {
@@ -128,6 +146,9 @@ void ConfigureGraphics::ApplyConfiguration() {
128 if (Settings::values.renderer_backend.UsingGlobal()) { 146 if (Settings::values.renderer_backend.UsingGlobal()) {
129 Settings::values.renderer_backend.SetValue(GetCurrentGraphicsBackend()); 147 Settings::values.renderer_backend.SetValue(GetCurrentGraphicsBackend());
130 } 148 }
149 if (Settings::values.shader_backend.UsingGlobal()) {
150 Settings::values.shader_backend.SetValue(shader_backend);
151 }
131 if (Settings::values.vulkan_device.UsingGlobal()) { 152 if (Settings::values.vulkan_device.UsingGlobal()) {
132 Settings::values.vulkan_device.SetValue(vulkan_device); 153 Settings::values.vulkan_device.SetValue(vulkan_device);
133 } 154 }
@@ -139,15 +160,22 @@ void ConfigureGraphics::ApplyConfiguration() {
139 } else { 160 } else {
140 if (ui->api->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { 161 if (ui->api->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) {
141 Settings::values.renderer_backend.SetGlobal(true); 162 Settings::values.renderer_backend.SetGlobal(true);
163 Settings::values.shader_backend.SetGlobal(true);
142 Settings::values.vulkan_device.SetGlobal(true); 164 Settings::values.vulkan_device.SetGlobal(true);
143 } else { 165 } else {
144 Settings::values.renderer_backend.SetGlobal(false); 166 Settings::values.renderer_backend.SetGlobal(false);
145 Settings::values.renderer_backend.SetValue(GetCurrentGraphicsBackend()); 167 Settings::values.renderer_backend.SetValue(GetCurrentGraphicsBackend());
146 if (GetCurrentGraphicsBackend() == Settings::RendererBackend::Vulkan) { 168 switch (GetCurrentGraphicsBackend()) {
169 case Settings::RendererBackend::OpenGL:
170 Settings::values.shader_backend.SetGlobal(false);
171 Settings::values.vulkan_device.SetGlobal(true);
172 Settings::values.shader_backend.SetValue(shader_backend);
173 break;
174 case Settings::RendererBackend::Vulkan:
175 Settings::values.shader_backend.SetGlobal(true);
147 Settings::values.vulkan_device.SetGlobal(false); 176 Settings::values.vulkan_device.SetGlobal(false);
148 Settings::values.vulkan_device.SetValue(vulkan_device); 177 Settings::values.vulkan_device.SetValue(vulkan_device);
149 } else { 178 break;
150 Settings::values.vulkan_device.SetGlobal(true);
151 } 179 }
152 } 180 }
153 181
@@ -188,32 +216,32 @@ void ConfigureGraphics::UpdateBackgroundColorButton(QColor color) {
188 ui->bg_button->setIcon(color_icon); 216 ui->bg_button->setIcon(color_icon);
189} 217}
190 218
191void ConfigureGraphics::UpdateDeviceComboBox() { 219void ConfigureGraphics::UpdateAPILayout() {
192 ui->device->clear();
193
194 bool enabled = false;
195
196 if (!Settings::IsConfiguringGlobal() && 220 if (!Settings::IsConfiguringGlobal() &&
197 ui->api->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { 221 ui->api->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) {
222 vulkan_device = Settings::values.vulkan_device.GetValue(true);
223 shader_backend = Settings::values.shader_backend.GetValue(true);
224 ui->device_widget->setEnabled(false);
225 ui->backend_widget->setEnabled(false);
226 } else {
198 vulkan_device = Settings::values.vulkan_device.GetValue(); 227 vulkan_device = Settings::values.vulkan_device.GetValue();
228 shader_backend = Settings::values.shader_backend.GetValue();
229 ui->device_widget->setEnabled(true);
230 ui->backend_widget->setEnabled(true);
199 } 231 }
232
200 switch (GetCurrentGraphicsBackend()) { 233 switch (GetCurrentGraphicsBackend()) {
201 case Settings::RendererBackend::OpenGL: 234 case Settings::RendererBackend::OpenGL:
202 ui->device->addItem(tr("OpenGL Graphics Device")); 235 ui->backend->setCurrentIndex(static_cast<u32>(shader_backend));
203 enabled = false; 236 ui->device_widget->setVisible(false);
237 ui->backend_widget->setVisible(true);
204 break; 238 break;
205 case Settings::RendererBackend::Vulkan: 239 case Settings::RendererBackend::Vulkan:
206 for (const auto& device : vulkan_devices) {
207 ui->device->addItem(device);
208 }
209 ui->device->setCurrentIndex(vulkan_device); 240 ui->device->setCurrentIndex(vulkan_device);
210 enabled = !vulkan_devices.empty(); 241 ui->device_widget->setVisible(true);
242 ui->backend_widget->setVisible(false);
211 break; 243 break;
212 } 244 }
213 // If in per-game config and use global is selected, don't enable.
214 enabled &= !(!Settings::IsConfiguringGlobal() &&
215 ui->api->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX);
216 ui->device->setEnabled(enabled && !Core::System::GetInstance().IsPoweredOn());
217} 245}
218 246
219void ConfigureGraphics::RetrieveVulkanDevices() try { 247void ConfigureGraphics::RetrieveVulkanDevices() try {
diff --git a/src/yuzu/configuration/configure_graphics.h b/src/yuzu/configuration/configure_graphics.h
index 6418115cf..c866b911b 100644
--- a/src/yuzu/configuration/configure_graphics.h
+++ b/src/yuzu/configuration/configure_graphics.h
@@ -34,8 +34,9 @@ private:
34 void SetConfiguration(); 34 void SetConfiguration();
35 35
36 void UpdateBackgroundColorButton(QColor color); 36 void UpdateBackgroundColorButton(QColor color);
37 void UpdateDeviceComboBox(); 37 void UpdateAPILayout();
38 void UpdateDeviceSelection(int device); 38 void UpdateDeviceSelection(int device);
39 void UpdateShaderBackendSelection(int backend);
39 40
40 void RetrieveVulkanDevices(); 41 void RetrieveVulkanDevices();
41 42
@@ -53,4 +54,5 @@ private:
53 54
54 std::vector<QString> vulkan_devices; 55 std::vector<QString> vulkan_devices;
55 u32 vulkan_device{}; 56 u32 vulkan_device{};
57 Settings::ShaderBackend shader_backend{};
56}; 58};
diff --git a/src/yuzu/configuration/configure_graphics.ui b/src/yuzu/configuration/configure_graphics.ui
index 5b999d84d..099ddbb7c 100644
--- a/src/yuzu/configuration/configure_graphics.ui
+++ b/src/yuzu/configuration/configure_graphics.ui
@@ -23,7 +23,7 @@
23 </property> 23 </property>
24 <layout class="QVBoxLayout" name="verticalLayout_3"> 24 <layout class="QVBoxLayout" name="verticalLayout_3">
25 <item> 25 <item>
26 <widget class="QWidget" name="api_layout" native="true"> 26 <widget class="QWidget" name="api_widget" native="true">
27 <layout class="QGridLayout" name="gridLayout"> 27 <layout class="QGridLayout" name="gridLayout">
28 <property name="leftMargin"> 28 <property name="leftMargin">
29 <number>0</number> 29 <number>0</number>
@@ -40,37 +40,107 @@
40 <property name="horizontalSpacing"> 40 <property name="horizontalSpacing">
41 <number>6</number> 41 <number>6</number>
42 </property> 42 </property>
43 <item row="0" column="0"> 43 <item row="4" column="0">
44 <widget class="QLabel" name="api_label"> 44 <widget class="QWidget" name="backend_widget" native="true">
45 <property name="text"> 45 <layout class="QHBoxLayout" name="backend_layout">
46 <string>API:</string> 46 <property name="leftMargin">
47 </property> 47 <number>0</number>
48 </property>
49 <property name="topMargin">
50 <number>0</number>
51 </property>
52 <property name="rightMargin">
53 <number>0</number>
54 </property>
55 <property name="bottomMargin">
56 <number>0</number>
57 </property>
58 <item>
59 <widget class="QLabel" name="backend_label">
60 <property name="text">
61 <string>Shader Backend:</string>
62 </property>
63 </widget>
64 </item>
65 <item>
66 <widget class="QComboBox" name="backend"/>
67 </item>
68 </layout>
48 </widget> 69 </widget>
49 </item> 70 </item>
50 <item row="0" column="1"> 71 <item row="2" column="0">
51 <widget class="QComboBox" name="api"> 72 <widget class="QWidget" name="device_widget" native="true">
52 <item> 73 <layout class="QHBoxLayout" name="device_layout">
53 <property name="text"> 74 <property name="leftMargin">
54 <string notr="true">OpenGL</string> 75 <number>0</number>
55 </property> 76 </property>
56 </item> 77 <property name="topMargin">
57 <item> 78 <number>0</number>
58 <property name="text">
59 <string notr="true">Vulkan</string>
60 </property> 79 </property>
61 </item> 80 <property name="rightMargin">
81 <number>0</number>
82 </property>
83 <property name="bottomMargin">
84 <number>0</number>
85 </property>
86 <item>
87 <widget class="QLabel" name="device_label">
88 <property name="text">
89 <string>Device:</string>
90 </property>
91 </widget>
92 </item>
93 <item>
94 <widget class="QComboBox" name="device"/>
95 </item>
96 </layout>
62 </widget> 97 </widget>
63 </item> 98 </item>
64 <item row="1" column="0"> 99 <item row="0" column="0">
65 <widget class="QLabel" name="device_label"> 100 <widget class="QWidget" name="api_layout_2" native="true">
66 <property name="text"> 101 <layout class="QHBoxLayout" name="api_layout">
67 <string>Device:</string> 102 <property name="leftMargin">
68 </property> 103 <number>0</number>
104 </property>
105 <property name="topMargin">
106 <number>0</number>
107 </property>
108 <property name="rightMargin">
109 <number>0</number>
110 </property>
111 <property name="bottomMargin">
112 <number>0</number>
113 </property>
114 <item>
115 <widget class="QLabel" name="api_label">
116 <property name="text">
117 <string>API:</string>
118 </property>
119 </widget>
120 </item>
121 <item>
122 <widget class="QComboBox" name="api">
123 <property name="sizePolicy">
124 <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
125 <horstretch>0</horstretch>
126 <verstretch>0</verstretch>
127 </sizepolicy>
128 </property>
129 <item>
130 <property name="text">
131 <string notr="true">OpenGL</string>
132 </property>
133 </item>
134 <item>
135 <property name="text">
136 <string notr="true">Vulkan</string>
137 </property>
138 </item>
139 </widget>
140 </item>
141 </layout>
69 </widget> 142 </widget>
70 </item> 143 </item>
71 <item row="1" column="1">
72 <widget class="QComboBox" name="device"/>
73 </item>
74 </layout> 144 </layout>
75 </widget> 145 </widget>
76 </item> 146 </item>
diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp
index a9e611125..38276feb1 100644
--- a/src/yuzu/configuration/configure_graphics_advanced.cpp
+++ b/src/yuzu/configuration/configure_graphics_advanced.cpp
@@ -23,12 +23,10 @@ ConfigureGraphicsAdvanced::~ConfigureGraphicsAdvanced() = default;
23void ConfigureGraphicsAdvanced::SetConfiguration() { 23void ConfigureGraphicsAdvanced::SetConfiguration() {
24 const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn(); 24 const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn();
25 ui->use_vsync->setEnabled(runtime_lock); 25 ui->use_vsync->setEnabled(runtime_lock);
26 ui->use_assembly_shaders->setEnabled(runtime_lock);
27 ui->use_asynchronous_shaders->setEnabled(runtime_lock); 26 ui->use_asynchronous_shaders->setEnabled(runtime_lock);
28 ui->anisotropic_filtering_combobox->setEnabled(runtime_lock); 27 ui->anisotropic_filtering_combobox->setEnabled(runtime_lock);
29 28
30 ui->use_vsync->setChecked(Settings::values.use_vsync.GetValue()); 29 ui->use_vsync->setChecked(Settings::values.use_vsync.GetValue());
31 ui->use_assembly_shaders->setChecked(Settings::values.use_assembly_shaders.GetValue());
32 ui->use_asynchronous_shaders->setChecked(Settings::values.use_asynchronous_shaders.GetValue()); 30 ui->use_asynchronous_shaders->setChecked(Settings::values.use_asynchronous_shaders.GetValue());
33 ui->use_caches_gc->setChecked(Settings::values.use_caches_gc.GetValue()); 31 ui->use_caches_gc->setChecked(Settings::values.use_caches_gc.GetValue());
34 ui->use_fast_gpu_time->setChecked(Settings::values.use_fast_gpu_time.GetValue()); 32 ui->use_fast_gpu_time->setChecked(Settings::values.use_fast_gpu_time.GetValue());
@@ -58,8 +56,6 @@ void ConfigureGraphicsAdvanced::ApplyConfiguration() {
58 ConfigurationShared::ApplyPerGameSetting(&Settings::values.max_anisotropy, 56 ConfigurationShared::ApplyPerGameSetting(&Settings::values.max_anisotropy,
59 ui->anisotropic_filtering_combobox); 57 ui->anisotropic_filtering_combobox);
60 ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_vsync, ui->use_vsync, use_vsync); 58 ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_vsync, ui->use_vsync, use_vsync);
61 ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_assembly_shaders,
62 ui->use_assembly_shaders, use_assembly_shaders);
63 ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_asynchronous_shaders, 59 ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_asynchronous_shaders,
64 ui->use_asynchronous_shaders, 60 ui->use_asynchronous_shaders,
65 use_asynchronous_shaders); 61 use_asynchronous_shaders);
@@ -100,7 +96,6 @@ void ConfigureGraphicsAdvanced::SetupPerGameUI() {
100 if (Settings::IsConfiguringGlobal()) { 96 if (Settings::IsConfiguringGlobal()) {
101 ui->gpu_accuracy->setEnabled(Settings::values.gpu_accuracy.UsingGlobal()); 97 ui->gpu_accuracy->setEnabled(Settings::values.gpu_accuracy.UsingGlobal());
102 ui->use_vsync->setEnabled(Settings::values.use_vsync.UsingGlobal()); 98 ui->use_vsync->setEnabled(Settings::values.use_vsync.UsingGlobal());
103 ui->use_assembly_shaders->setEnabled(Settings::values.use_assembly_shaders.UsingGlobal());
104 ui->use_asynchronous_shaders->setEnabled( 99 ui->use_asynchronous_shaders->setEnabled(
105 Settings::values.use_asynchronous_shaders.UsingGlobal()); 100 Settings::values.use_asynchronous_shaders.UsingGlobal());
106 ui->use_fast_gpu_time->setEnabled(Settings::values.use_fast_gpu_time.UsingGlobal()); 101 ui->use_fast_gpu_time->setEnabled(Settings::values.use_fast_gpu_time.UsingGlobal());
@@ -112,8 +107,6 @@ void ConfigureGraphicsAdvanced::SetupPerGameUI() {
112 } 107 }
113 108
114 ConfigurationShared::SetColoredTristate(ui->use_vsync, Settings::values.use_vsync, use_vsync); 109 ConfigurationShared::SetColoredTristate(ui->use_vsync, Settings::values.use_vsync, use_vsync);
115 ConfigurationShared::SetColoredTristate(
116 ui->use_assembly_shaders, Settings::values.use_assembly_shaders, use_assembly_shaders);
117 ConfigurationShared::SetColoredTristate(ui->use_asynchronous_shaders, 110 ConfigurationShared::SetColoredTristate(ui->use_asynchronous_shaders,
118 Settings::values.use_asynchronous_shaders, 111 Settings::values.use_asynchronous_shaders,
119 use_asynchronous_shaders); 112 use_asynchronous_shaders);
diff --git a/src/yuzu/configuration/configure_graphics_advanced.h b/src/yuzu/configuration/configure_graphics_advanced.h
index 9148aacf2..7356e6916 100644
--- a/src/yuzu/configuration/configure_graphics_advanced.h
+++ b/src/yuzu/configuration/configure_graphics_advanced.h
@@ -35,7 +35,6 @@ private:
35 std::unique_ptr<Ui::ConfigureGraphicsAdvanced> ui; 35 std::unique_ptr<Ui::ConfigureGraphicsAdvanced> ui;
36 36
37 ConfigurationShared::CheckState use_vsync; 37 ConfigurationShared::CheckState use_vsync;
38 ConfigurationShared::CheckState use_assembly_shaders;
39 ConfigurationShared::CheckState use_asynchronous_shaders; 38 ConfigurationShared::CheckState use_asynchronous_shaders;
40 ConfigurationShared::CheckState use_fast_gpu_time; 39 ConfigurationShared::CheckState use_fast_gpu_time;
41 ConfigurationShared::CheckState use_caches_gc; 40 ConfigurationShared::CheckState use_caches_gc;
diff --git a/src/yuzu/configuration/configure_graphics_advanced.ui b/src/yuzu/configuration/configure_graphics_advanced.ui
index ad0840355..772e5fed3 100644
--- a/src/yuzu/configuration/configure_graphics_advanced.ui
+++ b/src/yuzu/configuration/configure_graphics_advanced.ui
@@ -77,16 +77,6 @@
77 </widget> 77 </widget>
78 </item> 78 </item>
79 <item> 79 <item>
80 <widget class="QCheckBox" name="use_assembly_shaders">
81 <property name="toolTip">
82 <string>Enabling this reduces shader stutter. Enables OpenGL assembly shaders on supported Nvidia devices (NV_gpu_program5 is required). This feature is experimental.</string>
83 </property>
84 <property name="text">
85 <string>Use assembly shaders (experimental, Nvidia OpenGL only)</string>
86 </property>
87 </widget>
88 </item>
89 <item>
90 <widget class="QCheckBox" name="use_asynchronous_shaders"> 80 <widget class="QCheckBox" name="use_asynchronous_shaders">
91 <property name="toolTip"> 81 <property name="toolTip">
92 <string>Enables asynchronous shader compilation, which may reduce shader stutter. This feature is experimental.</string> 82 <string>Enables asynchronous shader compilation, which may reduce shader stutter. This feature is experimental.</string>
@@ -144,22 +134,22 @@
144 </item> 134 </item>
145 <item> 135 <item>
146 <property name="text"> 136 <property name="text">
147 <string>2x</string> 137 <string>2x (WILL BREAK THINGS)</string>
148 </property> 138 </property>
149 </item> 139 </item>
150 <item> 140 <item>
151 <property name="text"> 141 <property name="text">
152 <string>4x</string> 142 <string>4x (WILL BREAK THINGS)</string>
153 </property> 143 </property>
154 </item> 144 </item>
155 <item> 145 <item>
156 <property name="text"> 146 <property name="text">
157 <string>8x</string> 147 <string>8x (WILL BREAK THINGS)</string>
158 </property> 148 </property>
159 </item> 149 </item>
160 <item> 150 <item>
161 <property name="text"> 151 <property name="text">
162 <string>16x</string> 152 <string>16x (WILL BREAK THINGS)</string>
163 </property> 153 </property>
164 </item> 154 </item>
165 </widget> 155 </widget>
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp
index 763df6dd6..640d7d111 100644
--- a/src/yuzu_cmd/config.cpp
+++ b/src/yuzu_cmd/config.cpp
@@ -458,7 +458,7 @@ void Config::ReadValues() {
458 ReadSetting("Renderer", Settings::values.use_asynchronous_gpu_emulation); 458 ReadSetting("Renderer", Settings::values.use_asynchronous_gpu_emulation);
459 ReadSetting("Renderer", Settings::values.use_vsync); 459 ReadSetting("Renderer", Settings::values.use_vsync);
460 ReadSetting("Renderer", Settings::values.disable_fps_limit); 460 ReadSetting("Renderer", Settings::values.disable_fps_limit);
461 ReadSetting("Renderer", Settings::values.use_assembly_shaders); 461 ReadSetting("Renderer", Settings::values.shader_backend);
462 ReadSetting("Renderer", Settings::values.use_asynchronous_shaders); 462 ReadSetting("Renderer", Settings::values.use_asynchronous_shaders);
463 ReadSetting("Renderer", Settings::values.use_nvdec_emulation); 463 ReadSetting("Renderer", Settings::values.use_nvdec_emulation);
464 ReadSetting("Renderer", Settings::values.accelerate_astc); 464 ReadSetting("Renderer", Settings::values.accelerate_astc);
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h
index a6ca7b6cd..b7115b06a 100644
--- a/src/yuzu_cmd/default_ini.h
+++ b/src/yuzu_cmd/default_ini.h
@@ -248,9 +248,10 @@ max_anisotropy =
248# 0 (default): Off, 1: On 248# 0 (default): Off, 1: On
249use_vsync = 249use_vsync =
250 250
251# Whether to use OpenGL assembly shaders or not. NV_gpu_program5 is required. 251# Selects the OpenGL shader backend. NV_gpu_program5 is required for GLASM. If NV_gpu_program5 is
252# 0: Off, 1 (default): On 252# not available and GLASM is selected, GLSL will be used.
253use_assembly_shaders = 253# 0: GLSL, 1 (default): GLASM, 2: SPIR-V
254shader_backend =
254 255
255# Whether to allow asynchronous shader building. 256# Whether to allow asynchronous shader building.
256# 0 (default): Off, 1: On 257# 0 (default): Off, 1: On