/* * Copyright (c) 2024-2025 Arm Limited. * * SPDX-License-Identifier: MIT * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /** * @file wsi_layer_experimental.hpp * * @brief Contains the declarations of the structures and entry point APIs of experimental extensions. * */ #pragma once #include "util/macros.hpp" #if VULKAN_WSI_LAYER_EXPERIMENTAL #define VK_EXT_present_timing 1 #define VK_EXT_PRESENT_TIMING_SPEC_VERSION 1 #define VK_EXT_PRESENT_TIMING_EXTENSION_NAME "VK_EXT_present_timing" #define VK_ERROR_PRESENT_TIMING_QUEUE_FULL_EXT ((VkResult)(-1000208000)) #define VK_TIME_DOMAIN_PRESENT_STAGE_LOCAL_EXT ((VkTimeDomainEXT)(1000208000)) #define VK_TIME_DOMAIN_SWAPCHAIN_LOCAL_EXT ((VkTimeDomainEXT)(1000208001)) #define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_TIMING_FEATURES_EXT ((VkStructureType)1000208000) #define VK_STRUCTURE_TYPE_PRESENT_TIMING_SURFACE_CAPABILITIES_EXT ((VkStructureType)1000208008) #define VK_STRUCTURE_TYPE_SWAPCHAIN_TIMING_PROPERTIES_EXT ((VkStructureType)1000208001) #define VK_STRUCTURE_TYPE_SWAPCHAIN_TIME_DOMAIN_PROPERTIES_EXT ((VkStructureType)1000208002) #define VK_STRUCTURE_TYPE_SWAPCHAIN_CALIBRATED_TIMESTAMP_INFO_EXT ((VkStructureType)1000208009) #define VK_STRUCTURE_TYPE_PAST_PRESENTATION_TIMING_EXT ((VkStructureType)1000208007) #define VK_STRUCTURE_TYPE_PAST_PRESENTATION_TIMING_PROPERTIES_EXT ((VkStructureType)1000208006) #define VK_STRUCTURE_TYPE_PAST_PRESENTATION_TIMING_INFO_EXT ((VkStructureType)1000208005) #define VK_STRUCTURE_TYPE_PRESENT_TIMING_INFO_EXT ((VkStructureType)1000208004) #define VK_STRUCTURE_TYPE_PRESENT_TIMINGS_INFO_EXT ((VkStructureType)1000208003) /* Placeholder. Need to get the real value. */ #define VK_SWAPCHAIN_CREATE_PRESENT_TIMING_BIT_EXT ((VkSwapchainCreateFlagsKHR)0x00000200) typedef VkFlags VkPresentStageFlagsEXT; typedef VkFlags VkPresentTimingInfoFlagsEXT; typedef struct VkPhysicalDevicePresentTimingFeaturesEXT { VkStructureType sType; void *pNext; VkBool32 presentTiming; VkBool32 presentAtAbsoluteTime; VkBool32 presentAtRelativeTime; } VkPhysicalDevicePresentTimingFeaturesEXT; typedef struct VkPresentTimingSurfaceCapabilitiesEXT { VkStructureType sType; void *pNext; VkBool32 presentTimingSupported; VkBool32 presentAtAbsoluteTimeSupported; VkBool32 presentAtRelativeTimeSupported; VkPresentStageFlagsEXT presentStageQueries; } VkPresentTimingSurfaceCapabilitiesEXT; typedef enum VkPresentStageFlagBitsEXT { VK_PRESENT_STAGE_QUEUE_OPERATIONS_END_BIT_EXT = 0x00000001, VK_PRESENT_STAGE_REQUEST_DEQUEUED_BIT_EXT = 0x00000002, VK_PRESENT_STAGE_IMAGE_FIRST_PIXEL_OUT_BIT_EXT = 0x00000004, VK_PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT = 0x00000008, } VkPresentStageFlagBitsEXT; typedef struct VkSwapchainTimingPropertiesEXT { VkStructureType sType; const void *pNext; uint64_t refreshDuration; uint64_t refreshInterval; } VkSwapchainTimingPropertiesEXT; typedef struct VkSwapchainTimeDomainPropertiesEXT { VkStructureType sType; void *pNext; uint32_t timeDomainCount; VkTimeDomainEXT *pTimeDomains; uint64_t *pTimeDomainIds; } VkSwapchainTimeDomainPropertiesEXT; typedef struct VkSwapchainCalibratedTimestampInfoEXT { VkStructureType sType; const void *pNext; VkSwapchainKHR swapchain; VkPresentStageFlagsEXT presentStage; uint64_t timeDomainId; } VkSwapchainCalibratedTimestampInfoEXT; typedef struct VkPresentStageTimeEXT { VkPresentStageFlagsEXT stage; uint64_t time; } VkPresentStageTimeEXT; typedef struct VkPastPresentationTimingEXT { VkStructureType sType; void *pNext; uint64_t presentId; uint64_t targetTime; uint32_t presentStageCount; VkPresentStageTimeEXT *pPresentStages; VkTimeDomainKHR timeDomain; uint64_t timeDomainId; VkBool32 reportComplete; } VkPastPresentationTimingEXT; typedef struct VkPastPresentationTimingPropertiesEXT { VkStructureType sType; const void *pNext; uint64_t timingPropertiesCounter; uint64_t timeDomainsCounter; uint32_t presentationTimingCount; VkPastPresentationTimingEXT *pPresentationTimings; } VkPastPresentationTimingPropertiesEXT; typedef VkFlags VkPastPresentationTimingFlagsEXT; typedef enum VkPastPresentationTimingFlagBitsEXT { VK_PAST_PRESENTATION_TIMING_ALLOW_PARTIAL_RESULTS_BIT_EXT = 0x00000001, VK_PAST_PRESENTATION_TIMING_ALLOW_OUT_OF_ORDER_RESULTS_BIT_EXT = 0x00000002, } VkPastPresentationTimingFlagBitsEXT; typedef enum VkPresentTimingInfoFlagBitsEXT { VK_PRESENT_TIMING_INFO_PRESENT_AT_RELATIVE_TIME_BIT_EXT = 0x00000001, VK_PRESENT_TIMING_INFO_PRESENT_AT_NEAREST_REFRESH_CYCLE_BIT_EXT = 0x00000002, } VkPresentTimingInfoFlagBitsEXT; typedef struct VkPastPresentationTimingInfoEXT { VkStructureType sType; const void *pNext; VkPastPresentationTimingFlagsEXT flags; VkSwapchainKHR swapchain; } VkPastPresentationTimingInfoEXT; typedef struct VkPresentTimingInfoEXT { VkStructureType sType; const void *pNext; VkPresentTimingInfoFlagsEXT flags; uint64_t targetTime; uint64_t timeDomainId; VkPresentStageFlagsEXT presentStageQueries; } VkPresentTimingInfoEXT; typedef struct VkPresentTimingsInfoEXT { VkStructureType sType; const void *pNext; uint32_t swapchainCount; const VkPresentTimingInfoEXT *pTimingInfos; } VkPresentTimingsInfoEXT; typedef VkResult(VKAPI_PTR *PFN_vkGetSwapchainTimeDomainPropertiesEXT)( VkDevice device, VkSwapchainKHR swapchain, VkSwapchainTimeDomainPropertiesEXT *pSwapchainTimeDomainProperties, uint64_t *pTimeDomainsCounter); typedef VkResult(VKAPI_PTR *PFN_vkGetSwapchainTimingPropertiesEXT)( VkDevice device, VkSwapchainKHR swapchain, VkSwapchainTimingPropertiesEXT *pSwapchainTimingProperties, uint64_t *pSwapchainTimingPropertiesCounter); typedef VkResult(VKAPI_PTR *PFN_vkSetSwapchainPresentTimingQueueSizeEXT)(VkDevice device, VkSwapchainKHR swapchain, uint32_t size); typedef VkResult(VKAPI_PTR *PFN_vkGetPastPresentationTimingEXT)( VkDevice device, const VkPastPresentationTimingInfoEXT *pPastPresentationTimingInfo, VkPastPresentationTimingPropertiesEXT *pPastPresentationTimingProperties); VWL_VKAPI_CALL(VkResult) wsi_layer_vkSetSwapchainPresentTimingQueueSizeEXT(VkDevice device, VkSwapchainKHR swapchain, uint32_t size) VWL_API_POST; VWL_VKAPI_CALL(VkResult) wsi_layer_vkGetSwapchainTimingPropertiesEXT(VkDevice device, VkSwapchainKHR swapchain, VkSwapchainTimingPropertiesEXT *pSwapchainTimingProperties, uint64_t *pSwapchainTimingPropertiesCounter) VWL_API_POST; VWL_VKAPI_CALL(VkResult) wsi_layer_vkGetSwapchainTimeDomainPropertiesEXT(VkDevice device, VkSwapchainKHR swapchain, VkSwapchainTimeDomainPropertiesEXT *pSwapchainTimeDomainProperties, uint64_t *pTimeDomainsCounter) VWL_API_POST; VWL_VKAPI_CALL(VkResult) wsi_layer_vkGetPastPresentationTimingEXT( VkDevice device, const VkPastPresentationTimingInfoEXT *pPastPresentationTimingInfo, VkPastPresentationTimingPropertiesEXT *pPastPresentationTimingProperties) VWL_API_POST; #endif