diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 1445271d3db..57bfe98149a 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -669,14 +669,15 @@ update_gfx_shader_module_optimal(struct zink_context *ctx, struct zink_gfx_progr static void update_gfx_program_optimal(struct zink_context *ctx, struct zink_gfx_program *prog) { + const union zink_shader_key_optimal *key = (union zink_shader_key_optimal*)&ctx->gfx_pipeline_state.optimal_key; const union zink_shader_key_optimal *last_prog_key = (union zink_shader_key_optimal*)&prog->last_variant_hash; - if (ctx->gfx_pipeline_state.shader_keys_optimal.key.vs_bits != last_prog_key->vs_bits) { + if (key->vs_bits != last_prog_key->vs_bits) { assert(!prog->is_separable); bool changed = update_gfx_shader_module_optimal(ctx, prog, ctx->last_vertex_stage->info.stage); ctx->gfx_pipeline_state.modules_changed |= changed; } const bool shadow_needs_shader_swizzle = last_prog_key->fs.shadow_needs_shader_swizzle && (ctx->dirty_gfx_stages & BITFIELD_BIT(MESA_SHADER_FRAGMENT)); - if (ctx->gfx_pipeline_state.shader_keys_optimal.key.fs_bits != last_prog_key->fs_bits || + if (key->fs_bits != last_prog_key->fs_bits || /* always recheck shadow swizzles since they aren't directly part of the key */ unlikely(shadow_needs_shader_swizzle)) { assert(!prog->is_separable); @@ -688,7 +689,7 @@ update_gfx_program_optimal(struct zink_context *ctx, struct zink_gfx_program *pr } } if (prog->shaders[MESA_SHADER_TESS_CTRL] && prog->shaders[MESA_SHADER_TESS_CTRL]->non_fs.is_generated && - ctx->gfx_pipeline_state.shader_keys_optimal.key.tcs_bits != last_prog_key->tcs_bits) { + key->tcs_bits != last_prog_key->tcs_bits) { assert(!prog->is_separable); bool changed = update_gfx_shader_module_optimal(ctx, prog, MESA_SHADER_TESS_CTRL); ctx->gfx_pipeline_state.modules_changed |= changed;