From: Kenneth Graunke Date: Thu, 17 Sep 2015 15:38:10 +0000 (-0700) Subject: nir: Report progress from nir_lower_globals_vars_to_local(). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=967a5ddb88d248aa317964c9b0951332b2494aab;p=mesa.git nir: Report progress from nir_lower_globals_vars_to_local(). Signed-off-by: Kenneth Graunke Reviewed-by: Jason Ekstrand --- diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index 666a70fe5c7..3d071b17ce3 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -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); diff --git a/src/glsl/nir/nir_lower_global_vars_to_local.c b/src/glsl/nir/nir_lower_global_vars_to_local.c index 0cd8740cc12..fab236611a5 100644 --- a/src/glsl/nir/nir_lower_global_vars_to_local.c +++ b/src/glsl/nir/nir_lower_global_vars_to_local.c @@ -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; }