[Bf-blender-cvs] [a69e3c9ee16] blender2.8: Fix T51943: Depsgraph: world update happening eternally on background (set) scene

Sergey Sharybin noreply at git.blender.org
Thu Jul 6 13:31:32 CEST 2017


Commit: a69e3c9ee16241068797b2852504441bfe3d5ca2
Author: Sergey Sharybin
Date:   Thu Jul 6 13:29:59 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBa69e3c9ee16241068797b2852504441bfe3d5ca2

Fix T51943: Depsgraph: world update happening eternally on background (set) scene

The issue was caused by updates being flushed for all scenes, while actual update
was only called for an active one.

Not sure why do we need to flush updates for all scenes, so now we only flush
scenes which are updated.

===================================================================

M	source/blender/blenkernel/intern/scene.c
M	source/blender/depsgraph/DEG_depsgraph.h
M	source/blender/depsgraph/intern/depsgraph_tag.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 1e34781adfd..85c28b8bf54 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1517,7 +1517,7 @@ void BKE_scene_update_tagged(EvaluationContext *eval_ctx, Main *bmain, Scene *sc
 	prepare_mesh_for_viewport_render(bmain, scene);
 
 	/* flush recalc flags to dependencies */
-	DEG_ids_flush_tagged(bmain);
+	DEG_ids_flush_tagged(bmain, scene);
 
 	/* removed calls to quick_cache, see pointcache.c */
 	
diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h
index 9caf7635ccf..9347a29b14a 100644
--- a/source/blender/depsgraph/DEG_depsgraph.h
+++ b/source/blender/depsgraph/DEG_depsgraph.h
@@ -182,7 +182,7 @@ void DEG_ids_clear_recalc(struct Main *bmain);
 /* Update Flushing ------------------------------- */
 
 /* Flush updates for all IDs */
-void DEG_ids_flush_tagged(struct Main *bmain);
+void DEG_ids_flush_tagged(struct Main *bmain, struct Scene *scene);
 
 /* Check if something was changed in the database and inform
  * editors about this.
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index 80fa89bbb97..5b7294d92f9 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -291,18 +291,13 @@ void DEG_id_type_tag(Main *bmain, short idtype)
 /* Recursively push updates out to all nodes dependent on this,
  * until all affected are tagged and/or scheduled up for eval
  */
-void DEG_ids_flush_tagged(Main *bmain)
+void DEG_ids_flush_tagged(Main *bmain, Scene *scene)
 {
-	for (Scene *scene = (Scene *)bmain->scene.first;
-	     scene != NULL;
-	     scene = (Scene *)scene->id.next)
-	{
-		/* TODO(sergey): Only visible scenes? */
-		if (scene->depsgraph != NULL) {
-			DEG::deg_graph_flush_updates(
-			        bmain,
-			        reinterpret_cast<DEG::Depsgraph *>(scene->depsgraph));
-		}
+	/* TODO(sergey): Only visible scenes? */
+	if (scene->depsgraph != NULL) {
+		DEG::deg_graph_flush_updates(
+		        bmain,
+		        reinterpret_cast<DEG::Depsgraph *>(scene->depsgraph));
 	}
 }




More information about the Bf-blender-cvs mailing list