From a546ecbb1241a28b808d3a9ebe1a55f001c267ed Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Mon, 1 May 2023 20:36:23 -0400 Subject: configure_graphics: Actively find present modes When Vulkan devices are enumerated, this also determines the available present modes for each device, maps them to a vector, and gives those options to the user. OpenGL options are limited to On/Off. Required creating a VkSurfaceKHR during device enumeration, which may or may not be desireable. For the sake of a less confusing UI. Also fixes a bug where if a graphics device disappears on the host, we don't try and select the non-existant devices. configure_graphics: Remove vsync runtime lock for Vulkan configure_graphics: Recommend Mailbox present mode configure_graphics: Fix type-limits warning configure_graphics: Clean up includes configure_graphics: Add tooltip --- src/yuzu/configuration/configure_graphics.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/yuzu/configuration/configure_graphics.h') diff --git a/src/yuzu/configuration/configure_graphics.h b/src/yuzu/configuration/configure_graphics.h index d98d6624e..6d8002de2 100644 --- a/src/yuzu/configuration/configure_graphics.h +++ b/src/yuzu/configuration/configure_graphics.h @@ -7,6 +7,7 @@ #include #include #include +#include #include "common/settings.h" namespace Core { @@ -35,6 +36,7 @@ private: void changeEvent(QEvent* event) override; void RetranslateUI(); + void PopulateVSyncModeSelection(); void UpdateBackgroundColorButton(QColor color); void UpdateAPILayout(); void UpdateDeviceSelection(int device); @@ -43,6 +45,10 @@ private: void RetrieveVulkanDevices(); void SetFSRIndicatorText(int percentage); + /* Turns a Vulkan present mode into a textual string for a UI + * (and eventually for a human to read) */ + const QString TranslateVSyncMode(VkPresentModeKHR mode, + Settings::RendererBackend backend) const; void SetupPerGameUI(); @@ -58,6 +64,10 @@ private: ConfigurationShared::CheckState use_asynchronous_gpu_emulation; std::vector vulkan_devices; + std::vector> device_present_modes; + std::vector + vsync_mode_combobox_enum_map; //< Keeps track of which present mode corresponds to which + // selection in the combobox u32 vulkan_device{}; Settings::ShaderBackend shader_backend{}; -- cgit v1.2.3