NIR_PASS(progress, nir, nir_opt_loop_unroll, 0);
}
+ if (nir->info.stage == MESA_SHADER_FRAGMENT)
+ NIR_PASS_V(nir, nir_opt_move_discards_to_top);
+
if (sscreen->options.fp16)
NIR_PASS(progress, nir, nir_opt_vectorize, NULL, NULL);
} while (progress);
};
NIR_PASS_V(nir, nir_lower_subgroups, &subgroups_options);
+ NIR_PASS_V(nir, nir_lower_discard_or_demote,
+ sscreen->debug_flags & DBG(FS_CORRECT_DERIVS_AFTER_KILL));
+
/* Lower load constants to scalar and then clean up the mess */
NIR_PASS_V(nir, nir_lower_load_const_to_scalar);
NIR_PASS_V(nir, nir_lower_var_copies);
si_late_optimize_16bit_samplers(sscreen, nir);
NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_function_temp, NULL);
-
- NIR_PASS_V(nir, nir_lower_discard_or_demote,
- sscreen->debug_flags & DBG(FS_CORRECT_DERIVS_AFTER_KILL));
}
void si_finalize_nir(struct pipe_screen *screen, void *nirptr, bool optimize)