From 419879ee6292506c79a3f1342161663cac77b33c Mon Sep 17 00:00:00 2001 From: Job Noorman Date: Thu, 19 Dec 2024 17:46:46 +0100 Subject: [PATCH] ir3,freedreno: remove binning outputs after vs ucp lowering nir_lower_clip_vs relies on VARYING_SLOT_CLIP_VERTEX which gets removed when removing the outputs that are unused by the binning vs. Fix this by only removing the outputs after running nir_lower_clip_vs. Signed-off-by: Job Noorman Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12328 Fixes: 24b422dc3ec ("ir3: remove unused outputs for binning pass in NIR") Part-of: --- src/freedreno/ir3/ir3_nir.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/freedreno/ir3/ir3_nir.c b/src/freedreno/ir3/ir3_nir.c index 000455491fa..57a954aa348 100644 --- a/src/freedreno/ir3/ir3_nir.c +++ b/src/freedreno/ir3/ir3_nir.c @@ -1032,15 +1032,6 @@ ir3_nir_lower_variant(struct ir3_shader_variant *so, } } - if (so->binning_pass) { - if (OPT(s, lower_binning)) { - progress = true; - - /* outputs_written has changed. */ - nir_shader_gather_info(s, nir_shader_get_entrypoint(s)); - } - } - /* Note that it is intentional to use the VS lowering pass for GS, since we * lower GS into something that looks more like a VS in ir3_nir_lower_gs(): */ @@ -1051,6 +1042,15 @@ ir3_nir_lower_variant(struct ir3_shader_variant *so, progress |= OPT(s, nir_lower_clip_fs, so->key.ucp_enables, true, true); } + if (so->binning_pass) { + if (OPT(s, lower_binning)) { + progress = true; + + /* outputs_written has changed. */ + nir_shader_gather_info(s, nir_shader_get_entrypoint(s)); + } + } + /* Move large constant variables to the constants attached to the NIR * shader, which we will upload in the immediates range. This generates * amuls, so we need to clean those up after.