From 1d3f52f78f2a2fa08e9a86bb2cbc315fb411049c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 28 Aug 2025 07:47:56 -0400 Subject: [PATCH] zink: fixes for flushing clears * immediately terminate renderpass after flushing this otherwise could persist and trigger a bad state where the zsbuf is eliminated * no-op if already in renderpass this function can be called from within a renderpass, at which time it should do nothing because clears will be flushed automatically Fixes: 5de34e47ad6 ("zink: unify/fix clear flushing") Part-of: --- src/gallium/drivers/zink/ci/zink-lavapipe-fails.txt | 8 -------- src/gallium/drivers/zink/zink_context.c | 5 +++++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/zink/ci/zink-lavapipe-fails.txt b/src/gallium/drivers/zink/ci/zink-lavapipe-fails.txt index 4c04bf15c9e..864b46a3d74 100644 --- a/src/gallium/drivers/zink/ci/zink-lavapipe-fails.txt +++ b/src/gallium/drivers/zink/ci/zink-lavapipe-fails.txt @@ -132,11 +132,3 @@ wayland-dEQP-EGL.functional.resize.surface_size.grow,Fail wayland-dEQP-EGL.functional.resize.surface_size.shrink,Fail wayland-dEQP-EGL.functional.resize.surface_size.stretch_height,Fail wayland-dEQP-EGL.functional.resize.surface_size.stretch_width,Fail - -# Failing since https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37024 -# It got merged since this weird job succeeded without running any tests: -# https://gitlab.freedesktop.org/mesa/mesa/-/jobs/83398228 -spec@arb_depth_buffer_float@fbo-clear-formats stencil,Fail -spec@arb_depth_buffer_float@fbo-clear-formats stencil@GL_DEPTH32F_STENCIL8,Fail -spec@ext_packed_depth_stencil@fbo-clear-formats stencil,Fail -spec@ext_packed_depth_stencil@fbo-clear-formats stencil@GL_DEPTH_STENCIL,Fail diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 33857a35dda..cf31c635cec 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -3384,6 +3384,10 @@ zink_batch_no_rp(struct zink_context *ctx) static void zink_flush_clears(struct zink_context *ctx) { + /* may be called recursively, e.g., from texture_barrier */ + if (ctx->in_rp) + return; + struct zink_screen *screen = zink_screen(ctx->base.screen); bool general_layout = screen->driver_workarounds.general_layout; bool queries_disabled = ctx->queries_disabled; @@ -3427,6 +3431,7 @@ zink_flush_clears(struct zink_context *ctx) ctx->blitting = blitting; if (!blitting) ctx->fb_state = fb; + zink_batch_no_rp(ctx); } static uint32_t