zink: use vkGetFenceStatus when we're obviously checking for status

a timeout of 0 indicates that gallium wants to know whether a fence is done,
so we can use a simpler call here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9154>
This commit is contained in:
Mike Blumenkrantz 2020-09-29 15:25:47 -04:00 committed by Marge Bot
parent 79861e3d88
commit 31dd0a4a1e

View file

@ -113,8 +113,13 @@ zink_fence_finish(struct zink_screen *screen, struct zink_fence *fence,
{
if (!fence->submitted)
return true;
bool success = vkWaitForFences(screen->dev, 1, &fence->fence, VK_TRUE,
timeout_ns) == VK_SUCCESS;
bool success;
if (timeout_ns)
success = vkWaitForFences(screen->dev, 1, &fence->fence, VK_TRUE, timeout_ns) == VK_SUCCESS;
else
success = vkGetFenceStatus(screen->dev, fence->fence) == VK_SUCCESS;
if (success) {
if (fence->active_queries)
zink_prune_queries(screen, fence);