diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index 289d795f812..b9c30fae976 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -1370,8 +1370,6 @@ agx_compile_variant(struct agx_device *dev, struct agx_uncompiled_shader *so, nir_shader *nir = nir_shader_clone(NULL, so->nir); - agx_preprocess_nir(nir); - if (nir->info.stage == MESA_SHADER_VERTEX) { struct asahi_vs_shader_key *key = &key_->vs; @@ -1503,6 +1501,7 @@ agx_create_shader_state(struct pipe_context *pctx, blob_finish(&blob); so->nir = nir; + agx_preprocess_nir(nir); /* For shader-db, precompile a shader with a default key. This could be * improved but hopefully this is acceptable for now. @@ -1564,6 +1563,7 @@ agx_create_compute_state(struct pipe_context *pctx, blob_finish(&blob); so->nir = nir; + agx_preprocess_nir(nir); agx_get_shader_variant(agx_screen(pctx->screen), so, &pctx->debug, &key); /* We're done with the NIR, throw it away */