[Mesa-dev] [PATCH 02/14] glsl: Don't compute the hash when we already have it available

Thomas Helland thomashelland90 at gmail.com
Sun Jan 1 18:37:46 UTC 2017


We should really have a function to copy the table contents,
but this will at least get us somewhere in the meantime.
---
 src/compiler/glsl/opt_copy_propagation_elements.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/opt_copy_propagation_elements.cpp b/src/compiler/glsl/opt_copy_propagation_elements.cpp
index 9f79fa9202..3d11d028c5 100644
--- a/src/compiler/glsl/opt_copy_propagation_elements.cpp
+++ b/src/compiler/glsl/opt_copy_propagation_elements.cpp
@@ -143,11 +143,13 @@ public:
       struct hash_entry *entry;
 
       hash_table_foreach(lhs, entry) {
-         _mesa_hash_table_insert(lhs_ht, entry->key, entry->data);
+         _mesa_hash_table_insert_pre_hashed(lhs_ht, entry->hash,
+                                            entry->key, entry->data);
       }
 
       hash_table_foreach(rhs, entry) {
-         _mesa_hash_table_insert(rhs_ht, entry->key, entry->data);
+         _mesa_hash_table_insert_pre_hashed(rhs_ht, entry->hash,
+                                            entry->key, entry->data);
       }
    }
 
-- 
2.11.0



More information about the mesa-dev mailing list