Mesa (main): zink: move fence reset to submit thread

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 22 21:08:01 UTC 2021


Module: Mesa
Branch: main
Commit: c1d06c402aa21745740933de79dddbdbdd38486a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c1d06c402aa21745740933de79dddbdbdd38486a

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed Jun  9 11:25:28 2021 -0400

zink: move fence reset to submit thread

try to reduce job queue latency

Acked-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11437>

---

 src/gallium/drivers/zink/zink_batch.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_batch.c b/src/gallium/drivers/zink/zink_batch.c
index a775b3dfb02..facbe5c3412 100644
--- a/src/gallium/drivers/zink/zink_batch.c
+++ b/src/gallium/drivers/zink/zink_batch.c
@@ -333,6 +333,8 @@ submit_queue(void *data, void *gdata, int thread_index)
    bs->usage.unflushed = false;
    simple_mtx_unlock(&ctx->batch_mtx);
 
+   vkResetFences(screen->dev, 1, &bs->fence.fence);
+
    uint64_t batch_id = bs->fence.batch_id;
    si.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
    si.waitSemaphoreCount = 0;
@@ -521,7 +523,6 @@ zink_end_batch(struct zink_context *ctx, struct zink_batch *batch)
       debug_printf("vkEndCommandBuffer failed\n");
       return;
    }
-   vkResetFences(zink_screen(ctx->base.screen)->dev, 1, &batch->state->fence.fence);
 
    struct zink_screen *screen = zink_screen(ctx->base.screen);
    while (util_dynarray_contains(&batch->state->persistent_resources, struct zink_resource_object*)) {



More information about the mesa-commit mailing list