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>2016-05-27 19:01:18 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-05-27 19:01:18 +0300
commit55b24bef557922b8f51cf993b12047e980e43617 (patch)
tree7a9dd18a1d096e71e94406fb1ceecf233fa4e3af /source/blender/depsgraph/intern/depsgraph.h
parent3d86a5bc72a63b1ef8b165d68a1806d0abf0a8ac (diff)
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with this module more pleasant and solve such issues as: - Annoyance with looong files, which had craftload in them - Usage of STL for the data structures we've got in BLI - Possible symbol conflicts - Not real clear layout of what is located where So in this commit the following changes are done: - STL is prohibited, it's not really predictable on various compilers, with our BLI algorithms we can predict things much better. There are still few usages of std::vector, but that we'll be solving later once we've got similar thing in BLI. - Simplify foreach loops, avoid using const_iterator all over the place. - New directory layout, which is hopefully easier to follow. - Some files were split, some of them will be split soon. The idea of this is to split huge functions into own files with good documentation and everything. - Removed stuff which was planned for use in the future but was never finished, tested or anything. Let's wipe it out for now, and bring back once we really start using it, so it'll be more clear if it solves our needs. - All the internal routines were moved to DEG namespace to separate them better from rest of blender. Some places now annoyingly using DEG::foo, but that we can olve by moving some utility functions inside of the namespace. While working on this we've found some hotspot in updates flush, so now playback of blenrig is few percent faster (something like 96fps with previous master and around 99-100fps after this change). Not saying it's something final, there is still room for cleanup and API simplification, but those might happen as a regular development now without doing any global changes.
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph.h')
-rw-r--r--source/blender/depsgraph/intern/depsgraph.h47
1 files changed, 11 insertions, 36 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h
index 9533fbd10d5..213bb304d73 100644
--- a/source/blender/depsgraph/intern/depsgraph.h
+++ b/source/blender/depsgraph/intern/depsgraph.h
@@ -34,19 +34,20 @@
* in the graph.
*/
-#ifndef __DEPSGRAPH_H__
-#define __DEPSGRAPH_H__
+#pragma once
#include "BLI_threads.h" /* for SpinLock */
-#include "depsgraph_types.h"
-
-#include "depsgraph_util_map.h"
-#include "depsgraph_util_set.h"
+#include "intern/depsgraph_types.h"
+struct ID;
+struct GHash;
+struct GSet;
struct PointerRNA;
struct PropertyRNA;
+namespace DEG {
+
struct DepsNode;
struct RootDepsNode;
struct TimeSourceDepsNode;
@@ -94,9 +95,6 @@ struct DepsRelation {
/* Dependency Graph object */
struct Depsgraph {
- typedef unordered_map<const ID *, IDDepsNode *> IDNodeMap;
- typedef unordered_set<SubgraphDepsNode *> Subgraphs;
- typedef unordered_set<OperationDepsNode *> EntryTags;
typedef vector<OperationDepsNode *> OperationNodes;
Depsgraph();
@@ -163,13 +161,13 @@ struct Depsgraph {
/* <ID : IDDepsNode> mapping from ID blocks to nodes representing these blocks
* (for quick lookups). */
- IDNodeMap id_hash;
+ GHash *id_hash;
/* "root" node - the one where all evaluation enters from. */
RootDepsNode *root_node;
/* Subgraphs referenced in tree. */
- Subgraphs subgraphs;
+ GSet *subgraphs;
/* Indicates whether relations needs to be updated. */
bool need_update;
@@ -177,7 +175,7 @@ struct Depsgraph {
/* Quick-Access Temp Data ............. */
/* Nodes which have been tagged as "directly modified". */
- EntryTags entry_tags;
+ GSet *entry_tags;
/* Convenience Data ................... */
@@ -198,27 +196,4 @@ struct Depsgraph {
// XXX: additional stuff like eval contexts, mempools for allocating nodes from, etc.
};
-/**
- * Helper macros for iterating over set of relationship links
- * incident on each node.
- *
- * \note it is safe to perform removal operations here...
- *
- * relations_set[in]: (DepsNode::Relations) set of relationships (in/out links)
- * relation[out]: (DepsRelation *) identifier where DepsRelation that we're
- * currently accessing comes up
- */
-#define DEPSNODE_RELATIONS_ITER_BEGIN(relations_set_, relation_) \
- { \
- OperationDepsNode::Relations::const_iterator __rel_iter = relations_set_.begin(); \
- while (__rel_iter != relations_set_.end()) { \
- DepsRelation *relation_ = *__rel_iter; \
- ++__rel_iter; \
-
- /* ... code for iterator body can be written here ... */
-
-#define DEPSNODE_RELATIONS_ITER_END \
- } \
- } ((void)0)
-
-#endif /* __DEPSGRAPH_H__ */
+} // namespace DEG