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 <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
This commit is contained in:
Faith Ekstrand 2025-08-15 11:11:34 -04:00 committed by Marge Bot
parent 415f4d7678
commit 4a634a56bb

View file

@ -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,