From 4a634a56bb6e5ae50b9c9008c2409ef0dfb967f6 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Fri, 15 Aug 2025 11:11:34 -0400 Subject: [PATCH] vulkan/sync: Return early in vk_sync_timeline_wait() if wait_value == 0 This is a trivial case so we don't even need to take the lock. Reviewed-by: Lars-Ivar Hesselberg Simonsen Reviewed-by: Adam Jackson Reviewed-by: Lionel Landwerlin Part-of: --- src/vulkan/runtime/vk_sync_timeline.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vulkan/runtime/vk_sync_timeline.c b/src/vulkan/runtime/vk_sync_timeline.c index 0d392f28418..4df11d81bda 100644 --- a/src/vulkan/runtime/vk_sync_timeline.c +++ b/src/vulkan/runtime/vk_sync_timeline.c @@ -563,6 +563,8 @@ vk_sync_timeline_wait(struct vk_device *device, uint64_t abs_timeout_ns) { struct vk_sync_timeline_state *state = to_vk_sync_timeline_state(sync); + if (wait_value == 0) + return VK_SUCCESS; mtx_lock(&state->mutex); VkResult result = vk_sync_timeline_wait_locked(device, state,