From 17d4ffb033db40379c2c6c89fcb15194e62ccc3a Mon Sep 17 00:00:00 2001 From: Pascal Muetschard Date: Fri, 15 Apr 2022 13:03:12 -0700 Subject: [PATCH] Handle vkGetPhysicalDeviceSurfaceFormats2KHR in the virtual swapchain. --- core/vulkan/vk_virtual_swapchain/cc/layer.cpp | 1 + core/vulkan/vk_virtual_swapchain/cc/swapchain.cpp | 9 +++++++++ core/vulkan/vk_virtual_swapchain/cc/swapchain.h | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/core/vulkan/vk_virtual_swapchain/cc/layer.cpp b/core/vulkan/vk_virtual_swapchain/cc/layer.cpp index 6f76d283b..e2fb6906d 100644 --- a/core/vulkan/vk_virtual_swapchain/cc/layer.cpp +++ b/core/vulkan/vk_virtual_swapchain/cc/layer.cpp @@ -516,6 +516,7 @@ vkGetInstanceProcAddr(VkInstance instance, const char* funcName) { INTERCEPT(vkGetPhysicalDeviceSurfaceSupportKHR); INTERCEPT(vkGetPhysicalDeviceSurfaceFormatsKHR); + INTERCEPT(vkGetPhysicalDeviceSurfaceFormats2KHR); INTERCEPT(vkGetPhysicalDeviceSurfaceCapabilitiesKHR); INTERCEPT(vkGetPhysicalDeviceSurfaceCapabilities2KHR); INTERCEPT(vkGetPhysicalDeviceSurfacePresentModesKHR); diff --git a/core/vulkan/vk_virtual_swapchain/cc/swapchain.cpp b/core/vulkan/vk_virtual_swapchain/cc/swapchain.cpp index a90fe6afd..33b5613a1 100644 --- a/core/vulkan/vk_virtual_swapchain/cc/swapchain.cpp +++ b/core/vulkan/vk_virtual_swapchain/cc/swapchain.cpp @@ -213,6 +213,15 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormatsKHR( return VK_SUCCESS; } +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormats2KHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, + uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats) { + return swapchain::vkGetPhysicalDeviceSurfaceFormatsKHR( + physicalDevice, pSurfaceInfo->surface, pSurfaceFormatCount, + pSurfaceFormats); +} + VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModesKHR( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes) { diff --git a/core/vulkan/vk_virtual_swapchain/cc/swapchain.h b/core/vulkan/vk_virtual_swapchain/cc/swapchain.h index db42b4f74..d51bf1608 100644 --- a/core/vulkan/vk_virtual_swapchain/cc/swapchain.h +++ b/core/vulkan/vk_virtual_swapchain/cc/swapchain.h @@ -55,6 +55,11 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormatsKHR( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats); +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormats2KHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, + uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats); + VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModesKHR( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes); @@ -122,4 +127,4 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass( VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass); } // namespace swapchain -#endif // VK_VIRTUAL_SWAPCHAIN_SWAPCHAIN_H_ \ No newline at end of file +#endif // VK_VIRTUAL_SWAPCHAIN_SWAPCHAIN_H_