diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index 657837dfedd..383c0c02286 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -1481,6 +1481,9 @@ agx_compile_shader_nir(nir_shader *nir, agx_optimize_nir(nir); + /* Implement conditional discard with real control flow like Metal */ + NIR_PASS_V(nir, nir_lower_discard_if); + /* Must be last since NIR passes can remap driver_location freely */ if (ctx->stage == MESA_SHADER_VERTEX) { agx_remap_varyings_vs(nir, &out->varyings, ctx->varyings);