Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-04-24 12:34:04 +0300
committerJacques Lucke <jacques@blender.org>2020-04-24 12:34:04 +0300
commit47ae0affc8f29df92c82f2a9580b58f84819df7d (patch)
tree6424a6d1c47e852dd1e06b80c137422b40e42a8c /source/blender/depsgraph/intern/node/deg_node_component.h
parent69b6c89842ff2f22540bc0fb6a2ca1f2e6faab4a (diff)
Depsgraph: Use BLI::Map instead of GHash for operations_map
Reviewers: sergey Differential Revision: https://developer.blender.org/D7509
Diffstat (limited to 'source/blender/depsgraph/intern/node/deg_node_component.h')
-rw-r--r--source/blender/depsgraph/intern/node/deg_node_component.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/depsgraph/intern/node/deg_node_component.h b/source/blender/depsgraph/intern/node/deg_node_component.h
index 38ea4005a72..4867252fad9 100644
--- a/source/blender/depsgraph/intern/node/deg_node_component.h
+++ b/source/blender/depsgraph/intern/node/deg_node_component.h
@@ -26,6 +26,8 @@
#include "intern/node/deg_node.h"
#include "intern/node/deg_node_operation.h"
+#include "BLI_ghash.h"
+#include "BLI_hash.hh"
#include "BLI_string.h"
#include "BLI_utildefines.h"
@@ -115,7 +117,7 @@ struct ComponentNode : public Node {
/* Operations stored as a hash map, for faster build.
* This hash map will be freed when graph is fully built. */
- GHash *operations_map;
+ Map<ComponentNode::OperationIDKey, OperationNode *> *operations_map;
/* This is a "normal" list of operations, used by evaluation
* and other routines after construction. */
@@ -203,3 +205,18 @@ struct BoneComponentNode : public ComponentNode {
void deg_register_component_depsnodes();
} // namespace DEG
+
+namespace BLI {
+
+template<> struct DefaultHash<DEG::ComponentNode::OperationIDKey> {
+ uint32_t operator()(const DEG::ComponentNode::OperationIDKey &key) const
+ {
+ const int opcode_as_int = static_cast<int>(key.opcode);
+ return BLI_ghashutil_combine_hash(
+ key.name_tag,
+ BLI_ghashutil_combine_hash(BLI_ghashutil_uinthash(opcode_as_int),
+ BLI_ghashutil_strhash_p(key.name)));
+ }
+};
+
+} // namespace BLI