From dc13f4831829d6b444306dbc38fa892d3f4e7d45 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 3 Dec 2019 01:28:28 +0100 Subject: [PATCH] [dxvk] Enable VK_EXT_full_screen_exclusive if available Also pulls in VK_KHR_get_surface_capabilities2 as a dependency. --- src/dxvk/dxvk_adapter.cpp | 3 ++- src/dxvk/dxvk_extensions.h | 2 ++ src/dxvk/dxvk_instance.cpp | 3 ++- src/vulkan/vulkan_loader.h | 14 +++++++++++++- src/vulkan/vulkan_presenter.h | 1 + 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/dxvk/dxvk_adapter.cpp b/src/dxvk/dxvk_adapter.cpp index a7b01c523..43c39bd5b 100644 --- a/src/dxvk/dxvk_adapter.cpp +++ b/src/dxvk/dxvk_adapter.cpp @@ -241,11 +241,12 @@ namespace dxvk { DxvkDeviceFeatures enabledFeatures) { DxvkDeviceExtensions devExtensions; - std::array devExtensionList = {{ + std::array devExtensionList = {{ &devExtensions.amdMemoryOverallocationBehaviour, &devExtensions.amdShaderFragmentMask, &devExtensions.extConditionalRendering, &devExtensions.extDepthClipEnable, + &devExtensions.extFullScreenExclusive, &devExtensions.extHostQueryReset, &devExtensions.extMemoryBudget, &devExtensions.extMemoryPriority, diff --git a/src/dxvk/dxvk_extensions.h b/src/dxvk/dxvk_extensions.h index 565be8b9b..474af6903 100644 --- a/src/dxvk/dxvk_extensions.h +++ b/src/dxvk/dxvk_extensions.h @@ -262,6 +262,7 @@ namespace dxvk { DxvkExt amdShaderFragmentMask = { VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extConditionalRendering = { VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME, DxvkExtMode::Disabled }; DxvkExt extDepthClipEnable = { VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME, DxvkExtMode::Optional }; + DxvkExt extFullScreenExclusive = { VK_EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extHostQueryReset = { VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt extMemoryBudget = { VK_EXT_MEMORY_BUDGET_EXTENSION_NAME, DxvkExtMode::Passive }; DxvkExt extMemoryPriority = { VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME, DxvkExtMode::Optional }; @@ -293,6 +294,7 @@ namespace dxvk { */ struct DxvkInstanceExtensions { DxvkExt khrGetPhysicalDeviceProperties2 = { VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, DxvkExtMode::Required }; + DxvkExt khrGetSurfaceCapabilities2 = { VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME, DxvkExtMode::Optional }; DxvkExt khrSurface = { VK_KHR_SURFACE_EXTENSION_NAME, DxvkExtMode::Required }; }; diff --git a/src/dxvk/dxvk_instance.cpp b/src/dxvk/dxvk_instance.cpp index 65ee18144..ea88d649d 100644 --- a/src/dxvk/dxvk_instance.cpp +++ b/src/dxvk/dxvk_instance.cpp @@ -87,8 +87,9 @@ namespace dxvk { VkInstance DxvkInstance::createInstance() { DxvkInstanceExtensions insExtensions; - std::array insExtensionList = {{ + std::array insExtensionList = {{ &insExtensions.khrGetPhysicalDeviceProperties2, + &insExtensions.khrGetSurfaceCapabilities2, &insExtensions.khrSurface, }}; diff --git a/src/vulkan/vulkan_loader.h b/src/vulkan/vulkan_loader.h index ab5f84aba..e747dc59e 100644 --- a/src/vulkan/vulkan_loader.h +++ b/src/vulkan/vulkan_loader.h @@ -98,6 +98,11 @@ namespace dxvk::vk { VULKAN_FN(vkGetPhysicalDeviceMemoryProperties2KHR); VULKAN_FN(vkGetPhysicalDeviceSparseImageFormatProperties2KHR); #endif + + #ifdef VK_KHR_get_surface_capabilities2 + VULKAN_FN(vkGetPhysicalDeviceSurfaceCapabilities2KHR); + VULKAN_FN(vkGetPhysicalDeviceSurfaceFormats2KHR); + #endif #ifdef VK_KHR_surface #ifdef VK_USE_PLATFORM_XCB_KHR @@ -133,6 +138,13 @@ namespace dxvk::vk { VULKAN_FN(vkDestroyDebugReportCallbackEXT); VULKAN_FN(vkDebugReportMessageEXT); #endif + + #ifdef VK_EXT_full_screen_exclusive + VULKAN_FN(vkGetPhysicalDeviceSurfacePresentModes2EXT); + VULKAN_FN(vkAcquireFullScreenExclusiveModeEXT); + VULKAN_FN(vkReleaseFullScreenExclusiveModeEXT); + VULKAN_FN(vkGetDeviceGroupSurfacePresentModes2EXT); + #endif }; @@ -303,7 +315,7 @@ namespace dxvk::vk { VULKAN_FN(vkCmdBeginConditionalRenderingEXT); VULKAN_FN(vkCmdEndConditionalRenderingEXT); #endif - + #ifdef VK_EXT_host_query_reset VULKAN_FN(vkResetQueryPoolEXT); #endif diff --git a/src/vulkan/vulkan_presenter.h b/src/vulkan/vulkan_presenter.h index c01672c35..7e2d2eabc 100644 --- a/src/vulkan/vulkan_presenter.h +++ b/src/vulkan/vulkan_presenter.h @@ -26,6 +26,7 @@ namespace dxvk::vk { VkSurfaceFormatKHR formats[4]; uint32_t numPresentModes; VkPresentModeKHR presentModes[4]; + VkFullScreenExclusiveEXT fullscreenExclusive; }; /**