Update the layer's readme and release notes with VK_KHR_present_wait2 support

1. Update the README file.
2. Remove the guards from the code.

Signed-off-by: Nir.Ekhauz <nir.ekhauz@arm.com>
Change-Id: Idf65baee25d09a3b4bc3b563455468bac4d5bddf
This commit is contained in:
Nir Ekhauz 2025-09-18 09:20:43 +00:00 committed by Rosen Zhelev
parent 4ed20527c3
commit 8c65fb2af7
13 changed files with 8 additions and 38 deletions

View file

@ -334,7 +334,7 @@ if (VULKAN_WSI_LAYER_EXPERIMENTAL)
target_sources(${PROJECT_NAME} PUBLIC ${PROJECT_SOURCE_DIR}/wsi/extensions/present_timing.cpp) target_sources(${PROJECT_NAME} PUBLIC ${PROJECT_SOURCE_DIR}/wsi/extensions/present_timing.cpp)
add_definitions("-DVULKAN_WSI_LAYER_EXPERIMENTAL=1") add_definitions("-DVULKAN_WSI_LAYER_EXPERIMENTAL=1")
else() else()
list(APPEND JSON_COMMANDS COMMAND sed -Ei '/VK_EXT_present_timing|VK_KHR_present_wait2/d' ${CMAKE_CURRENT_BINARY_DIR}/VkLayer_window_system_integration.json) list(APPEND JSON_COMMANDS COMMAND sed -Ei '/VK_EXT_present_timing/d' ${CMAKE_CURRENT_BINARY_DIR}/VkLayer_window_system_integration.json)
add_definitions("-DVULKAN_WSI_LAYER_EXPERIMENTAL=0") add_definitions("-DVULKAN_WSI_LAYER_EXPERIMENTAL=0")
endif() endif()

View file

@ -31,6 +31,7 @@ implements the following extensions:
* VK_EXT_present_mode_fifo_latest_ready (For Headless and Wayland only) * VK_EXT_present_mode_fifo_latest_ready (For Headless and Wayland only)
* VK_KHR_present_id2 * VK_KHR_present_id2
* VK_KHR_swapchain_mutable_format (For Headless and Wayland only) * VK_KHR_swapchain_mutable_format (For Headless and Wayland only)
* VK_KHR_present_wait2
## Building ## Building

View file

@ -397,14 +397,12 @@ VKAPI_ATTR VkResult create_device(VkPhysicalDevice physicalDevice, const VkDevic
device_data.set_present_wait_enabled(present_wait_features->presentWait); device_data.set_present_wait_enabled(present_wait_features->presentWait);
} }
#if VULKAN_WSI_LAYER_EXPERIMENTAL
auto *present_wait2_features = util::find_extension<VkPhysicalDevicePresentWait2FeaturesKHR>( auto *present_wait2_features = util::find_extension<VkPhysicalDevicePresentWait2FeaturesKHR>(
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_2_FEATURES_KHR, pCreateInfo->pNext); VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_2_FEATURES_KHR, pCreateInfo->pNext);
if (present_wait2_features != nullptr) if (present_wait2_features != nullptr)
{ {
device_data.set_present_wait2_enabled(present_wait2_features->presentWait2); device_data.set_present_wait2_enabled(present_wait2_features->presentWait2);
} }
#endif
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -514,14 +512,12 @@ wsi_layer_vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physical_device,
instance.disp.GetPhysicalDeviceFeatures2KHR(physical_device, pFeatures); instance.disp.GetPhysicalDeviceFeatures2KHR(physical_device, pFeatures);
#if VULKAN_WSI_LAYER_EXPERIMENTAL
auto *present_wait2_features = util::find_extension<VkPhysicalDevicePresentWait2FeaturesKHR>( auto *present_wait2_features = util::find_extension<VkPhysicalDevicePresentWait2FeaturesKHR>(
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_2_FEATURES_KHR, pFeatures->pNext); VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_2_FEATURES_KHR, pFeatures->pNext);
if (present_wait2_features != nullptr) if (present_wait2_features != nullptr)
{ {
present_wait2_features->presentWait2 = VK_TRUE; present_wait2_features->presentWait2 = VK_TRUE;
} }
#endif
auto *image_compression_control_swapchain_features = auto *image_compression_control_swapchain_features =
util::find_extension<VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT>( util::find_extension<VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT>(
@ -679,13 +675,12 @@ wsi_layer_vkGetDeviceProcAddr(VkDevice device, const char *funcName) VWL_API_POS
{ {
GET_PROC_ADDR(vkWaitForPresentKHR); GET_PROC_ADDR(vkWaitForPresentKHR);
} }
#if VULKAN_WSI_LAYER_EXPERIMENTAL
/* VK_KHR_present_wait2 */ /* VK_KHR_present_wait2 */
if (device_data.is_device_extension_enabled(VK_KHR_PRESENT_WAIT_2_EXTENSION_NAME)) if (device_data.is_device_extension_enabled(VK_KHR_PRESENT_WAIT_2_EXTENSION_NAME))
{ {
GET_PROC_ADDR(vkWaitForPresent2KHR); GET_PROC_ADDR(vkWaitForPresent2KHR);
} }
#endif
return device_data.disp.get_user_enabled_entrypoint(device, funcName); return device_data.disp.get_user_enabled_entrypoint(device, funcName);
} }

