Mesa (master): iris: Wrap iris_fix_edge_flags in NIR_PASS

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Nov 14 22:50:56 UTC 2019


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Thu Nov 14 10:22:17 2019 -0800

iris: Wrap iris_fix_edge_flags in NIR_PASS

So nir_validate happens properly.  Unfortunately this means we have
to play the metadata song and dance, so walk over all impls and say
that we didn't hurt anything.

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/gallium/drivers/iris/iris_program.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c
index 04f28a7dd8e..f2269a4a147 100644
--- a/src/gallium/drivers/iris/iris_program.c
+++ b/src/gallium/drivers/iris/iris_program.c
@@ -212,6 +212,15 @@ iris_fix_edge_flags(nir_shader *nir)
    nir->info.inputs_read &= ~VERT_BIT_EDGEFLAG;
    nir_fixup_deref_modes(nir);
 
+   nir_foreach_function(f, nir) {
+      if (f->impl) {
+         nir_metadata_preserve(f->impl, nir_metadata_block_index |
+                                        nir_metadata_dominance |
+                                        nir_metadata_live_ssa_defs |
+                                        nir_metadata_loop_analysis);
+      }
+   }
+
    return true;
 }
 
@@ -2017,7 +2026,7 @@ iris_create_uncompiled_shader(struct pipe_context *ctx,
    if (!ish)
       return NULL;
 
-   ish->needs_edge_flag = iris_fix_edge_flags(nir);
+   NIR_PASS(ish->needs_edge_flag, nir, iris_fix_edge_flags);
 
    brw_preprocess_nir(screen->compiler, nir, NULL);
 




More information about the mesa-commit mailing list