diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 62ab180b352..b04eda55da0 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -2092,7 +2092,6 @@ zink_bind_cs_state(struct pipe_context *pctx, ctx->shader_has_inlinable_uniforms_mask &= ~(1 << MESA_SHADER_COMPUTE); if (ctx->curr_compute) { - zink_batch_reference_program(ctx, &ctx->curr_compute->base); ctx->compute_pipeline_state.final_hash ^= ctx->compute_pipeline_state.module_hash; ctx->compute_pipeline_state.module = VK_NULL_HANDLE; ctx->compute_pipeline_state.module_hash = 0; @@ -2131,6 +2130,7 @@ static void zink_delete_cs_shader_state(struct pipe_context *pctx, void *cso) { struct zink_compute_program *comp = cso; + zink_batch_reference_program(zink_context(pctx), cso); zink_compute_program_reference(zink_screen(pctx->screen), &comp, NULL); }