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-04-05 00:51:24 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-04-05 15:05:01 +0300
commit50782df42586a5a038cad11530714371edaa5cd4 (patch)
treef2f6e3d5c4f07be85efd39e1319fdb49b76d1d2d /source/blender/blenkernel/intern/scene.c
parent3fa580866ef5514f6fa7f9c5a369249f69135c78 (diff)
Render: faster animation and re-rendering with Persistent Data
For Cycles, when enabling the Persistent Data option, the full render data will be preserved from frame-to-frame in animation renders and between re-renders of the scene. This means that any modifier evaluation, BVH building, OpenGL vertex buffer uploads, etc, can be done only once for unchanged objects. This comes at an increased memory cost. Previously there option was named Persistent Images and had a more limited impact on render time and memory. When using multiple view layers, only data from a single view layer is preserved to keep memory usage somewhat under control. However objects shared between view layers are preserved, and so this can speedup such renders as well, even single frame renders. For Eevee and Workbench this option is not available, however these engines will now always reuse the depsgraph for animation and multiple view layers. This can significantly speed up rendering. These engines do not support sharing the depsgraph between re-renders, due to technical issues regarding OpenGL contexts. Support for this could be added if those are solved, see the code comments for details.
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r--source/blender/blenkernel/intern/scene.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index e0ff0b0268a..44c0fd5144b 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -2660,7 +2660,7 @@ static void scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain, bool on
bmain, &scene->id, depsgraph, BKE_CB_EVT_DEPSGRAPH_UPDATE_POST);
/* It is possible that the custom callback modified scene and removed some IDs from the main
- * database. In this case DEG_ids_clear_recalc() will crash because it iterates over all IDs
+ * database. In this case DEG_editors_update() will crash because it iterates over all IDs
* which depsgraph was built for.
*
* The solution is to update relations prior to this call, avoiding access to freed IDs.
@@ -2673,9 +2673,7 @@ static void scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain, bool on
DEG_graph_relations_update(depsgraph);
}
/* Inform editors about possible changes. */
- DEG_ids_check_recalc(bmain, depsgraph, scene, view_layer, false);
- /* Clear recalc flags. */
- DEG_ids_clear_recalc(bmain, depsgraph);
+ DEG_editors_update(bmain, depsgraph, scene, view_layer, false);
/* If user callback did not tag anything for update we can skip second iteration.
* Otherwise we update scene once again, but without running callbacks to bring
@@ -2736,14 +2734,12 @@ void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph)
BKE_callback_exec_id_depsgraph(bmain, &scene->id, depsgraph, BKE_CB_EVT_FRAME_CHANGE_POST);
/* NOTE: Similar to this case in scene_graph_update_tagged(). Need to ensure that
- * DEG_ids_clear_recalc() doesn't access freed memory of possibly removed ID. */
+ * DEG_editors_update() doesn't access freed memory of possibly removed ID. */
DEG_graph_relations_update(depsgraph);
}
/* Inform editors about possible changes. */
- DEG_ids_check_recalc(bmain, depsgraph, scene, view_layer, true);
- /* clear recalc flags */
- DEG_ids_clear_recalc(bmain, depsgraph);
+ DEG_editors_update(bmain, depsgraph, scene, view_layer, true);
/* If user callback did not tag anything for update we can skip second iteration.
* Otherwise we update scene once again, but without running callbacks to bring
@@ -3462,6 +3458,9 @@ static Depsgraph **scene_ensure_depsgraph_p(Main *bmain, Scene *scene, ViewLayer
BLI_snprintf(name, sizeof(name), "%s :: %s", scene->id.name, view_layer->name);
DEG_debug_name_set(*depsgraph_ptr, name);
+ /* These viewport depsgraphs communicate changes to the editors. */
+ DEG_enable_editors_update(*depsgraph_ptr);
+
return depsgraph_ptr;
}