Added few more stubs so that control reaches to DestroyDevice().
[mesa.git] / src / compiler / nir / nir_lower_global_vars_to_local.c
index 9efc511bcad440c3a30ea91d5df43f71b0f98959..770c33ca872bb7581cf6a4dd0bac5dc40214117c 100644 (file)
@@ -83,15 +83,13 @@ nir_lower_global_vars_to_local(nir_shader *shader)
       }
    }
 
-   nir_foreach_variable_safe(var, &shader->globals) {
+   nir_foreach_variable_with_modes_safe(var, shader, nir_var_shader_temp) {
       struct hash_entry *entry = _mesa_hash_table_search(var_func_table, var);
       if (!entry)
          continue;
 
       nir_function_impl *impl = entry->data;
 
-      assert(var->data.mode == nir_var_shader_temp);
-
       if (impl != NULL) {
          exec_node_remove(&var->node);
          var->data.mode = nir_var_function_temp;
@@ -108,13 +106,10 @@ nir_lower_global_vars_to_local(nir_shader *shader)
    if (progress)
       nir_fixup_deref_modes(shader);
 
-#ifndef NDEBUG
    nir_foreach_function(function, shader) {
-      if (function->impl) {
-         function->impl->valid_metadata &= ~nir_metadata_not_properly_reset;
-      }
+      if (function->impl)
+         nir_metadata_preserve(function->impl, nir_metadata_all);
    }
-#endif
 
    return progress;
 }