summaryrefslogtreecommitdiffstats
path: root/src/vulkan/wsi/wsi_common.h
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-06-16 10:44:11 -0700
committerJason Ekstrand <[email protected]>2018-06-20 08:16:03 -0700
commitb1a013d035230957bdd619a1049424b35e69d6eb (patch)
treeac5c830927fe48a4d30c2dbf4c8191c7a0212ed2 /src/vulkan/wsi/wsi_common.h
parent8f3b58ebee413fc704fb2fa0fab06dbfe146b08a (diff)
Vulkan/wsi: Implement VK_EXT_display_surface_counter
This extension is required to support EXT_display_control as it offers a way to query whether the vblank counter is supported. Internally, it is implemented using a fake MESA extension which provides a chain-in to GetSurfaceCapabilities2KHR which contains the one added field. This has the advantage of reducing number of callbacks needed in the back-ends. It also means that anything chained into GetSurfaceCapabilities2EXT through VkSurfaceCapabilities2KHR::pNext so we only need to handle crawling the pNext chain once per back-end. Reviewed-by: Keith Packard <[email protected]>
Diffstat (limited to 'src/vulkan/wsi/wsi_common.h')
-rw-r--r--src/vulkan/wsi/wsi_common.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vulkan/wsi/wsi_common.h b/src/vulkan/wsi/wsi_common.h
index 61b1de59d7f..07d5e8353b0 100644
--- a/src/vulkan/wsi/wsi_common.h
+++ b/src/vulkan/wsi/wsi_common.h
@@ -36,6 +36,7 @@
#define VK_STRUCTURE_TYPE_WSI_IMAGE_CREATE_INFO_MESA (VkStructureType)1000001002
#define VK_STRUCTURE_TYPE_WSI_MEMORY_ALLOCATE_INFO_MESA (VkStructureType)1000001003
#define VK_STRUCTURE_TYPE_WSI_FORMAT_MODIFIER_PROPERTIES_LIST_MESA (VkStructureType)1000001004
+#define VK_STRUCTURE_TYPE_WSI_SURFACE_SUPPORTED_COUNTERS_MESA (VkStructureType)1000001005
struct wsi_image_create_info {
VkStructureType sType;
@@ -66,6 +67,14 @@ struct wsi_format_modifier_properties_list {
struct wsi_format_modifier_properties *modifier_properties;
};
+/* To be chained into VkSurfaceCapabilities2KHR */
+struct wsi_surface_supported_counters {
+ VkStructureType sType;
+ const void *pNext;
+
+ VkSurfaceCounterFlagsEXT supported_surface_counters;
+};
+
struct wsi_interface;
#define VK_ICD_WSI_PLATFORM_MAX (VK_ICD_WSI_PLATFORM_DISPLAY + 1)
@@ -179,6 +188,12 @@ wsi_common_get_surface_present_modes(struct wsi_device *wsi_device,
VkPresentModeKHR *pPresentModes);
VkResult
+wsi_common_get_surface_capabilities2ext(
+ struct wsi_device *wsi_device,
+ VkSurfaceKHR surface,
+ VkSurfaceCapabilities2EXT *pSurfaceCapabilities);
+
+VkResult
wsi_common_get_images(VkSwapchainKHR _swapchain,
uint32_t *pSwapchainImageCount,
VkImage *pSwapchainImages);