intel/fs: rerun divergence prior to lowering non-uniform interpolate at sample

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 74a40cc4b6 ("intel/fs: move lower of non-uniform at_sample barycentric to NIR")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26797>
(cherry picked from commit 2437556d83bc588efb97b81468695879ff23529e)
This commit is contained in:
Lionel Landwerlin 2023-11-20 15:42:23 +02:00 committed by Eric Engestrom
parent 9b2d95ab13
commit 48608401a3
2 changed files with 11 additions and 2 deletions

View file

@ -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

View file

@ -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);