zink: stop unsetting zink_gfx_pipeline::modules on shader unbind

this conflicts with the optimal_key

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37370>
(cherry picked from commit f7480771c6)
This commit is contained in:
Mike Blumenkrantz 2025-09-10 16:09:28 -04:00 committed by Eric Engestrom
parent d4353d5def
commit 8e7efd9822
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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;