diff --git a/.pick_status.json b/.pick_status.json index 2215d804b2c..bb104e2d772 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1114,7 +1114,7 @@ "description": "intel/fs: rerun divergence prior to lowering non-uniform interpolate at sample", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "74a40cc4b6ed9440a0820c6f4a9cee296a8e191a", "notes": null diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index ceb599d20e5..4e331288b59 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -1685,6 +1685,7 @@ brw_postprocess_nir(nir_shader *nir, const struct brw_compiler *compiler, OPT(nir_opt_move, nir_move_comparisons); OPT(nir_opt_dead_cf); + bool divergence_analysis_dirty = false; NIR_PASS(_, nir, nir_convert_to_lcssa, true, true); NIR_PASS_V(nir, nir_divergence_analysis); @@ -1710,11 +1711,19 @@ brw_postprocess_nir(nir_shader *nir, const struct brw_compiler *compiler, if (OPT(nir_lower_int64)) brw_nir_optimize(nir, is_scalar, devinfo); + + divergence_analysis_dirty = true; } /* Do this only after the last opt_gcm. GCM will undo this lowering. */ - if (nir->info.stage == MESA_SHADER_FRAGMENT) + if (nir->info.stage == MESA_SHADER_FRAGMENT) { + if (divergence_analysis_dirty) { + NIR_PASS(_, nir, nir_convert_to_lcssa, true, true); + NIR_PASS_V(nir, nir_divergence_analysis); + } + OPT(brw_nir_lower_non_uniform_barycentric_at_sample); + } /* Clean up LCSSA phis */ OPT(nir_opt_remove_phis);