Fix Wayland swapchain to support present_id2

Adding support for present_id2

Signed-off-by: Nir.Ekhauz <nir.ekhauz@arm.com>
Change-Id: Ie30caf423902fea9f2bc3341c3b61390b09c0f7c
This commit is contained in:
Nir Ekhauz 2025-09-17 09:20:46 +00:00 committed by Rosen Zhelev
parent 623f803387
commit ee6d45430f
2 changed files with 15 additions and 18 deletions

View file

@ -512,6 +512,8 @@ wsi_layer_vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physical_device,
present_wait_features->presentWait = VK_FALSE;
}
instance.disp.GetPhysicalDeviceFeatures2KHR(physical_device, pFeatures);
#if VULKAN_WSI_LAYER_EXPERIMENTAL
auto *present_wait2_features = util::find_extension<VkPhysicalDevicePresentWait2FeaturesKHR>(
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_2_FEATURES_KHR, pFeatures->pNext);
@ -521,8 +523,6 @@ wsi_layer_vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physical_device,
}
#endif
instance.disp.GetPhysicalDeviceFeatures2KHR(physical_device, pFeatures);
auto *image_compression_control_swapchain_features =
util::find_extension<VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT>(
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT, pFeatures->pNext);

View file

@ -599,16 +599,16 @@ void swapchain::present_image(const pending_present_request &pending_present)
}
#if VULKAN_WSI_LAYER_EXPERIMENTAL
if (m_device_data.is_present_id_enabled())
auto *present_id_ext = get_swapchain_extension<wsi_ext_present_id_wayland>();
if (present_id_ext != nullptr)
{
auto *ext = get_swapchain_extension<wsi_ext_present_id_wayland>(true);
if (m_wsi_surface->get_presentation_time_interface() != nullptr && pending_present.present_id)
{
wp_presentation *pres = m_wsi_surface->get_presentation_time_interface();
struct wp_presentation_feedback *feedback = wp_presentation_feedback(pres, m_wsi_surface->get_wl_surface());
wl_proxy_set_queue(reinterpret_cast<wl_proxy *>(feedback), m_buffer_queue);
presentation_feedback *feedback_obj =
ext->insert_into_pending_present_feedback_list(pending_present.present_id, feedback);
present_id_ext->insert_into_pending_present_feedback_list(pending_present.present_id, feedback);
if (feedback_obj == nullptr)
{
WSI_LOG_ERROR("Error adding to pending present feedback list");
@ -650,8 +650,6 @@ void swapchain::present_image(const pending_present_request &pending_present)
set_error_state(VK_ERROR_SURFACE_LOST_KHR);
}
if (m_device_data.is_present_id_enabled())
{
#if VULKAN_WSI_LAYER_EXPERIMENTAL
auto *ext = get_swapchain_extension<wsi_ext_present_id_wayland>();
if (ext != nullptr)
@ -667,7 +665,6 @@ void swapchain::present_image(const pending_present_request &pending_present)
#if VULKAN_WSI_LAYER_EXPERIMENTAL
}
#endif
}
}
void swapchain::destroy_image(swapchain_image &image)