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:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-11-08 16:29:58 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-11-08 17:02:19 +0300
commit10f076da2d687a77a317e060bf69d95fb49ad075 (patch)
tree44dfb0d6ff79b368e70eebdc540c5096b0ae8e73 /source/blender/depsgraph/intern/depsgraph.h
parent5c66bbc56f08f13638a92a5e4702d138abc37ba7 (diff)
Depsgraph: Introduce flat list of ID nodes
The idea is to allow iterating over ID nodes in exact order of their construction, and in order which will not change dependent on memory pointers or anything.
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph.h')
-rw-r--r--source/blender/depsgraph/intern/depsgraph.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h
index 889eb33c1bf..1b4dca569d7 100644
--- a/source/blender/depsgraph/intern/depsgraph.h
+++ b/source/blender/depsgraph/intern/depsgraph.h
@@ -93,7 +93,9 @@ struct DepsRelation {
/* Dependency Graph object */
struct Depsgraph {
+ // TODO(sergey): Go away from C++ container and use some native BLI.
typedef vector<OperationDepsNode *> OperationNodes;
+ typedef vector<IDDepsNode *> IDDepsNodes;
Depsgraph();
~Depsgraph();
@@ -139,10 +141,17 @@ struct Depsgraph {
/* Core Graph Functionality ........... */
- /* <ID : IDDepsNode> mapping from ID blocks to nodes representing these blocks
- * (for quick lookups). */
+ /* <ID : IDDepsNode> mapping from ID blocks to nodes representing these
+ * blocks, used for quick lookups.
+ */
GHash *id_hash;
+ /* Ordered list of ID nodes, order matches ID allocation order.
+ * Used for faster iteration, especially for areas which are critical to
+ * keep exact order of iteration.
+ */
+ IDDepsNodes id_nodes;
+
/* Top-level time source node. */
TimeSourceDepsNode *time_source;