summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlat9nq <22451773+lat9nq@users.noreply.github.com>2023-09-05 02:21:14 +0200
committerlat9nq <22451773+lat9nq@users.noreply.github.com>2023-09-05 02:21:14 +0200
commitea46efd9a2713d28936141066e3d4418f28c4648 (patch)
tree32548c7bad8cf7f4f3da84042ab0a55438b55343 /src
parentMerge pull request #11427 from zhaobot/tx-update-20230901020727 (diff)
downloadyuzu-ea46efd9a2713d28936141066e3d4418f28c4648.tar
yuzu-ea46efd9a2713d28936141066e3d4418f28c4648.tar.gz
yuzu-ea46efd9a2713d28936141066e3d4418f28c4648.tar.bz2
yuzu-ea46efd9a2713d28936141066e3d4418f28c4648.tar.lz
yuzu-ea46efd9a2713d28936141066e3d4418f28c4648.tar.xz
yuzu-ea46efd9a2713d28936141066e3d4418f28c4648.tar.zst
yuzu-ea46efd9a2713d28936141066e3d4418f28c4648.zip
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/configuration/configure_graphics.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp
index 8622dc184..f36a0cae7 100644
--- a/src/yuzu/configuration/configure_graphics.cpp
+++ b/src/yuzu/configuration/configure_graphics.cpp
@@ -193,14 +193,10 @@ void ConfigureGraphics::PopulateVSyncModeSelection() {
: vsync_mode_combobox_enum_map[current_index];
int index{};
const int device{vulkan_device_combobox->currentIndex()}; //< current selected Vulkan device
- if (device == -1) {
- // Invalid device
- return;
- }
const auto& present_modes = //< relevant vector of present modes for the selected device or API
- backend == Settings::RendererBackend::Vulkan ? device_present_modes[device]
- : default_present_modes;
+ backend == Settings::RendererBackend::Vulkan && device > -1 ? device_present_modes[device]
+ : default_present_modes;
vsync_mode_combobox->clear();
vsync_mode_combobox_enum_map.clear();
@@ -497,11 +493,19 @@ void ConfigureGraphics::RetrieveVulkanDevices() {
}
Settings::RendererBackend ConfigureGraphics::GetCurrentGraphicsBackend() const {
- if (!Settings::IsConfiguringGlobal() && !api_restore_global_button->isEnabled()) {
- return Settings::values.renderer_backend.GetValue(true);
+ const auto selected_backend = [=]() {
+ if (!Settings::IsConfiguringGlobal() && !api_restore_global_button->isEnabled()) {
+ return Settings::values.renderer_backend.GetValue(true);
+ }
+ return static_cast<Settings::RendererBackend>(
+ combobox_translations.at(Settings::EnumMetadata<Settings::RendererBackend>::Index())
+ .at(api_combobox->currentIndex())
+ .first);
+ }();
+
+ if (selected_backend == Settings::RendererBackend::Vulkan &&
+ UISettings::values.has_broken_vulkan) {
+ return Settings::RendererBackend::OpenGL;
}
- return static_cast<Settings::RendererBackend>(
- combobox_translations.at(Settings::EnumMetadata<Settings::RendererBackend>::Index())
- .at(api_combobox->currentIndex())
- .first);
+ return selected_backend;
}