diff options
author | Caio Marcelo de Oliveira Filho <[email protected]> | 2019-01-11 11:50:53 -0800 |
---|---|---|
committer | Caio Marcelo de Oliveira Filho <[email protected]> | 2019-01-14 10:49:28 -0800 |
commit | 9fdded0cc34b4bdb87923707c05b8ceffb2f174c (patch) | |
tree | b742e0cd4e33cd4766ed9f0b03c5c3eda2470556 /src/compiler/nir/nir_split_vars.c | |
parent | ee23e8b17c77fa94320168427fb8a10a84b50e94 (diff) |
src/compiler: use new hash table and set creation helpers
Replace calls to create hash tables and sets that use
_mesa_hash_pointer/_mesa_key_pointer_equal with the helpers
_mesa_pointer_hash_table_create() and _mesa_pointer_set_create().
Reviewed-by: Jason Ekstrand <[email protected]>
Acked-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_split_vars.c')
-rw-r--r-- | src/compiler/nir/nir_split_vars.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/compiler/nir/nir_split_vars.c b/src/compiler/nir/nir_split_vars.c index 5044d29f146..0cf3e517f85 100644 --- a/src/compiler/nir/nir_split_vars.c +++ b/src/compiler/nir/nir_split_vars.c @@ -257,8 +257,7 @@ nir_split_struct_vars(nir_shader *shader, nir_variable_mode modes) { void *mem_ctx = ralloc_context(NULL); struct hash_table *var_field_map = - _mesa_hash_table_create(mem_ctx, _mesa_hash_pointer, - _mesa_key_pointer_equal); + _mesa_pointer_hash_table_create(mem_ctx); assert((modes & (nir_var_private | nir_var_function)) == modes); @@ -793,9 +792,7 @@ bool nir_split_array_vars(nir_shader *shader, nir_variable_mode modes) { void *mem_ctx = ralloc_context(NULL); - struct hash_table *var_info_map = - _mesa_hash_table_create(mem_ctx, _mesa_hash_pointer, - _mesa_key_pointer_equal); + struct hash_table *var_info_map = _mesa_pointer_hash_table_create(mem_ctx); assert((modes & (nir_var_private | nir_var_function)) == modes); @@ -973,8 +970,7 @@ mark_deref_used(nir_deref_instr *deref, true, mem_ctx); if (copy_usage) { if (usage->vars_copied == NULL) { - usage->vars_copied = _mesa_set_create(mem_ctx, _mesa_hash_pointer, - _mesa_key_pointer_equal); + usage->vars_copied = _mesa_pointer_set_create(mem_ctx); } _mesa_set_add(usage->vars_copied, copy_usage); } else { @@ -1016,9 +1012,7 @@ mark_deref_used(nir_deref_instr *deref, ©_usage->levels[copy_i++]; if (level->levels_copied == NULL) { - level->levels_copied = - _mesa_set_create(mem_ctx, _mesa_hash_pointer, - _mesa_key_pointer_equal); + level->levels_copied = _mesa_pointer_set_create(mem_ctx); } _mesa_set_add(level->levels_copied, copy_level); } else { @@ -1523,8 +1517,7 @@ nir_shrink_vec_array_vars(nir_shader *shader, nir_variable_mode modes) void *mem_ctx = ralloc_context(NULL); struct hash_table *var_usage_map = - _mesa_hash_table_create(mem_ctx, _mesa_hash_pointer, - _mesa_key_pointer_equal); + _mesa_pointer_hash_table_create(mem_ctx); bool has_vars_to_shrink = false; nir_foreach_function(function, shader) { |