View file

@ -56,7 +56,6 @@ wsi_layer_vkWaitForPresentKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_
return ext->wait_for_present_id(present_id, timeout); return ext->wait_for_present_id(present_id, timeout);
} }
#if VULKAN_WSI_LAYER_EXPERIMENTAL
/** /**
* @brief Implements vkWaitForPresent2KHR Vulkan entrypoint. * @brief Implements vkWaitForPresent2KHR Vulkan entrypoint.
*/ */
@ -79,4 +78,3 @@ wsi_layer_vkWaitForPresent2KHR(VkDevice device, VkSwapchainKHR swapchain,
return ext->wait_for_present_id(pPresentWait2Info->presentId, pPresentWait2Info->timeout); return ext->wait_for_present_id(pPresentWait2Info->presentId, pPresentWait2Info->timeout);
} }
#endif

View file

@ -34,8 +34,6 @@ VWL_VKAPI_CALL(VkResult)
wsi_layer_vkWaitForPresentKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t present_id, wsi_layer_vkWaitForPresentKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t present_id,
uint64_t timeout) VWL_API_POST; uint64_t timeout) VWL_API_POST;
#if VULKAN_WSI_LAYER_EXPERIMENTAL
VWL_VKAPI_CALL(VkResult) VWL_VKAPI_CALL(VkResult)
wsi_layer_vkWaitForPresent2KHR(VkDevice device, VkSwapchainKHR swapchain, wsi_layer_vkWaitForPresent2KHR(VkDevice device, VkSwapchainKHR swapchain,
const VkPresentWait2InfoKHR *pPresentWait2Info) VWL_API_POST; const VkPresentWait2InfoKHR *pPresentWait2Info) VWL_API_POST;
#endif

View file

