Mesa (master): zink: use vkGetFenceStatus when we're obviously checking for status

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 19 04:51:47 UTC 2021


Module: Mesa
Branch: master
Commit: 31dd0a4a1e509c7cfbdf2cc015a89d58ffbdc896
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=31dd0a4a1e509c7cfbdf2cc015a89d58ffbdc896

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue Sep 29 15:25:47 2020 -0400

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 at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9154>

---

 src/gallium/drivers/zink/zink_fence.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_fence.c b/src/gallium/drivers/zink/zink_fence.c
index a45540201de..9733ad0a1fc 100644
--- a/src/gallium/drivers/zink/zink_fence.c
+++ b/src/gallium/drivers/zink/zink_fence.c
@@ -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);



More information about the mesa-commit mailing list