From 7215c4ef5fba349dbd5debb6c8fd336f1e3fef48 Mon Sep 17 00:00:00 2001 From: Mario Kleiner Date: Mon, 1 Jun 2026 08:24:40 +0200 Subject: [PATCH] wsi/wayland: Unconditionally assign present_timing.time_domain. This is a tiny simplification, which should not have any practical differences, except for a tiny bit more simple enablement of VK_GOOGLE_display_timing in a followup commit, and dropping one line of code. The time_domain can always be assigned, even if present_timing is not enabled (and neither is GOOGLE_display_timing), because 1. The field isn't used if none of these extensions is enabled. 2. The field would default to a valid initial value of zero == VK_TIME_DOMAIN_DEVICE_KHR anyway. 3. Even if wp_presentation_feedback is unavailable, and therefore presentation_clock_id has an "unknown clock" value of -1, the mapping through clock_id_to_vk_time_domain(-1) would again map to VK_TIME_DOMAIN_DEVICE_KHR. Iow. with or without the dropped if statement, the field gets a nominally valid value, and also a value that does not get used can do no harm. Signed-off-by: Mario Kleiner Reviewed-by: Hans-Kristian Arntzen Part-of: --- src/vulkan/wsi/wsi_common_wayland.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c index 73cc78c4c2d..c99846f763d 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -3843,10 +3843,7 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, chain->base.set_present_mode = wsi_wl_swapchain_set_present_mode; chain->base.set_timing_request = wsi_wl_swapchain_set_timing_request; chain->base.poll_timing_request = wsi_wl_swapchain_poll_timing_request; - if (pCreateInfo->flags & VK_SWAPCHAIN_CREATE_PRESENT_TIMING_BIT_EXT) { - chain->base.present_timing.time_domain = - clock_id_to_vk_time_domain(wsi_wl_surface->display->presentation_clock_id); - } + chain->base.present_timing.time_domain = clock_id_to_vk_time_domain(wsi_wl_surface->display->presentation_clock_id); chain->base.wait_for_present = wsi_wl_swapchain_wait_for_present; chain->base.wait_for_present2 = wsi_wl_swapchain_wait_for_present2; chain->base.present_mode = present_mode;