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:
authorBrecht Van Lommel <brecht@blender.org>2021-01-29 17:55:41 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-01-29 18:06:11 +0300
commitc7d75a66163635ec7629eda2d4aa39b9e197ef6a (patch)
tree0adf3a02e1d6d8762f8e62f81eccca7d4044c32f /source/blender/blenkernel/intern
parentbc94036a76b63254181788ce5814fb946f52a287 (diff)
parentb3fc88554468eb91fac3c2afb9387e599e6db507 (diff)
Merge branch 'blender-v2.92-release'
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/scene.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 239e2dc47a0..cb5b17caed2 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -3316,7 +3316,7 @@ int BKE_scene_multiview_num_videos_get(const RenderData *rd)
/* This is a key which identifies depsgraph. */
typedef struct DepsgraphKey {
- ViewLayer *view_layer;
+ const ViewLayer *view_layer;
/* TODO(sergey): Need to include window somehow (same layer might be in a
* different states in different windows).
*/
@@ -3451,10 +3451,13 @@ static Depsgraph **scene_ensure_depsgraph_p(Main *bmain, Scene *scene, ViewLayer
return depsgraph_ptr;
}
-Depsgraph *BKE_scene_get_depsgraph(Scene *scene, ViewLayer *view_layer)
+Depsgraph *BKE_scene_get_depsgraph(const Scene *scene, const ViewLayer *view_layer)
{
- Depsgraph **depsgraph_ptr = scene_get_depsgraph_p(scene, view_layer, false);
- return (depsgraph_ptr != NULL) ? *depsgraph_ptr : NULL;
+ BLI_assert(BKE_scene_has_view_layer(scene, view_layer));
+
+ DepsgraphKey key;
+ key.view_layer = view_layer;
+ return BLI_ghash_lookup(scene->depsgraph_hash, &key);
}
Depsgraph *BKE_scene_ensure_depsgraph(Main *bmain, Scene *scene, ViewLayer *view_layer)