summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLior Dekel <lior.dekel@arm.com>2022-09-07 13:42:33 +0300
committerLior Dekel <lior.dekel@arm.com>2022-09-13 13:46:39 +0300
commit908518c92ee00af1d7787daf3e222d817770d7e1 (patch)
tree9af1de1205a7402b4222bc5bb1518fbffe980da3
parent962472c72943690495ae414d0dda82048396c4d8 (diff)
downloadvulkan-wsi-layer-908518c92ee00af1d7787daf3e222d817770d7e1.tar.gz
vulkan-wsi-layer-908518c92ee00af1d7787daf3e222d817770d7e1.tar.bz2
vulkan-wsi-layer-908518c92ee00af1d7787daf3e222d817770d7e1.zip
Adding VK_KHR_shared_presentable_image basic support
To comply with ICDs that expose the VK_KHR_shared_presentable_image extension, the Layer needs to handle VkSharedPresentSurfaceCapabilitiesKHR struct (holds sType=VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR) for queries on the VkSurfaces managed by the Layer. A simple implementation that sets the minimum required flags is provided in this commit. Since no WSI layer swapchain will support the shared presentable modes, no other functionality is required. VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT must be included in the sharedPresentSupportedUsageFlags field but implementations may support additional usages. Signed-off-by: Lior Dekel <lior.dekel@arm.com> Change-Id: I73b29e54a84376c663b3cada989c910d1ba27293
-rw-r--r--layer/surface_api.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/layer/surface_api.cpp b/layer/surface_api.cpp
index 4140c03..6e11840 100644
--- a/layer/surface_api.cpp
+++ b/layer/surface_api.cpp
@@ -63,6 +63,13 @@ wsi_layer_vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDe
wsi::surface_properties *props = wsi::get_surface_properties(instance, pSurfaceInfo->surface);
assert(props != nullptr);
+ auto shared_present_surface_cap_struct = util::find_extension<VkSharedPresentSurfaceCapabilitiesKHR>(
+ VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR, pSurfaceCapabilities);
+ if (shared_present_surface_cap_struct != nullptr)
+ {
+ shared_present_surface_cap_struct->sharedPresentSupportedUsageFlags = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
+ }
+
/*
* Any of the extensions that extend pSurfaceInfo are not supported by the
* swapchain implementation so it is safe to ignore pNext here, even if