@ -473,8 +473,8 @@ device_private_data::device_private_data(instance_private_data &inst_data, VkPhy
, swapchain_maintenance1_enabled{ false } , swapchain_maintenance1_enabled{ false }
#if VULKAN_WSI_LAYER_EXPERIMENTAL #if VULKAN_WSI_LAYER_EXPERIMENTAL
, present_timing_enabled { true } , present_timing_enabled { true }
, present_wait2_enabled { false }
#endif #endif
, present_wait2_enabled { false }
, present_id2_enabled { false } , present_id2_enabled { false }
, present_mode_fifo_latest_ready_enabled { false } , present_mode_fifo_latest_ready_enabled { false }
/* clang-format on */ /* clang-format on */
@ -712,7 +712,6 @@ bool device_private_data::is_present_wait_enabled()
return present_wait_enabled; return present_wait_enabled;
} }
#if VULKAN_WSI_LAYER_EXPERIMENTAL
void device_private_data::set_present_wait2_enabled(bool enable) void device_private_data::set_present_wait2_enabled(bool enable)
{ {
present_wait2_enabled = enable; present_wait2_enabled = enable;
@ -722,7 +721,6 @@ bool device_private_data::is_present_wait2_enabled()
{ {
return present_wait2_enabled; return present_wait2_enabled;
} }
#endif
void device_private_data::set_present_mode_fifo_latest_ready_enabled(bool enable) void device_private_data::set_present_mode_fifo_latest_ready_enabled(bool enable)
{ {

View file

@ -383,9 +383,7 @@ private:
EP(GetSwapchainTimeDomainPropertiesEXT, VK_EXT_PRESENT_TIMING_EXTENSION_NAME, API_VERSION_MAX, false, ) \ EP(GetSwapchainTimeDomainPropertiesEXT, VK_EXT_PRESENT_TIMING_EXTENSION_NAME, API_VERSION_MAX, false, ) \
EP(GetSwapchainTimingPropertiesEXT, VK_EXT_PRESENT_TIMING_EXTENSION_NAME, API_VERSION_MAX, false, ) \ EP(GetSwapchainTimingPropertiesEXT, VK_EXT_PRESENT_TIMING_EXTENSION_NAME, API_VERSION_MAX, false, ) \
EP(SetSwapchainPresentTimingQueueSizeEXT, VK_EXT_PRESENT_TIMING_EXTENSION_NAME, API_VERSION_MAX, false, ) \ EP(SetSwapchainPresentTimingQueueSizeEXT, VK_EXT_PRESENT_TIMING_EXTENSION_NAME, API_VERSION_MAX, false, ) \
EP(GetPastPresentationTimingEXT, VK_EXT_PRESENT_TIMING_EXTENSION_NAME, API_VERSION_MAX, false, ) \ EP(GetPastPresentationTimingEXT, VK_EXT_PRESENT_TIMING_EXTENSION_NAME, API_VERSION_MAX, false, )
/* VK_KHR_present_wait2 */ \
EP(WaitForPresent2KHR, VK_KHR_PRESENT_WAIT_2_EXTENSION_NAME, API_VERSION_MAX, false, )
#else #else
#define DEVICE_ENTRYPOINTS_LIST_EXPERIMENTAL(EP) #define DEVICE_ENTRYPOINTS_LIST_EXPERIMENTAL(EP)
#endif #endif
@ -479,6 +477,8 @@ private:
EP(GetCalibratedTimestampsKHR, VK_KHR_CALIBRATED_TIMESTAMPS_EXTENSION_NAME, API_VERSION_MAX, false, ) \ EP(GetCalibratedTimestampsKHR, VK_KHR_CALIBRATED_TIMESTAMPS_EXTENSION_NAME, API_VERSION_MAX, false, ) \
/* VK_KHR_present_wait */ \ /* VK_KHR_present_wait */ \
EP(WaitForPresentKHR, VK_KHR_PRESENT_WAIT_EXTENSION_NAME, API_VERSION_MAX, false, ) \ EP(WaitForPresentKHR, VK_KHR_PRESENT_WAIT_EXTENSION_NAME, API_VERSION_MAX, false, ) \
/* VK_KHR_present_wait2 */ \
EP(WaitForPresent2KHR, VK_KHR_PRESENT_WAIT_2_EXTENSION_NAME, API_VERSION_MAX, false, ) \
/* Custom entrypoints */ \ /* Custom entrypoints */ \
DEVICE_ENTRYPOINTS_LIST_EXPANSION(EP) DEVICE_ENTRYPOINTS_LIST_EXPANSION(EP)
@ -981,7 +981,6 @@ public:
*/ */
bool is_present_wait_enabled(); bool is_present_wait_enabled();
#if VULKAN_WSI_LAYER_EXPERIMENTAL
/** /**
* @brief Set whether present wait2 feature is enabled. * @brief Set whether present wait2 feature is enabled.
* *
@ -995,7 +994,6 @@ public:
* @return true if supported, false otherwise. * @return true if supported, false otherwise.
*/ */
bool is_present_wait2_enabled(); bool is_present_wait2_enabled();
#endif
private: private:
/* Allow util::allocator to access the private constructor */ /* Allow util::allocator to access the private constructor */
@ -1065,13 +1063,13 @@ private:
* @brief Stores whether the device has enabled support for the present timing features. * @brief Stores whether the device has enabled support for the present timing features.
*/ */
bool present_timing_enabled{ false }; bool present_timing_enabled{ false };
#endif
/** /**
* @brief Stores whether the device supports the present wait2 feature. * @brief Stores whether the device supports the present wait2 feature.
* *
*/ */
bool present_wait2_enabled{ false }; bool present_wait2_enabled{ false };
#endif
/** /**
* @brief Stores whether the device supports the present ID2 feature. * @brief Stores whether the device supports the present ID2 feature.

View file

@ -106,14 +106,12 @@ VkResult surface_properties::get_surface_capabilities(VkPhysicalDevice physical_
present_id2_surface_cap->presentId2Supported = VK_TRUE; present_id2_surface_cap->presentId2Supported = VK_TRUE;
} }
#if VULKAN_WSI_LAYER_EXPERIMENTAL
auto present_wait2_surface_cap = util::find_extension<VkSurfaceCapabilitiesPresentWait2KHR>( auto present_wait2_surface_cap = util::find_extension<VkSurfaceCapabilitiesPresentWait2KHR>(
VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_WAIT_2_KHR, pSurfaceCapabilities->pNext); VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_WAIT_2_KHR, pSurfaceCapabilities->pNext);
if (present_wait2_surface_cap != nullptr) if (present_wait2_surface_cap != nullptr)
{ {
present_wait2_surface_cap->presentWait2Supported = VK_TRUE; present_wait2_surface_cap->presentWait2Supported = VK_TRUE;
} }
#endif
return VK_SUCCESS; return VK_SUCCESS;
} }

View file

@ -103,13 +103,9 @@ VkResult swapchain::add_required_extensions(VkDevice device, const VkSwapchainCr
} }
bool present_wait2; bool present_wait2;
#if VULKAN_WSI_LAYER_EXPERIMENTAL
constexpr VkSwapchainCreateFlagsKHR present_wait2_mask = constexpr VkSwapchainCreateFlagsKHR present_wait2_mask =
(VK_SWAPCHAIN_CREATE_PRESENT_ID_2_BIT_KHR | VK_SWAPCHAIN_CREATE_PRESENT_WAIT_2_BIT_KHR); (VK_SWAPCHAIN_CREATE_PRESENT_ID_2_BIT_KHR | VK_SWAPCHAIN_CREATE_PRESENT_WAIT_2_BIT_KHR);
present_wait2 = (swapchain_create_info->flags & present_wait2_mask) == present_wait2_mask; present_wait2 = (swapchain_create_info->flags & present_wait2_mask) == present_wait2_mask;
#else
present_wait2 = false;
#endif
if (m_device_data.is_present_wait_enabled() || present_wait2) if (m_device_data.is_present_wait_enabled() || present_wait2)
{ {

View file

@ -112,14 +112,12 @@ VkResult surface_properties::get_surface_capabilities(VkPhysicalDevice physical_
present_id2_surface_cap->presentId2Supported = VK_TRUE; present_id2_surface_cap->presentId2Supported = VK_TRUE;
} }
#if VULKAN_WSI_LAYER_EXPERIMENTAL
auto present_wait2_surface_cap = util::find_extension<VkSurfaceCapabilitiesPresentWait2KHR>( auto present_wait2_surface_cap = util::find_extension<VkSurfaceCapabilitiesPresentWait2KHR>(
VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_WAIT_2_KHR, surface_capabilities->pNext); VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_WAIT_2_KHR, surface_capabilities->pNext);
if (present_wait2_surface_cap != nullptr) if (present_wait2_surface_cap != nullptr)
{ {
present_wait2_surface_cap->presentWait2Supported = VK_TRUE; present_wait2_surface_cap->presentWait2Supported = VK_TRUE;
} }
#endif
return VK_SUCCESS; return VK_SUCCESS;
} }

View file

@ -110,13 +110,9 @@ VkResult swapchain::add_required_extensions(VkDevice device, const VkSwapchainCr
#endif #endif
bool present_wait2; bool present_wait2;
#if VULKAN_WSI_LAYER_EXPERIMENTAL
constexpr VkSwapchainCreateFlagsKHR present_wait2_mask = constexpr VkSwapchainCreateFlagsKHR present_wait2_mask =
(VK_SWAPCHAIN_CREATE_PRESENT_ID_2_BIT_KHR | VK_SWAPCHAIN_CREATE_PRESENT_WAIT_2_BIT_KHR); (VK_SWAPCHAIN_CREATE_PRESENT_ID_2_BIT_KHR | VK_SWAPCHAIN_CREATE_PRESENT_WAIT_2_BIT_KHR);
present_wait2 = (swapchain_create_info->flags & present_wait2_mask) == present_wait2_mask; present_wait2 = (swapchain_create_info->flags & present_wait2_mask) == present_wait2_mask;
#else
present_wait2 = false;
#endif
if (m_device_data.is_present_wait_enabled() || present_wait2) if (m_device_data.is_present_wait_enabled() || present_wait2)
{ {

View file

@ -126,14 +126,12 @@ VkResult surface_properties::get_surface_capabilities(VkPhysicalDevice physical_
present_id2_surface_cap->presentId2Supported = VK_TRUE; present_id2_surface_cap->presentId2Supported = VK_TRUE;
} }
#if VULKAN_WSI_LAYER_EXPERIMENTAL
auto present_wait2_surface_cap = util::find_extension<VkSurfaceCapabilitiesPresentWait2KHR>( auto present_wait2_surface_cap = util::find_extension<VkSurfaceCapabilitiesPresentWait2KHR>(
VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_WAIT_2_KHR, pSurfaceCapabilities->pNext); VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_WAIT_2_KHR, pSurfaceCapabilities->pNext);
if (present_wait2_surface_cap != nullptr) if (present_wait2_surface_cap != nullptr)
{ {
present_wait2_surface_cap->presentWait2Supported = VK_TRUE; present_wait2_surface_cap->presentWait2Supported = VK_TRUE;
} }
#endif
return VK_SUCCESS; return VK_SUCCESS;
} }

View file

@ -115,13 +115,9 @@ VkResult swapchain::add_required_extensions(VkDevice device, const VkSwapchainCr
} }
bool present_wait2; bool present_wait2;
#if VULKAN_WSI_LAYER_EXPERIMENTAL
constexpr VkSwapchainCreateFlagsKHR present_wait2_mask = constexpr VkSwapchainCreateFlagsKHR present_wait2_mask =
(VK_SWAPCHAIN_CREATE_PRESENT_ID_2_BIT_KHR | VK_SWAPCHAIN_CREATE_PRESENT_WAIT_2_BIT_KHR); (VK_SWAPCHAIN_CREATE_PRESENT_ID_2_BIT_KHR | VK_SWAPCHAIN_CREATE_PRESENT_WAIT_2_BIT_KHR);
present_wait2 = (swapchain_create_info->flags & present_wait2_mask) == present_wait2_mask; present_wait2 = (swapchain_create_info->flags & present_wait2_mask) == present_wait2_mask;
#else
present_wait2 = false;
#endif
if (m_device_data.is_present_wait_enabled() || present_wait2) if (m_device_data.is_present_wait_enabled() || present_wait2)
{ {