From 64b9cf5760478865147267fc9f195597cf4c8105 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 8 Mar 2023 12:15:45 -0500 Subject: [PATCH] zink: reset tc fb info upon splitting a renderpass not sure if this actually affects anything, but if a renderpass has to be split for some reason, ensure subsequent renderpasses don't lose data also ensure that rp data isn't lost when triggering primgen clears and delete a now-invalid assert Part-of: --- src/gallium/drivers/zink/zink_context.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 50086764773..007c03e8b9c 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -2795,6 +2795,13 @@ zink_batch_no_rp(struct zink_context *ctx) { if (!ctx->batch.in_rp) return; + if (zink_screen(ctx->base.screen)->driver_workarounds.track_renderpasses && !ctx->blitting) { + ctx->dynamic_fb.tc_info.data32[0] = 0; + ctx->dynamic_fb.tc_info.cbuf_load = BITFIELD_MASK(8); + ctx->dynamic_fb.tc_info.zsbuf_clear_partial = true; + ctx->dynamic_fb.tc_info.has_draw = true; + ctx->dynamic_fb.tc_info.has_query_ends = true; + } if (ctx->render_condition.query) zink_stop_conditional_render(ctx); /* suspend all queries that were started in a renderpass @@ -2849,7 +2856,6 @@ zink_prep_fb_attachment(struct zink_context *ctx, struct zink_surface *surf, uns } VkImageLayout layout; if (ctx->tc && zink_screen(ctx->base.screen)->driver_workarounds.track_renderpasses && !ctx->blitting) { - assert(threaded_context_get_renderpass_info(ctx->tc, false)->data == ctx->dynamic_fb.tc_info.data); layout = zink_tc_renderpass_info_parse(ctx, &ctx->dynamic_fb.tc_info, i < ctx->fb_state.nr_cbufs ? i : PIPE_MAX_COLOR_BUFS, &pipeline, &access); assert(i < ctx->fb_state.nr_cbufs || layout != VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL || !zink_fb_clear_enabled(ctx, PIPE_MAX_COLOR_BUFS)); if (i == ctx->fb_state.nr_cbufs && zink_fb_clear_enabled(ctx, PIPE_MAX_COLOR_BUFS))