From ebbedb1c00643724896467aa9353a47c82a8b073 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 10 May 2021 15:48:26 -0400 Subject: [PATCH] zink: don't add batch tracking during buffer rebinds if refs are dirty this will be handled automatically Reviewed-by: Dave Airlie Part-of: --- 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,