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_query.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_query.cc')
-rw-r--r--source/blender/depsgraph/intern/depsgraph_query.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc
index 63eb1f18281..8f4bf2d082e 100644
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query.cc
@@ -105,9 +105,7 @@ Scene *DEG_get_evaluated_scene(const Depsgraph *graph)
{
const DEG::Depsgraph *deg_graph =
reinterpret_cast<const DEG::Depsgraph *>(graph);
- Scene *scene_orig = deg_graph->scene;
- Scene *scene_cow =
- reinterpret_cast<Scene *>(deg_graph->get_cow_id(&scene_orig->id));
+ Scene *scene_cow = deg_graph->scene_cow;
/* TODO(sergey): Shall we expand datablock here? Or is it OK to assume
* that calleer is OK with just a pointer in case scene is not up[dated
* yet?