From 4242c572275138ec832c6a450cbf8891268e15b8 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 14 Nov 2019 10:22:17 -0800 Subject: [PATCH] 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 --- 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); -- 2.30.2