From 8e7efd982262810f9b361ac6b64b8eda4441120d Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 10 Sep 2025 16:09:28 -0400 Subject: [PATCH] zink: stop unsetting zink_gfx_pipeline::modules on shader unbind this conflicts with the optimal_key cc: mesa-stable Part-of: (cherry picked from commit f7480771c68e7b1590e53166c1e7e0ea8a3d2f0a) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_program.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index ec1b59df217..158ad7e294d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4124,7 +4124,7 @@ "description": "zink: stop unsetting zink_gfx_pipeline::modules on shader unbind", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 7debb335124..9a8e5ac66ab 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -622,6 +622,8 @@ zink_gfx_program_update(struct zink_context *ctx) for (unsigned i = 0; i < ZINK_GFX_SHADER_COUNT; i++) { if (prog->stages_present & ~ctx->dirty_gfx_stages & BITFIELD_BIT(i)) ctx->gfx_pipeline_state.modules[i] = prog->objs[i].mod; + else + ctx->gfx_pipeline_state.modules[i] = VK_NULL_HANDLE; } /* ensure variants are always updated if keys have changed since last use */ ctx->dirty_gfx_stages |= prog->stages_present; @@ -1818,7 +1820,6 @@ bind_gfx_stage(struct zink_context *ctx, gl_shader_stage stage, struct zink_shad ctx->shader_stages |= BITFIELD_BIT(stage); ctx->gfx_hash ^= ctx->gfx_stages[stage]->hash; } else { - ctx->gfx_pipeline_state.modules[stage] = VK_NULL_HANDLE; if (ctx->curr_program) ctx->gfx_pipeline_state.final_hash ^= ctx->curr_program->last_variant_hash; ctx->curr_program = NULL;