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>2018-04-25 15:58:19 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-04-25 17:34:55 +0300
commit09da47b67a28aa3dd814b5c7d309d3481b39e77c (patch)
tree727bd3064c8d483312f26d5b311fe0cdb1a768b0 /source/blender/depsgraph/intern/depsgraph_build.cc
parenta9d3f9f54d6db8197b891ba4bdcc53bf6adeb113 (diff)
Depsgraph: Avoid hash lookup for every evaluated scene query
Cache pointer to evaluated scene datablock on relations build time, that pointer never changes after that.
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_build.cc')
-rw-r--r--source/blender/depsgraph/intern/depsgraph_build.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc
index ecd3d5361f8..0a958fa67d3 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build.cc
@@ -260,6 +260,9 @@ void DEG_graph_build_from_view_layer(Depsgraph *graph,
/* Relations are up to date. */
deg_graph->need_update = false;
+ /* Store pointers to commonly used valuated datablocks. */
+ deg_graph->scene_cow = (Scene *)deg_graph->get_cow_id(&deg_graph->scene->id);
+
if (need_on_visible_update) {
DEG_graph_on_visible_update(bmain, graph);
}