From 0e1742ba028a33bcad8a1fa29232ca15962debc4 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 27 Nov 2020 12:14:30 -0500 Subject: [PATCH] zink: do batch-program tracking after possibly cycling batch in update_descriptors() ensure we have the right batch here Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_draw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/zink/zink_draw.c b/src/gallium/drivers/zink/zink_draw.c index a27711bd9bc..5103188438a 100644 --- a/src/gallium/drivers/zink/zink_draw.c +++ b/src/gallium/drivers/zink/zink_draw.c @@ -519,11 +519,6 @@ update_descriptors(struct zink_context *ctx, struct zink_screen *screen, bool is dsl = ctx->curr_program->base.dsl; } - if (is_compute) - zink_batch_reference_program(batch, &ctx->curr_compute->base); - else - zink_batch_reference_program(batch, &ctx->curr_program->base); - if (batch->descs_used + num_descriptors >= batch->max_descs) { batch->descs_used += num_descriptors; if (is_compute) @@ -533,6 +528,11 @@ update_descriptors(struct zink_context *ctx, struct zink_screen *screen, bool is batch = zink_batch_rp(ctx); } } + if (is_compute) + zink_batch_reference_program(batch, &ctx->curr_compute->base); + else + zink_batch_reference_program(batch, &ctx->curr_program->base); + VkDescriptorSet desc_set = allocate_descriptor_set(screen, batch, dsl, num_descriptors); /* probably oom, so we need to stall until we free up some descriptors */