Mesa (master): nir: Move new edgeflag assert into the io_lowered case

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 25 16:57:49 UTC 2020


Module: Mesa
Branch: master
Commit: 2a9ffc24cc7a8d782c60265e6a28f0a0067b292c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2a9ffc24cc7a8d782c60265e6a28f0a0067b292c

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Aug 24 17:00:33 2020 -0700

nir: Move new edgeflag assert into the io_lowered case

We only need to assert this in the `io_lowered` case, which actually
uses num_outputs.  This assert also doesn't appear to hold on iris,
where num_outputs is showing up as 0 (because it's likely not yet set).

Fixes assertion failures in edgeflag related tests on iris, which
doesn't use the io_lowered path currently.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3456
Fixes: 484a60d5474 ("nir: generate lowered IO in nir_lower_passthrough_edgeflags")
Reviewed-by: Eric Anholt <eric at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6450>

---

 src/compiler/nir/nir_lower_passthrough_edgeflags.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_lower_passthrough_edgeflags.c b/src/compiler/nir/nir_lower_passthrough_edgeflags.c
index eb142ce600c..c048235d6fc 100644
--- a/src/compiler/nir/nir_lower_passthrough_edgeflags.c
+++ b/src/compiler/nir/nir_lower_passthrough_edgeflags.c
@@ -37,10 +37,12 @@ lower_impl(nir_function_impl *impl)
 
    /* The edge flag is the last input in st/mesa. */
    assert(shader->num_inputs == util_bitcount64(shader->info.inputs_read));
-   assert(shader->num_outputs == util_bitcount64(shader->info.outputs_written));
 
    /* Lowered IO only uses intrinsics. It doesn't use variables. */
    if (shader->info.io_lowered) {
+      assert(shader->num_outputs ==
+             util_bitcount64(shader->info.outputs_written));
+
       /* Load an edge flag. */
       nir_intrinsic_instr *load =
          nir_intrinsic_instr_create(shader, nir_intrinsic_load_input);



More information about the mesa-commit mailing list