nir: Report progress from nir_lower_globals_vars_to_local().
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 17 Sep 2015 15:38:10 +0000 (08:38 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 21 Sep 2015 20:46:45 +0000 (13:46 -0700)
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/glsl/nir/nir.h
src/glsl/nir/nir_lower_global_vars_to_local.c

index 666a70fe5c7ddbb086813ae8f4a2f0edc5e3630b..3d071b17ce302e7e0818c784d0e15db14399cdd5 100644 (file)
@@ -1809,7 +1809,7 @@ void nir_split_var_copies(nir_shader *shader);
 void nir_lower_var_copy_instr(nir_intrinsic_instr *copy, void *mem_ctx);
 void nir_lower_var_copies(nir_shader *shader);
 
-void nir_lower_global_vars_to_local(nir_shader *shader);
+bool nir_lower_global_vars_to_local(nir_shader *shader);
 
 void nir_lower_locals_to_regs(nir_shader *shader);
 
index 0cd8740cc12fd8f4cb964857ed22bcf64010af5c..fab236611a55b741836aea4fd7ddc8cabf4a48df 100644 (file)
@@ -73,10 +73,11 @@ mark_global_var_uses_block(nir_block *block, void *void_state)
    return true;
 }
 
-void
+bool
 nir_lower_global_vars_to_local(nir_shader *shader)
 {
    struct global_to_local_state state;
+   bool progress = false;
 
    state.var_func_table = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
                                                   _mesa_key_pointer_equal);
@@ -99,8 +100,11 @@ nir_lower_global_vars_to_local(nir_shader *shader)
          exec_node_remove(&var->node);
          var->data.mode = nir_var_local;
          exec_list_push_tail(&impl->locals, &var->node);
+         progress = true;
       }
    }
 
    _mesa_hash_table_destroy(state.var_func_table, NULL);
+
+   return progress;
 }