From: Jason Ekstrand Date: Fri, 22 May 2020 03:24:28 +0000 (-0500) Subject: iris: Better handle metadata in NIR passes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=27b7b8992250252f319dfe75d7cf17e0355d368b;p=mesa.git iris: Better handle metadata in NIR passes Reviewed-by: Kenneth Graunke Part-of: --- 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); } }