diff options
author | Kenneth Graunke <[email protected]> | 2015-09-17 08:38:10 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2015-09-21 13:46:45 -0700 |
commit | 967a5ddb88d248aa317964c9b0951332b2494aab (patch) | |
tree | 9646d494224c965f45a25df136f613912233ca52 /src/glsl | |
parent | 60befc63470a9cf1ac59ca74cd0a8164a25db09e (diff) |
nir: Report progress from nir_lower_globals_vars_to_local().
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/nir/nir.h | 2 | ||||
-rw-r--r-- | src/glsl/nir/nir_lower_global_vars_to_local.c | 6 |
2 files changed, 6 insertions, 2 deletions
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; } |