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@yandex.ru>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13128>
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;
/* 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;
}