diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2016-05-29 10:16:47 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2016-05-29 10:16:47 +0000 |
commit | f1efffae355cb8c9669b5c2bdc9de661c9db1831 (patch) | |
tree | d270458abbd16ffb77bf72174c5dfeafb653bcc8 /lib | |
parent | c534c714fbf54f9c0194c3c6e94f0462d1b18b55 (diff) |
Import Mesa 11.2.2
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mesa/src/compiler/glsl/opt_constant_variable.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/mesa/src/compiler/glsl/opt_constant_variable.cpp b/lib/mesa/src/compiler/glsl/opt_constant_variable.cpp index a1fffd4a5..3ddb12904 100644 --- a/lib/mesa/src/compiler/glsl/opt_constant_variable.cpp +++ b/lib/mesa/src/compiler/glsl/opt_constant_variable.cpp @@ -102,13 +102,6 @@ ir_constant_variable_visitor::visit_enter(ir_assignment *ir) assert(entry); entry->assignment_count++; - /* If there's more than one assignment, don't bother - we won't do anything - * with this variable anyway, and continuing just wastes memory cloning - * constant expressions. - */ - if (entry->assignment_count > 1) - return visit_continue; - /* If it's already constant, don't do the work. */ if (entry->var->constant_value) return visit_continue; @@ -131,7 +124,7 @@ ir_constant_variable_visitor::visit_enter(ir_assignment *ir) var->data.mode == ir_var_shader_shared) return visit_continue; - constval = ir->rhs->constant_expression_value(ralloc_parent(ir)); + constval = ir->rhs->constant_expression_value(); if (!constval) return visit_continue; @@ -186,9 +179,11 @@ do_constant_variable(exec_list *instructions) bool progress = false; ir_constant_variable_visitor v; - v.ht = _mesa_pointer_hash_table_create(NULL); + v.ht = _mesa_hash_table_create(NULL, _mesa_hash_pointer, + _mesa_key_pointer_equal); v.run(instructions); + struct hash_entry *hte; hash_table_foreach(v.ht, hte) { struct assignment_entry *entry = (struct assignment_entry *) hte->data; |