{
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,
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 */);