Mesa (main): zink: don't add batch tracking during buffer rebinds if refs are dirty

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 2 01:48:11 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Mon May 10 15:48:26 2021 -0400

zink: don't add batch tracking during buffer rebinds if refs are dirty

this will be handled automatically

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

---

 src/gallium/drivers/zink/zink_context.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index e679d884cb8..9eb6f124bd1 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -3142,7 +3142,8 @@ check_and_rebind_buffer(struct zink_context *ctx, struct zink_resource *res, uns
    }
 
    zink_screen(ctx->base.screen)->context_invalidate_descriptor_state(ctx, shader, type, i, 1);
-   zink_batch_reference_resource_rw(&ctx->batch, res, is_write);
+   if (!ctx->descriptor_refs_dirty[shader == PIPE_SHADER_COMPUTE])
+      zink_batch_reference_resource_rw(&ctx->batch, res, is_write);
    VkAccessFlags access = 0;
    if (is_read)
       access |= VK_ACCESS_SHADER_READ_BIT;
@@ -3212,7 +3213,7 @@ out:
    assert(total_binds == num_rebinds);
    if (!res->vbo_bind_count)
       return;
-   if (!num_rebinds)
+   if (!num_rebinds && !ctx->descriptor_refs_dirty[0])
       zink_batch_reference_resource_rw(&ctx->batch, res, false);
    ctx->vertex_buffers_dirty = true;
    zink_resource_buffer_barrier(ctx, NULL, res, VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT,



More information about the mesa-commit mailing list