lavapipe: handle endless fence timeout properly.

If the users ask for an infinte timeout, just pass it through
to gallium.

When llvmpipe ends up allowing async fragment shaders, it's important
to get this right for lots of CTS tests.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
This commit is contained in:
Dave Airlie 2022-02-07 17:41:04 +10:00 committed by Marge Bot
parent 7a1426db66
commit 1f1e62c15d
1 changed files with 4 additions and 2 deletions

View File

@ -2242,8 +2242,10 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_WaitForFences(
if (!util_queue_fence_wait_timeout(&fence->fence, abs_timeout))
return VK_TIMEOUT;
int64_t time_ns = os_time_get_nano();
timeout = abs_timeout > time_ns ? abs_timeout - time_ns : 0;
if (timeout != OS_TIMEOUT_INFINITE) {
int64_t time_ns = os_time_get_nano();
timeout = abs_timeout > time_ns ? abs_timeout - time_ns : 0;
}
}
if (!fence->handle ||