zink: toggle conditional render when beginning/ending a renderpass

this resumes the same conditional render which was previously active

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9783>
This commit is contained in:
Mike Blumenkrantz 2021-02-05 17:36:44 -05:00 committed by Marge Bot
parent 4e23816243
commit 40cc265888
2 changed files with 13 additions and 3 deletions

View File

@ -1316,14 +1316,19 @@ zink_begin_render_pass(struct zink_context *ctx, struct zink_batch *batch)
vkCmdBeginRenderPass(batch->state->cmdbuf, &rpbi, VK_SUBPASS_CONTENTS_INLINE);
batch->in_rp = true;
if (ctx->render_condition.query)
zink_start_conditional_render(ctx);
zink_clear_framebuffer(ctx, clear_buffers);
}
static void
zink_end_render_pass(struct zink_context *ctx, struct zink_batch *batch)
{
if (batch->in_rp)
if (batch->in_rp) {
if (ctx->render_condition.query)
zink_stop_conditional_render(ctx);
vkCmdEndRenderPass(batch->state->cmdbuf);
}
batch->in_rp = false;
}

View File

@ -689,7 +689,11 @@ zink_render_condition(struct pipe_context *pctx,
VkQueryResultFlagBits flags = 0;
if (query == NULL) {
zink_stop_conditional_render(ctx);
/* force conditional clears if they exist */
if (ctx->clears_enabled && !ctx->batch.in_rp)
zink_batch_rp(ctx);
if (ctx->batch.in_rp)
zink_stop_conditional_render(ctx);
ctx->render_condition_active = false;
ctx->render_condition.query = NULL;
return;
@ -725,7 +729,8 @@ zink_render_condition(struct pipe_context *pctx,
ctx->render_condition.inverted = condition;
ctx->render_condition_active = true;
ctx->render_condition.query = query;
zink_start_conditional_render(ctx);
if (ctx->batch.in_rp)
zink_start_conditional_render(ctx);
}
static void