diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index cd7724ca87e..d75e6ae298a 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -1882,8 +1882,15 @@ agx_preprocess_nir(nir_shader *nir) { NIR_PASS_V(nir, nir_lower_vars_to_ssa); - if (nir->info.stage == MESA_SHADER_VERTEX) + if (nir->info.stage == MESA_SHADER_VERTEX) { NIR_PASS_V(nir, nir_lower_point_size, 1.0, 0.0); + } else if (nir->info.stage == MESA_SHADER_FRAGMENT) { + /* Lower to maximum colour buffers, the excess stores will get cleaned up + * by tilebuffer lowering so they won't become real shader code. However, + * that depends on the shader key which we don't have at this point. + */ + NIR_PASS_V(nir, nir_lower_fragcolor, 8); + } /* Lower large arrays to scratch and small arrays to csel */ NIR_PASS_V(nir, nir_lower_vars_to_scratch, nir_var_function_temp, 16, diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index 474a93e6b0d..f47747b4aab 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -1265,8 +1265,6 @@ agx_compile_variant(struct agx_device *dev, struct agx_uncompiled_shader *so, memcpy(opts.rt, key->blend.rt, sizeof(opts.rt)); NIR_PASS_V(nir, nir_lower_blend, &opts); - NIR_PASS_V(nir, nir_lower_fragcolor, key->nr_cbufs); - if (key->sprite_coord_enable) { NIR_PASS_V(nir, nir_lower_texcoord_replace, key->sprite_coord_enable, false /* point coord is sysval */, false /* Y-invert */);