From 27b7b8992250252f319dfe75d7cf17e0355d368b Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 21 May 2020 22:24:28 -0500 Subject: [PATCH] iris: Better handle metadata in NIR passes Reviewed-by: Kenneth Graunke Part-of: --- src/gallium/drivers/iris/iris_program.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index 98c1c3e93e7..4790ef34576 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -267,8 +267,10 @@ iris_lower_storage_image_derefs(nir_shader *nir) static bool iris_fix_edge_flags(nir_shader *nir) { - if (nir->info.stage != MESA_SHADER_VERTEX) + if (nir->info.stage != MESA_SHADER_VERTEX) { + nir_shader_preserve_all_metadata(nir); return false; + } nir_variable *var = NULL; nir_foreach_variable(v, &nir->outputs) { @@ -278,8 +280,10 @@ iris_fix_edge_flags(nir_shader *nir) } } - if (!var) + if (!var) { + nir_shader_preserve_all_metadata(nir); return false; + } exec_node_remove(&var->node); var->data.mode = nir_var_shader_temp; @@ -294,6 +298,8 @@ iris_fix_edge_flags(nir_shader *nir) nir_metadata_dominance | nir_metadata_live_ssa_defs | nir_metadata_loop_analysis); + } else { + nir_metadata_preserve(f->impl, nir_metadata_all); } } -- 2.30.2