diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-21 20:45:39 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-22 18:57:22 +0300 |
commit | cc4dc2dce26c724e27598e4a1878e00fdf30dcf2 (patch) | |
tree | 0ccf3d58e17666a24f9b0b6325666d0453b55645 /source/blender/depsgraph/intern/depsgraph.h | |
parent | 79615c5adb46ffaa84d17b548074cec83d1071bb (diff) |
Depsgraph: cache effector relations, for performance and stability.
To find all effectors in the scene, we need to loop over all objects.
Doing this during depsgraph evaluation caused crashes because not all
objects are guaranteed to be evaluated yet.
To fix this, we now cache the relations as part of the dependency graph
build. As a bonus this also makes evaluation faster for big scenes,
since looping over all objects for each particle system is slow.
Fixes T55156.
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph.h')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h index a69be39c50b..a27af42e7b9 100644 --- a/source/blender/depsgraph/intern/depsgraph.h +++ b/source/blender/depsgraph/intern/depsgraph.h @@ -226,6 +226,10 @@ struct Depsgraph { /* NITE: Corresponds to G_DEBUG_DEPSGRAPH_* flags. */ int debug_flags; string debug_name; + + /* Cached list of effectors for collections and the scene created + * along with relations, for fast lookup during evaluation. */ + GHash *effector_relations; }; } // namespace DEG |