NIR_PASS_V(nir, nir_lower_ssbo);
if (nir->info.stage == MESA_SHADER_FRAGMENT) {
NIR_PASS_V(nir, agx_nir_lower_frag_sidefx);
- NIR_PASS_V(nir, agx_nir_lower_zs_emit);
/* Interpolate varyings at fp16 and write to the tilebuffer at fp16. As an
* exception, interpolate flat shaded at fp32. This works around a
out->depth_layout = layout;
}
+ /* Late clip plane lowering created discards */
+ if (nir->info.stage == MESA_SHADER_FRAGMENT) {
+ NIR_PASS_V(nir, agx_nir_lower_zs_emit);
+ }
+
/* Late sysval lowering creates large loads. Load lowering creates unpacks */
NIR_PASS_V(nir, nir_lower_mem_access_bit_sizes,
nir_var_mem_ssbo | nir_var_mem_constant |