From 06bc009ca14efd3869f2acf0de6ace9f9beb3c0b Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Thu, 16 Mar 2017 16:46:05 +1300 Subject: vulkan: Implement usage flags query for KHR_shared_presentable_image This was a late addition to the spec. Until we have a reason to do otherwise, report the same set of supported usage flags for shared present modes as for all other modes. Test: build Change-Id: I66c13b20a1a0f5aa9be13bc16a323f42874ba45a --- vulkan/libvulkan/swapchain.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/vulkan/libvulkan/swapchain.cpp b/vulkan/libvulkan/swapchain.cpp index 32c2955ce7..b24bc1bc28 100644 --- a/vulkan/libvulkan/swapchain.cpp +++ b/vulkan/libvulkan/swapchain.cpp @@ -657,6 +657,28 @@ VkResult GetPhysicalDeviceSurfaceCapabilities2KHR( physicalDevice, pSurfaceInfo->surface, &pSurfaceCapabilities->surfaceCapabilities); + VkSurfaceCapabilities2KHR* caps = pSurfaceCapabilities; + while (caps->pNext) { + caps = reinterpret_cast(caps->pNext); + + switch (caps->sType) { + case VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: { + VkSharedPresentSurfaceCapabilitiesKHR* shared_caps = + reinterpret_cast( + caps); + // Claim same set of usage flags are supported for + // shared present modes as for other modes. + shared_caps->sharedPresentSupportedUsageFlags = + pSurfaceCapabilities->surfaceCapabilities + .supportedUsageFlags; + } break; + + default: + // Ignore all other extension structs + break; + } + } + return result; } -- cgit v1.2.3-59-g8ed1b