zink: do batch-program tracking after possibly cycling batch in update_descriptors()

ensure we have the right batch here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9273>
This commit is contained in:
Mike Blumenkrantz 2020-11-27 12:14:30 -05:00 committed by Marge Bot
parent c7da40b2eb
commit 0e1742ba02
1 changed files with 5 additions and 5 deletions

View File

@ -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 */