summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/configuration/configure_graphics.cpp43
1 files changed, 16 insertions, 27 deletions
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp
index 673921649..62d74d12b 100644
--- a/src/yuzu/configuration/configure_graphics.cpp
+++ b/src/yuzu/configuration/configure_graphics.cpp
@@ -33,6 +33,7 @@
33#include "common/dynamic_library.h" 33#include "common/dynamic_library.h"
34#include "common/logging/log.h" 34#include "common/logging/log.h"
35#include "common/settings.h" 35#include "common/settings.h"
36#include "common/settings_enums.h"
36#include "core/core.h" 37#include "core/core.h"
37#include "ui_configure_graphics.h" 38#include "ui_configure_graphics.h"
38#include "yuzu/configuration/configuration_shared.h" 39#include "yuzu/configuration/configuration_shared.h"
@@ -442,36 +443,24 @@ void ConfigureGraphics::UpdateBackgroundColorButton(QColor color) {
442 443
443void ConfigureGraphics::UpdateAPILayout() { 444void ConfigureGraphics::UpdateAPILayout() {
444 bool runtime_lock = !system.IsPoweredOn(); 445 bool runtime_lock = !system.IsPoweredOn();
445 if (!Settings::IsConfiguringGlobal() && !api_restore_global_button->isEnabled()) { 446 bool need_global = !(Settings::IsConfiguringGlobal() || api_restore_global_button->isEnabled());
446 vulkan_device = Settings::values.vulkan_device.GetValue(true); 447 vulkan_device = Settings::values.vulkan_device.GetValue(need_global);
447 shader_backend = Settings::values.shader_backend.GetValue(true); 448 shader_backend = Settings::values.shader_backend.GetValue(need_global);
448 vulkan_device_widget->setEnabled(false); 449 vulkan_device_widget->setEnabled(!need_global && runtime_lock);
449 shader_backend_widget->setEnabled(false); 450 shader_backend_widget->setEnabled(!need_global && runtime_lock);
450 } else { 451
451 vulkan_device = Settings::values.vulkan_device.GetValue(); 452 const auto current_backend = GetCurrentGraphicsBackend();
452 shader_backend = Settings::values.shader_backend.GetValue(); 453 const bool is_opengl = current_backend == Settings::RendererBackend::OpenGL;
453 vulkan_device_widget->setEnabled(runtime_lock); 454 const bool is_vulkan = current_backend == Settings::RendererBackend::Vulkan;
454 shader_backend_widget->setEnabled(runtime_lock); 455
455 } 456 vulkan_device_widget->setVisible(is_vulkan);
457 shader_backend_widget->setVisible(is_opengl);
456 458
457 switch (GetCurrentGraphicsBackend()) { 459 if (is_opengl) {
458 case Settings::RendererBackend::OpenGL:
459 shader_backend_combobox->setCurrentIndex( 460 shader_backend_combobox->setCurrentIndex(
460 FindIndex(typeid(Settings::ShaderBackend), static_cast<int>(shader_backend))); 461 FindIndex(typeid(Settings::ShaderBackend), static_cast<int>(shader_backend)));
461 vulkan_device_widget->setVisible(false); 462 } else if (is_vulkan && static_cast<int>(vulkan_device) < vulkan_device_combobox->count()) {
462 shader_backend_widget->setVisible(true); 463 vulkan_device_combobox->setCurrentIndex(vulkan_device);
463 break;
464 case Settings::RendererBackend::Vulkan:
465 if (static_cast<int>(vulkan_device) < vulkan_device_combobox->count()) {
466 vulkan_device_combobox->setCurrentIndex(vulkan_device);
467 }
468 vulkan_device_widget->setVisible(true);
469 shader_backend_widget->setVisible(false);
470 break;
471 case Settings::RendererBackend::Null:
472 vulkan_device_widget->setVisible(false);
473 shader_backend_widget->setVisible(false);
474 break;
475 } 464 }
476} 465}
477 466