diff --git a/rpcs3/Emu/RSX/VK/vkutils/swapchain.hpp b/rpcs3/Emu/RSX/VK/vkutils/swapchain.hpp index e6ebd01ee6..bca489d8d8 100644 --- a/rpcs3/Emu/RSX/VK/vkutils/swapchain.hpp +++ b/rpcs3/Emu/RSX/VK/vkutils/swapchain.hpp @@ -555,7 +555,7 @@ namespace vk std::pair init_surface_capabilities() { #ifdef _WIN32 - if (g_cfg.video.vk.force_disable_exclusive_fullscreen_mode && dev.get_surface_capabilities_2_support()) + if (g_cfg.video.vk.exclusive_fullscreen_mode != vk_exclusive_fs_mode::unspecified && dev.get_surface_capabilities_2_support()) { HMONITOR hmonitor = MonitorFromWindow(window_handle, MONITOR_DEFAULTTOPRIMARY); if (hmonitor) @@ -609,7 +609,7 @@ namespace vk VkSwapchainKHR old_swapchain = m_vk_swapchain; vk::physical_device& gpu = const_cast(dev.gpu()); - auto [surface_descriptors, should_disable_exclusive_full_screen] = init_surface_capabilities(); + auto [surface_descriptors, should_specify_exclusive_full_screen_mode] = init_surface_capabilities(); if (surface_descriptors.maxImageExtent.width < m_width || surface_descriptors.maxImageExtent.height < m_height) @@ -710,10 +710,14 @@ namespace vk #ifdef _WIN32 VkSurfaceFullScreenExclusiveInfoEXT full_screen_exclusive_info = {}; - if (should_disable_exclusive_full_screen) + if (should_specify_exclusive_full_screen_mode) { - full_screen_exclusive_info.sType = VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT; - full_screen_exclusive_info.fullScreenExclusive = VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT; + vk_exclusive_fs_mode fs_mode = g_cfg.video.vk.exclusive_fullscreen_mode; + ensure(fs_mode == vk_exclusive_fs_mode::enable || fs_mode == vk_exclusive_fs_mode::disable); + + full_screen_exclusive_info.sType = VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT; + full_screen_exclusive_info.fullScreenExclusive = + fs_mode == vk_exclusive_fs_mode::enable ? VK_FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT : VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT; swap_info.pNext = &full_screen_exclusive_info; } diff --git a/rpcs3/Emu/system_config.h b/rpcs3/Emu/system_config.h index bf052ac5ea..88fde3dcbb 100644 --- a/rpcs3/Emu/system_config.h +++ b/rpcs3/Emu/system_config.h @@ -185,7 +185,7 @@ struct cfg_root : cfg::node cfg::string adapter{ this, "Adapter" }; cfg::_bool force_fifo{ this, "Force FIFO present mode" }; cfg::_bool force_primitive_restart{ this, "Force primitive restart flag" }; - cfg::_bool force_disable_exclusive_fullscreen_mode{ this, "Force Disable Exclusive Fullscreen Mode", false }; + cfg::_enum exclusive_fullscreen_mode{ this, "Exclusive Fullscreen Mode", vk_exclusive_fs_mode::unspecified}; cfg::_bool asynchronous_texture_streaming{ this, "Asynchronous Texture Streaming 2", false }; cfg::_bool fsr_upscaling{ this, "Enable FidelityFX Super Resolution Upscaling", false, true }; cfg::uint<0, 100> rcas_sharpening_intensity{ this, "FidelityFX CAS Sharpening Intensity", 50, true }; diff --git a/rpcs3/Emu/system_config_types.cpp b/rpcs3/Emu/system_config_types.cpp index 2540a72cd8..4ae2a7a760 100644 --- a/rpcs3/Emu/system_config_types.cpp +++ b/rpcs3/Emu/system_config_types.cpp @@ -612,3 +612,19 @@ void fmt_class_string::format(std::string& out, u64 arg) return unknown; }); } + +template <> +void fmt_class_string::format(std::string& out, u64 arg) +{ + format_enum(out, arg, [](vk_exclusive_fs_mode value) + { + switch (value) + { + case vk_exclusive_fs_mode::unspecified: return "Automatic"; + case vk_exclusive_fs_mode::disable: return "Disable"; + case vk_exclusive_fs_mode::enable: return "Enable"; + } + + return unknown; + }); +} diff --git a/rpcs3/Emu/system_config_types.h b/rpcs3/Emu/system_config_types.h index b708fcec3c..b9eda82a42 100644 --- a/rpcs3/Emu/system_config_types.h +++ b/rpcs3/Emu/system_config_types.h @@ -260,6 +260,13 @@ enum class shader_mode interpreter_only }; +enum class vk_exclusive_fs_mode +{ + unspecified, + disable, + enable +}; + enum class vk_gpu_scheduler_mode { safe, diff --git a/rpcs3/rpcs3qt/emu_settings.cpp b/rpcs3/rpcs3qt/emu_settings.cpp index 06492bdd22..a07ab57e32 100644 --- a/rpcs3/rpcs3qt/emu_settings.cpp +++ b/rpcs3/rpcs3qt/emu_settings.cpp @@ -1270,6 +1270,15 @@ QString emu_settings::GetLocalizedSetting(const QString& original, emu_settings_ case CELL_KB_MAPPING_PORTUGUESE_BRAZIL: return tr("Portuguese keyboard (Brazil)", "Keyboard Type"); case CELL_KB_MAPPING_TURKISH_TURKEY: return tr("Turkish keyboard", "Keyboard Type"); } + break; + case emu_settings_type::ExclusiveFullscreenMode: + switch (static_cast(index)) + { + case vk_exclusive_fs_mode::unspecified: return tr("Automatic (Default)", "Exclusive Fullscreen Mode"); + case vk_exclusive_fs_mode::disable: return tr("Prefer borderless fullscreen", "Exclusive Fullscreen Mode"); + case vk_exclusive_fs_mode::enable: return tr("Prefer exclusive fullscreen", "Exclusive Fullscreen Mode"); + } + break; default: break; } diff --git a/rpcs3/rpcs3qt/emu_settings_type.h b/rpcs3/rpcs3qt/emu_settings_type.h index 4aba09eef4..e4b5d40eaa 100644 --- a/rpcs3/rpcs3qt/emu_settings_type.h +++ b/rpcs3/rpcs3qt/emu_settings_type.h @@ -84,7 +84,7 @@ enum class emu_settings_type MinimumScalableDimension, FsrUpscalingEnable, FsrSharpeningStrength, - ForceDisableExclusiveFullscreenMode, + ExclusiveFullscreenMode, ForceCPUBlitEmulation, DisableOnDiskShaderCache, DisableVulkanMemAllocator, @@ -276,7 +276,7 @@ inline static const QMap settings_location = { emu_settings_type::VulkanAsyncSchedulerDriver, { "Video", "Vulkan", "Asynchronous Queue Scheduler"}}, { emu_settings_type::FsrUpscalingEnable, { "Video", "Vulkan", "Enable FidelityFX Super Resolution Upscaling"}}, { emu_settings_type::FsrSharpeningStrength, { "Video", "Vulkan", "FidelityFX CAS Sharpening Intensity"}}, - { emu_settings_type::ForceDisableExclusiveFullscreenMode, { "Video", "Vulkan", "Force Disable Exclusive Fullscreen Mode"}}, + { emu_settings_type::ExclusiveFullscreenMode, { "Video", "Vulkan", "Exclusive Fullscreen Mode"}}, // Performance Overlay { emu_settings_type::PerfOverlayEnabled, { "Video", "Performance Overlay", "Enabled" } }, diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index c92a634639..e2e4e8b17b 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -1354,9 +1354,6 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std m_emu_settings->EnhanceCheckBox(ui->disableOnDiskShaderCache, emu_settings_type::DisableOnDiskShaderCache); SubscribeTooltip(ui->disableOnDiskShaderCache, tooltips.settings.disable_on_disk_shader_cache); - m_emu_settings->EnhanceCheckBox(ui->forceDisableExclusiveFullscreenMode, emu_settings_type::ForceDisableExclusiveFullscreenMode); - SubscribeTooltip(ui->forceDisableExclusiveFullscreenMode, tooltips.settings.force_disable_exclusive_fullscreen_mode); - m_emu_settings->EnhanceCheckBox(ui->vblankNTSCFixup, emu_settings_type::VBlankNTSCFixup); ui->mfcDelayCommand->setChecked(m_emu_settings->GetSetting(emu_settings_type::MFCCommandsShuffling) == "1"); @@ -1380,6 +1377,9 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std ui->maxSPURSThreads->setItemText(ui->maxSPURSThreads->findData(6), tr("Unlimited (Default)", "Max SPURS threads")); SubscribeTooltip(ui->gb_max_spurs_threads, tooltips.settings.max_spurs_threads); + m_emu_settings->EnhanceComboBox(ui->exclusiveFullscreenMode, emu_settings_type::ExclusiveFullscreenMode); + SubscribeTooltip(ui->gb_exclusiveFullscreen, tooltips.settings.exclusive_fullscreen_mode); + m_emu_settings->EnhanceComboBox(ui->sleepTimersAccuracy, emu_settings_type::SleepTimersAccuracy); SubscribeTooltip(ui->gb_sleep_timers_accuracy, tooltips.settings.sleep_timers_accuracy); diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index 516bfd7678..24336998d7 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -2549,13 +2549,6 @@ - - - - Force Disable Exclusive Fullscreen Mode - - - @@ -2616,6 +2609,24 @@ + + + + + 0 + 0 + + + + Exclusive Fullscreen Mode + + + + + + + + diff --git a/rpcs3/rpcs3qt/tooltips.h b/rpcs3/rpcs3qt/tooltips.h index ea9d0d3e44..6e54041b8a 100644 --- a/rpcs3/rpcs3qt/tooltips.h +++ b/rpcs3/rpcs3qt/tooltips.h @@ -179,8 +179,8 @@ public: const QString shader_compiler_threads = tr("Number of threads to use for the shader compiler backend.\nOnly has an impact when shader mode is set to one of the asynchronous modes."); const QString shader_precision = tr("Controls the precision level of generated shaders. Low precision generates much faster code depending on the hardware, but can sometimes generate minor visual glitches or flicker."); - const QString async_texture_streaming = tr("Stream textures to GPU in parallel with 3D rendering using asynchronous compute.\nCan improve performance on more powerful GPUs that have spare headroom.\nOnly works with Vulkan renderer and greatly benefits from having MTRSX enabled if you have a capable CPU."); - const QString force_disable_exclusive_fullscreen_mode = tr("Forces borderless windowed mode for all fullscreen windows. Disables exclusive fullscreen graphics driver optimizations.\nUse when you wish to stream using Vulkan or if your screen goes dim using HDR.\nNote: RPCS3 does not use HDR at all."); + const QString async_texture_streaming = tr("Stream textures to GPU in parallel with 3D rendering using asynchronous compute.\nCan improve performance on more powerful GPUs that have spare headroom.\nOnly works with Vulkan renderer and greatly benefits from having MTRSX enabled if you have a capable CPU."); + const QString exclusive_fullscreen_mode = tr("Controls which fullscreen mode RPCS3 requests from drivers when using Vulkan renderer.\nAutomatic will let the driver choose an appropriate mode, while the other options will hint the drivers on whether they should use exclusive or borderless fullscreen.\nUsing Prefer borderless fullscreen option can help if you have issues with streaming RPCS3 gameplay or if your system incorrectly enables HDR mode when using fullscreen."); const QString fsr_upscaling = tr("Enable FidelityFX Super Resolution upscaling filter to improve the look of upscaled images.\nIf the game is rendering at an internal resolution lower than your window resolution, FidelityFX will handle the upscale.\nCan cause visual artifacts.\nDoes not work with stereo 3D output for now."); const QString fsr_rcas_strength = tr("Control the sharpening strength applied by FidelityFX Super Resolution. Higher values will give sharper output but may introduce artifacts.");