ac/nir/ngg: Call nir_convert_to_lcssa before divergence analysis.

I've recently learned that this is necessary to get
correct results from divergence analysis.

No Fossil DB stats changes on GFX10.3.

Note, when backporting this patch to stable, make sure
the call to nir_convert_to_lcssa is before nir_divergence_analysis,
which may be located in a different place in the stable branch.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23946>
This commit is contained in:
Timur Kristóf 2023-03-31 22:10:05 +02:00 committed by Marge Bot
parent ac61162e2a
commit ddeabcc19b

View file

@ -1103,6 +1103,8 @@ analyze_shader_before_culling_walk(nir_ssa_def *ssa,
static void
analyze_shader_before_culling(nir_shader *shader, lower_ngg_nogs_state *s)
{
/* LCSSA is needed to get correct results from divergence analysis. */
nir_convert_to_lcssa(shader, true, true);
/* We need divergence info for culling shaders. */
nir_divergence_analysis(shader);