From 32b4412d5491a8f69fc79802ec8a87922c8ef787 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 13 Aug 2025 13:55:50 -0400 Subject: [PATCH] zink: update gfx pipeline less frequently Part-of: --- src/gallium/drivers/zink/zink_draw.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp index 436152042df..2a0be73d89f 100644 --- a/src/gallium/drivers/zink/zink_draw.cpp +++ b/src/gallium/drivers/zink/zink_draw.cpp @@ -450,6 +450,7 @@ zink_draw(struct pipe_context *pctx, 0, 1, &mb, 0, NULL, 0, NULL); } + unsigned rp_state = ctx->gfx_pipeline_state.rp_state; zink_batch_rp(ctx); /* check dead swapchain */ if (unlikely(!ctx->in_rp)) @@ -520,7 +521,9 @@ zink_draw(struct pipe_context *pctx, if (have_streamout && ctx->dirty_so_targets) zink_emit_stream_output_targets(pctx); - bool pipeline_changed = update_gfx_pipeline(ctx, bs, mode); + bool pipeline_changed = rp_state != ctx->gfx_pipeline_state.rp_state || ctx->gfx_dirty || ctx->dirty_gfx_stages || prim_changed || BATCH_CHANGED ? + update_gfx_pipeline(ctx, bs, mode) : + false; if (BATCH_CHANGED || ctx->vp_state_changed || (DYNAMIC_STATE == ZINK_NO_DYNAMIC_STATE && pipeline_changed)) { VkViewport viewports[PIPE_MAX_VIEWPORTS];