diff options
| author | 2017-03-16 16:46:05 +1300 | |
|---|---|---|
| committer | 2017-03-16 10:49:13 -0700 | |
| commit | 06bc009ca14efd3869f2acf0de6ace9f9beb3c0b (patch) | |
| tree | b32c82dffc3eca3872070ff1772563f223390258 | |
| parent | 2452cf7e653c425191791a4fb546106d6a277654 (diff) | |
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
| -rw-r--r-- | vulkan/libvulkan/swapchain.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
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<VkSurfaceCapabilities2KHR*>(caps->pNext); + + switch (caps->sType) { + case VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: { + VkSharedPresentSurfaceCapabilitiesKHR* shared_caps = + reinterpret_cast<VkSharedPresentSurfaceCapabilitiesKHR*>( + 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; } |