{
bool progress = false;
+ /* Only some variables have initializers that we want to lower. Others
+ * such as uniforms have initializers which are useful later during linking
+ * so we want to skip over those. Restrict to only variable types where
+ * initializers make sense so that callers can use nir_var_all.
+ */
+ modes &= nir_var_shader_out |
+ nir_var_shader_temp |
+ nir_var_function_temp |
+ nir_var_system_value;
+
nir_foreach_function(function, shader) {
if (!function->impl)
continue;
nir_metadata_dominance |
nir_metadata_live_ssa_defs);
} else {
-#ifndef NDEBUG
- function->impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-#endif
+ nir_metadata_preserve(function->impl, nir_metadata_all);
}
}