From c338f7ae7897c1b65013b2295e347d358b2ac176 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 26 Sep 2022 13:46:10 -0400 Subject: [PATCH] zink: copy optimal key always this is going away in the future, but for now it's annoying Fixes: 7336580408a ("zink: unspaghettify some program update code") Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_program.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 7177c31d862..9feb19a7624 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -631,6 +631,7 @@ zink_gfx_program_update_optimal(struct zink_context *ctx) { if (ctx->gfx_dirty) { struct zink_gfx_program *prog = NULL; + ctx->gfx_pipeline_state.optimal_key = ctx->gfx_pipeline_state.shader_keys_optimal.key.val; struct hash_table *ht = &ctx->program_cache[zink_program_cache_stages(ctx->shader_stages)]; const uint32_t hash = ctx->gfx_hash; simple_mtx_lock(&ctx->program_lock[zink_program_cache_stages(ctx->shader_stages)]); @@ -640,7 +641,6 @@ zink_gfx_program_update_optimal(struct zink_context *ctx) ctx->gfx_pipeline_state.final_hash ^= ctx->curr_program->last_variant_hash; if (entry) { prog = (struct zink_gfx_program*)entry->data; - ctx->gfx_pipeline_state.optimal_key = ctx->gfx_pipeline_state.shader_keys_optimal.key.val; update_gfx_program_optimal(ctx, prog); } else { ctx->dirty_gfx_stages |= ctx->shader_stages; @@ -655,6 +655,7 @@ zink_gfx_program_update_optimal(struct zink_context *ctx) ctx->gfx_pipeline_state.final_hash ^= ctx->curr_program->last_variant_hash; } else if (ctx->dirty_gfx_stages) { /* remove old hash */ + ctx->gfx_pipeline_state.optimal_key = ctx->gfx_pipeline_state.shader_keys_optimal.key.val; ctx->gfx_pipeline_state.final_hash ^= ctx->curr_program->last_variant_hash; update_gfx_program_optimal(ctx, ctx->curr_program); /* apply new hash */