summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/gl_nir_linker.c4
-rw-r--r--src/compiler/glsl/glsl_to_nir.cpp6
-rw-r--r--src/compiler/glsl/ir_array_refcount.cpp3
-rw-r--r--src/compiler/glsl/ir_builder_print_visitor.cpp3
-rw-r--r--src/compiler/glsl/ir_clone.cpp3
-rw-r--r--src/compiler/glsl/ir_constant_expression.cpp3
-rw-r--r--src/compiler/glsl/ir_function_detect_recursion.cpp3
-rw-r--r--src/compiler/glsl/ir_print_visitor.cpp3
-rw-r--r--src/compiler/glsl/ir_validate.cpp3
-rw-r--r--src/compiler/glsl/ir_variable_refcount.cpp3
-rw-r--r--src/compiler/glsl/link_functions.cpp6
-rw-r--r--src/compiler/glsl/linker.cpp10
-rw-r--r--src/compiler/glsl/loop_analysis.cpp3
-rw-r--r--src/compiler/glsl/loop_analysis.h3
-rw-r--r--src/compiler/glsl/lower_if_to_cond_assign.cpp4
-rw-r--r--src/compiler/glsl/opt_constant_propagation.cpp12
-rw-r--r--src/compiler/glsl/opt_constant_variable.cpp3
-rw-r--r--src/compiler/glsl/opt_copy_propagation_elements.cpp6
-rw-r--r--src/compiler/glsl/opt_function_inlining.cpp2
-rw-r--r--src/compiler/glsl/standalone.cpp4
20 files changed, 28 insertions, 59 deletions
diff --git a/src/compiler/glsl/gl_nir_linker.c b/src/compiler/glsl/gl_nir_linker.c
index 547549bc4e0..92e90714e10 100644
--- a/src/compiler/glsl/gl_nir_linker.c
+++ b/src/compiler/glsl/gl_nir_linker.c
@@ -44,9 +44,7 @@ nir_build_program_resource_list(struct gl_context *ctx,
prog->data->NumProgramResourceList = 0;
}
- struct set *resource_set = _mesa_set_create(NULL,
- _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ struct set *resource_set = _mesa_pointer_set_create(NULL);
/* Add uniforms
*
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp
index 424298ad952..8f786575fce 100644
--- a/src/compiler/glsl/glsl_to_nir.cpp
+++ b/src/compiler/glsl/glsl_to_nir.cpp
@@ -176,10 +176,8 @@ nir_visitor::nir_visitor(nir_shader *shader)
this->supports_ints = shader->options->native_integers;
this->shader = shader;
this->is_global = true;
- this->var_table = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
- this->overload_table = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ this->var_table = _mesa_pointer_hash_table_create(NULL);
+ this->overload_table = _mesa_pointer_hash_table_create(NULL);
this->result = NULL;
this->impl = NULL;
memset(&this->b, 0, sizeof(this->b));
diff --git a/src/compiler/glsl/ir_array_refcount.cpp b/src/compiler/glsl/ir_array_refcount.cpp
index 1a46b2185d4..c2295c96ca9 100644
--- a/src/compiler/glsl/ir_array_refcount.cpp
+++ b/src/compiler/glsl/ir_array_refcount.cpp
@@ -37,8 +37,7 @@ ir_array_refcount_visitor::ir_array_refcount_visitor()
: last_array_deref(0), derefs(0), num_derefs(0), derefs_size(0)
{
this->mem_ctx = ralloc_context(NULL);
- this->ht = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ this->ht = _mesa_pointer_hash_table_create(NULL);
}
static void
diff --git a/src/compiler/glsl/ir_builder_print_visitor.cpp b/src/compiler/glsl/ir_builder_print_visitor.cpp
index da04868652a..57424699d00 100644
--- a/src/compiler/glsl/ir_builder_print_visitor.cpp
+++ b/src/compiler/glsl/ir_builder_print_visitor.cpp
@@ -141,8 +141,7 @@ _mesa_print_builder_for_ir(FILE *f, exec_list *instructions)
ir_builder_print_visitor::ir_builder_print_visitor(FILE *f)
: next_ir_index(1), f(f), indentation(0)
{
- index_map =
- _mesa_hash_table_create(NULL, _mesa_hash_pointer, _mesa_key_pointer_equal);
+ index_map = _mesa_pointer_hash_table_create(NULL);
}
ir_builder_print_visitor::~ir_builder_print_visitor()
diff --git a/src/compiler/glsl/ir_clone.cpp b/src/compiler/glsl/ir_clone.cpp
index e1f4f3b2903..c492fdbb3d0 100644
--- a/src/compiler/glsl/ir_clone.cpp
+++ b/src/compiler/glsl/ir_clone.cpp
@@ -419,8 +419,7 @@ fixup_function_calls(struct hash_table *ht, exec_list *instructions)
void
clone_ir_list(void *mem_ctx, exec_list *out, const exec_list *in)
{
- struct hash_table *ht =
- _mesa_hash_table_create(NULL, _mesa_hash_pointer, _mesa_key_pointer_equal);
+ struct hash_table *ht = _mesa_pointer_hash_table_create(NULL);
foreach_in_list(const ir_instruction, original, in) {
ir_instruction *copy = original->clone(mem_ctx, ht);
diff --git a/src/compiler/glsl/ir_constant_expression.cpp b/src/compiler/glsl/ir_constant_expression.cpp
index bfc22c0011a..cb8558eb00d 100644
--- a/src/compiler/glsl/ir_constant_expression.cpp
+++ b/src/compiler/glsl/ir_constant_expression.cpp
@@ -1024,8 +1024,7 @@ ir_function_signature::constant_expression_value(void *mem_ctx,
* We expect the correctness of the number of parameters to have
* been checked earlier.
*/
- hash_table *deref_hash = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ hash_table *deref_hash = _mesa_pointer_hash_table_create(NULL);
/* If "origin" is non-NULL, then the function body is there. So we
* have to use the variable objects from the object with the body,
diff --git a/src/compiler/glsl/ir_function_detect_recursion.cpp b/src/compiler/glsl/ir_function_detect_recursion.cpp
index 5b05274d001..4a774f666c9 100644
--- a/src/compiler/glsl/ir_function_detect_recursion.cpp
+++ b/src/compiler/glsl/ir_function_detect_recursion.cpp
@@ -158,8 +158,7 @@ public:
{
progress = false;
this->mem_ctx = ralloc_context(NULL);
- this->function_hash = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ this->function_hash = _mesa_pointer_hash_table_create(NULL);
}
~has_recursion_visitor()
diff --git a/src/compiler/glsl/ir_print_visitor.cpp b/src/compiler/glsl/ir_print_visitor.cpp
index 1626657081e..ef6bca1229e 100644
--- a/src/compiler/glsl/ir_print_visitor.cpp
+++ b/src/compiler/glsl/ir_print_visitor.cpp
@@ -90,8 +90,7 @@ ir_print_visitor::ir_print_visitor(FILE *f)
: f(f)
{
indentation = 0;
- printable_names =
- _mesa_hash_table_create(NULL, _mesa_hash_pointer, _mesa_key_pointer_equal);
+ printable_names = _mesa_pointer_hash_table_create(NULL);
symbols = _mesa_symbol_table_ctor();
mem_ctx = ralloc_context(NULL);
}
diff --git a/src/compiler/glsl/ir_validate.cpp b/src/compiler/glsl/ir_validate.cpp
index aa07f8aea64..819e8aa60dd 100644
--- a/src/compiler/glsl/ir_validate.cpp
+++ b/src/compiler/glsl/ir_validate.cpp
@@ -46,8 +46,7 @@ class ir_validate : public ir_hierarchical_visitor {
public:
ir_validate()
{
- this->ir_set = _mesa_set_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ this->ir_set = _mesa_pointer_set_create(NULL);
this->current_function = NULL;
diff --git a/src/compiler/glsl/ir_variable_refcount.cpp b/src/compiler/glsl/ir_variable_refcount.cpp
index 8306be10b9c..47e9d0c897c 100644
--- a/src/compiler/glsl/ir_variable_refcount.cpp
+++ b/src/compiler/glsl/ir_variable_refcount.cpp
@@ -38,8 +38,7 @@
ir_variable_refcount_visitor::ir_variable_refcount_visitor()
{
this->mem_ctx = ralloc_context(NULL);
- this->ht = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ this->ht = _mesa_pointer_hash_table_create(NULL);
}
static void
diff --git a/src/compiler/glsl/link_functions.cpp b/src/compiler/glsl/link_functions.cpp
index e73a72c86c9..4998d39dc59 100644
--- a/src/compiler/glsl/link_functions.cpp
+++ b/src/compiler/glsl/link_functions.cpp
@@ -47,8 +47,7 @@ public:
this->success = true;
this->linked = linked;
- this->locals = _mesa_set_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ this->locals = _mesa_pointer_set_create(NULL);
}
~call_link_visitor()
@@ -148,8 +147,7 @@ public:
* replace signature stored in a function. One could easily be added,
* but this avoids the need.
*/
- struct hash_table *ht = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ struct hash_table *ht = _mesa_pointer_hash_table_create(NULL);
exec_list formal_parameters;
foreach_in_list(const ir_instruction, original, &sig->parameters) {
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index d9b9f60067f..2d76e852f47 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -1460,8 +1460,7 @@ move_non_declarations(exec_list *instructions, exec_node *last,
hash_table *temps = NULL;
if (make_copies)
- temps = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ temps = _mesa_pointer_hash_table_create(NULL);
foreach_in_list_safe(ir_instruction, inst, instructions) {
if (inst->as_function())
@@ -1507,8 +1506,7 @@ class array_sizing_visitor : public deref_type_updater {
public:
array_sizing_visitor()
: mem_ctx(ralloc_context(NULL)),
- unnamed_interfaces(_mesa_hash_table_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal))
+ unnamed_interfaces(_mesa_pointer_hash_table_create(NULL))
{
}
@@ -4412,9 +4410,7 @@ build_program_resource_list(struct gl_context *ctx,
if (input_stage == MESA_SHADER_STAGES && output_stage == 0)
return;
- struct set *resource_set = _mesa_set_create(NULL,
- _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ struct set *resource_set = _mesa_pointer_set_create(NULL);
/* Program interface needs to expose varyings in case of SSO. */
if (shProg->SeparateShader) {
diff --git a/src/compiler/glsl/loop_analysis.cpp b/src/compiler/glsl/loop_analysis.cpp
index 0fb6e9feb74..e90eb1ccde5 100644
--- a/src/compiler/glsl/loop_analysis.cpp
+++ b/src/compiler/glsl/loop_analysis.cpp
@@ -252,8 +252,7 @@ loop_variable::record_reference(bool in_assignee,
loop_state::loop_state()
{
- this->ht = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ this->ht = _mesa_pointer_hash_table_create(NULL);
this->mem_ctx = ralloc_context(NULL);
this->loop_found = false;
}
diff --git a/src/compiler/glsl/loop_analysis.h b/src/compiler/glsl/loop_analysis.h
index 4e110018461..d6fdb908e0d 100644
--- a/src/compiler/glsl/loop_analysis.h
+++ b/src/compiler/glsl/loop_analysis.h
@@ -113,8 +113,7 @@ public:
{
this->num_loop_jumps = 0;
this->contains_calls = false;
- this->var_hash = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ this->var_hash = _mesa_pointer_hash_table_create(NULL);
this->limiting_terminator = NULL;
}
diff --git a/src/compiler/glsl/lower_if_to_cond_assign.cpp b/src/compiler/glsl/lower_if_to_cond_assign.cpp
index 0d6aa0049d4..ca61f1d5273 100644
--- a/src/compiler/glsl/lower_if_to_cond_assign.cpp
+++ b/src/compiler/glsl/lower_if_to_cond_assign.cpp
@@ -71,9 +71,7 @@ public:
this->min_branch_cost = min_branch_cost;
this->depth = 0;
- this->condition_variables =
- _mesa_set_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ this->condition_variables = _mesa_pointer_set_create(NULL);
}
~ir_if_to_cond_assign_visitor()
diff --git a/src/compiler/glsl/opt_constant_propagation.cpp b/src/compiler/glsl/opt_constant_propagation.cpp
index 642bd641ed6..cc57c48c83a 100644
--- a/src/compiler/glsl/opt_constant_propagation.cpp
+++ b/src/compiler/glsl/opt_constant_propagation.cpp
@@ -86,8 +86,7 @@ public:
mem_ctx = ralloc_context(0);
this->lin_ctx = linear_alloc_parent(this->mem_ctx, 0);
this->acp = new(mem_ctx) exec_list;
- this->kills = _mesa_hash_table_create(mem_ctx, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ this->kills = _mesa_pointer_hash_table_create(mem_ctx);
}
~ir_constant_propagation_visitor()
{
@@ -256,8 +255,7 @@ ir_constant_propagation_visitor::visit_enter(ir_function_signature *ir)
bool orig_killed_all = this->killed_all;
this->acp = new(mem_ctx) exec_list;
- this->kills = _mesa_hash_table_create(mem_ctx, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ this->kills = _mesa_pointer_hash_table_create(mem_ctx);
this->killed_all = false;
visit_list_elements(this, &ir->body);
@@ -368,8 +366,7 @@ ir_constant_propagation_visitor::visit_enter(ir_if *ir)
ir->condition->accept(this);
handle_rvalue(&ir->condition);
- hash_table *new_kills = _mesa_hash_table_create(mem_ctx, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ hash_table *new_kills = _mesa_pointer_hash_table_create(mem_ctx);
bool then_killed_all = false;
bool else_killed_all = false;
@@ -398,8 +395,7 @@ ir_constant_propagation_visitor::handle_loop(ir_loop *ir, bool keep_acp)
bool orig_killed_all = this->killed_all;
this->acp = new(mem_ctx) exec_list;
- this->kills = _mesa_hash_table_create(mem_ctx, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ this->kills = _mesa_pointer_hash_table_create(mem_ctx);
this->killed_all = false;
if (keep_acp) {
diff --git a/src/compiler/glsl/opt_constant_variable.cpp b/src/compiler/glsl/opt_constant_variable.cpp
index 15d8cf7cdfd..a1fffd4a5f1 100644
--- a/src/compiler/glsl/opt_constant_variable.cpp
+++ b/src/compiler/glsl/opt_constant_variable.cpp
@@ -186,8 +186,7 @@ do_constant_variable(exec_list *instructions)
bool progress = false;
ir_constant_variable_visitor v;
- v.ht = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ v.ht = _mesa_pointer_hash_table_create(NULL);
v.run(instructions);
hash_table_foreach(v.ht, hte) {
diff --git a/src/compiler/glsl/opt_copy_propagation_elements.cpp b/src/compiler/glsl/opt_copy_propagation_elements.cpp
index 78126ca3870..081909903e5 100644
--- a/src/compiler/glsl/opt_copy_propagation_elements.cpp
+++ b/src/compiler/glsl/opt_copy_propagation_elements.cpp
@@ -203,8 +203,7 @@ private:
/* Use 'this' as context for the table, no explicit destruction
* needed later.
*/
- acp = _mesa_hash_table_create(this, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ acp = _mesa_pointer_hash_table_create(this);
lin_ctx = linear_alloc_parent(this, 0);
}
@@ -231,8 +230,7 @@ private:
}
if (!found) {
- entry->dsts = _mesa_set_create(this, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ entry->dsts = _mesa_pointer_set_create(this);
}
return entry;
diff --git a/src/compiler/glsl/opt_function_inlining.cpp b/src/compiler/glsl/opt_function_inlining.cpp
index 52f57da936d..590bd707bee 100644
--- a/src/compiler/glsl/opt_function_inlining.cpp
+++ b/src/compiler/glsl/opt_function_inlining.cpp
@@ -152,7 +152,7 @@ ir_call::generate_inline(ir_instruction *next_ir)
int i;
struct hash_table *ht;
- ht = _mesa_hash_table_create(NULL, _mesa_hash_pointer, _mesa_key_pointer_equal);
+ ht = _mesa_pointer_hash_table_create(NULL);
num_parameters = this->callee->parameters.length();
parameters = new ir_variable *[num_parameters];
diff --git a/src/compiler/glsl/standalone.cpp b/src/compiler/glsl/standalone.cpp
index 96ea18f1303..add4e4ea478 100644
--- a/src/compiler/glsl/standalone.cpp
+++ b/src/compiler/glsl/standalone.cpp
@@ -49,9 +49,7 @@ class dead_variable_visitor : public ir_hierarchical_visitor {
public:
dead_variable_visitor()
{
- variables = _mesa_set_create(NULL,
- _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ variables = _mesa_pointer_set_create(NULL);
}
virtual ~dead_variable_visitor()