Mesa (main): lavapipe: Fix vkWaitForFences for initially-signalled fences
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Oct 6 05:25:38 UTC 2021
Module: Mesa
Branch: main
Commit: b9617bc6218c932e5f504405b6acf157d5b2a3c1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b9617bc6218c932e5f504405b6acf157d5b2a3c1
Author: Pavel Asyutchenko <sventeam at yandex.ru>
Date: Thu Sep 30 22:34:40 2021 +0300
lavapipe: Fix vkWaitForFences for initially-signalled fences
Fences with VK_FENCE_CREATE_SIGNALED_BIT are created with
signalled=true and timeline=0, waiting on them without
submitting first returned VK_TIMEOUT instead of VK_SUCCESS.
Signed-off-by: Pavel Asyutchenko <sventeam at yandex.ru>
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13128>
---
src/gallium/frontends/lavapipe/lvp_device.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c
index 37615326240..b82bb829476 100644
--- a/src/gallium/frontends/lavapipe/lvp_device.c
+++ b/src/gallium/frontends/lavapipe/lvp_device.c
@@ -2089,7 +2089,7 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_WaitForFences(
struct lvp_fence *f = lvp_fence_from_handle(pFences[i]);
/* this is an unsubmitted fence: immediately bail out */
- if (!f->timeline)
+ if (!f->timeline && !f->signalled)
return VK_TIMEOUT;
if (!fence || f->timeline > fence->timeline)
fence = f;
@@ -2098,6 +2098,8 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_WaitForFences(
/* find lowest timeline id */
for (unsigned i = 0; i < fenceCount; i++) {
struct lvp_fence *f = lvp_fence_from_handle(pFences[i]);
+ if (f->signalled)
+ return VK_SUCCESS;
if (f->timeline && (!fence || f->timeline < fence->timeline))
fence = f;
}
More information about the mesa-commit
mailing list