summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar lat9nq2023-09-04 20:21:14 -0400
committerGravatar lat9nq2023-09-04 20:21:14 -0400
commitea46efd9a2713d28936141066e3d4418f28c4648 (patch)
tree32548c7bad8cf7f4f3da84042ab0a55438b55343
parentMerge pull request #11427 from zhaobot/tx-update-20230901020727 (diff)
downloadyuzu-ea46efd9a2713d28936141066e3d4418f28c4648.tar.gz
yuzu-ea46efd9a2713d28936141066e3d4418f28c4648.tar.xz
yuzu-ea46efd9a2713d28936141066e3d4418f28c4648.zip
configure_graphics: Fix handling of broken Vulkan
The VSync combobox wouldn't populate if there was no Vulkan device, which caused issues with trying to set VSync on other backends. This also adds another layer to GetCurrentGraphicsBackend to check for broken Vulkan and return OpenGL instead of Vulkan.
Diffstat (limited to '')
-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() {
193 : vsync_mode_combobox_enum_map[current_index]; 193 : vsync_mode_combobox_enum_map[current_index];
194 int index{}; 194 int index{};
195 const int device{vulkan_device_combobox->currentIndex()}; //< current selected Vulkan device 195 const int device{vulkan_device_combobox->currentIndex()}; //< current selected Vulkan device
196 if (device == -1) {
197 // Invalid device
198 return;
199 }
200 196
201 const auto& present_modes = //< relevant vector of present modes for the selected device or API 197 const auto& present_modes = //< relevant vector of present modes for the selected device or API
202 backend == Settings::RendererBackend::Vulkan ? device_present_modes[device] 198 backend == Settings::RendererBackend::Vulkan && device > -1 ? device_present_modes[device]
203 : default_present_modes; 199 : default_present_modes;
204 200
205 vsync_mode_combobox->clear(); 201 vsync_mode_combobox->clear();
206 vsync_mode_combobox_enum_map.clear(); 202 vsync_mode_combobox_enum_map.clear();
@@ -497,11 +493,19 @@ void ConfigureGraphics::RetrieveVulkanDevices() {
497} 493}
498 494
499Settings::RendererBackend ConfigureGraphics::GetCurrentGraphicsBackend() const { 495Settings::RendererBackend ConfigureGraphics::GetCurrentGraphicsBackend() const {
500 if (!Settings::IsConfiguringGlobal() && !api_restore_global_button->isEnabled()) { 496 const auto selected_backend = [=]() {
501 return Settings::values.renderer_backend.GetValue(true); 497 if (!Settings::IsConfiguringGlobal() && !api_restore_global_button->isEnabled()) {
498 return Settings::values.renderer_backend.GetValue(true);
499 }
500 return static_cast<Settings::RendererBackend>(
501 combobox_translations.at(Settings::EnumMetadata<Settings::RendererBackend>::Index())
502 .at(api_combobox->currentIndex())
503 .first);
504 }();
505
506 if (selected_backend == Settings::RendererBackend::Vulkan &&
507 UISettings::values.has_broken_vulkan) {
508 return Settings::RendererBackend::OpenGL;
502 } 509 }
503 return static_cast<Settings::RendererBackend>( 510 return selected_backend;
504 combobox_translations.at(Settings::EnumMetadata<Settings::RendererBackend>::Index())
505 .at(api_combobox->currentIndex())
506 .first);
507} 511}