[Mesa-dev] [PATCH 2/3] vulkan/wsi: VK_EXT_hdr_metadata plumbing

Tapani Pälli tapani.palli at intel.com
Mon Apr 30 06:42:37 UTC 2018


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Add the common wsi infrastructure for VK_EXT_hdr_metadata.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 src/vulkan/wsi/wsi_common.c         | 12 ++++++++++++
 src/vulkan/wsi/wsi_common.h         |  5 +++++
 src/vulkan/wsi/wsi_common_private.h |  2 ++
 3 files changed, 19 insertions(+)

diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
index fe262b4968..676346f0a2 100644
--- a/src/vulkan/wsi/wsi_common.c
+++ b/src/vulkan/wsi/wsi_common.c
@@ -773,6 +773,18 @@ wsi_common_destroy_swapchain(VkDevice device,
    swapchain->destroy(swapchain, pAllocator);
 }
 
+void
+wsi_common_set_hdr_metadata(uint32_t swapchainCount,
+                            const VkSwapchainKHR *pSwapchain,
+                            const VkHdrMetadataEXT *pMetadata)
+{
+   for (uint32_t i = 0; i < swapchainCount; i++) {
+      WSI_FROM_HANDLE(wsi_swapchain, swapchain, pSwapchain[i]);
+      if (swapchain->set_hdr_metadata)
+         swapchain->set_hdr_metadata(swapchain, &pMetadata[i]);
+   }
+}
+
 VkResult
 wsi_common_get_images(VkSwapchainKHR _swapchain,
                       uint32_t *pSwapchainImageCount,
diff --git a/src/vulkan/wsi/wsi_common.h b/src/vulkan/wsi/wsi_common.h
index 6cf729ba02..b41a633e02 100644
--- a/src/vulkan/wsi/wsi_common.h
+++ b/src/vulkan/wsi/wsi_common.h
@@ -202,6 +202,11 @@ wsi_common_destroy_swapchain(VkDevice device,
                              VkSwapchainKHR swapchain,
                              const VkAllocationCallbacks *pAllocator);
 
+void
+wsi_common_set_hdr_metadata(uint32_t swapchainCount,
+                            const VkSwapchainKHR* pSwapchains,
+                            const VkHdrMetadataEXT* pMetadata);
+
 VkResult
 wsi_common_queue_present(const struct wsi_device *wsi,
                          VkDevice device_h,
diff --git a/src/vulkan/wsi/wsi_common_private.h b/src/vulkan/wsi/wsi_common_private.h
index b608119b96..c0210f5588 100644
--- a/src/vulkan/wsi/wsi_common_private.h
+++ b/src/vulkan/wsi/wsi_common_private.h
@@ -67,6 +67,8 @@ struct wsi_swapchain {
    VkResult (*queue_present)(struct wsi_swapchain *swap_chain,
                              uint32_t image_index,
                              const VkPresentRegionKHR *damage);
+   void (*set_hdr_metadata)(struct wsi_swapchain *swapchain,
+                            const VkHdrMetadataEXT *metadata);
 };
 
 VkResult
-- 
2.13.6



More information about the mesa-dev mailing list