zink: flag some rp ends as unsafe
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Mon, 20 Mar 2023 13:43:50 +0000 (09:43 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 21 Mar 2023 01:39:39 +0000 (01:39 +0000)
the only "safe" rp ends are:
* set_framebuffer_state (new rp)
* flush_resource (present)
* flush (end of rp)

any other rp end needs its rp info sanitized to avoid e.g., reapplying clears

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>

src/gallium/drivers/zink/zink_context.c
src/gallium/drivers/zink/zink_render_pass.c

index 7d72e38..13e882e 100644 (file)
@@ -2710,7 +2710,7 @@ begin_rendering(struct zink_context *ctx)
    if (!rp_changed && ctx->batch.in_rp)
       return 0;
 
-   zink_batch_no_rp_safe(ctx);
+   zink_batch_no_rp(ctx);
    for (int i = 0; i < ctx->fb_state.nr_cbufs; i++) {
       struct zink_surface *surf = zink_csurface(ctx->fb_state.cbufs[i]);
       VkImageView iv = zink_prep_fb_attachment(ctx, surf, i);
@@ -2797,7 +2797,7 @@ zink_batch_rp(struct zink_context *ctx)
          /* this is a driver that doesn't need dummy surfaces but does need rasterization discard, so flush clears first */
          ctx->queries_disabled = true;
          zink_batch_rp(ctx);
-         zink_batch_no_rp_safe(ctx);
+         zink_batch_no_rp(ctx);
          ctx->queries_disabled = false;
       }
       zink_resume_queries(ctx, &ctx->batch);
index 18e7be9..f101f42 100644 (file)
@@ -614,7 +614,7 @@ setup_framebuffer(struct zink_context *ctx)
    zink_init_framebuffer(screen, ctx->framebuffer, rp);
    ctx->fb_changed = false;
    ctx->gfx_pipeline_state.render_pass = rp;
-   zink_batch_no_rp_safe(ctx);
+   zink_batch_no_rp(ctx);
 }
 
 static bool