From 9577ebde79cb5deb696f70fd7d218d8b358b0263 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 29 Jan 2018 16:42:04 +0100 Subject: Fix T53598: OpenGL Render Animation does not update shadows General idea of the fix: skip the whole draw manager callback madness which was used to tag object's engine specific data as dirty. Use generic recalc flag in ObjectEngineData structure instead. This gives us the following benefits; - Sovles mentioned bug report. - Avoids whole interface lookup for opened viewports for EVERY changed ID. - Fixes missing updates when viewport is temporarily invisible. Reviewers: dfelinto, fclem Differential Revision: https://developer.blender.org/D3028 --- .../blender/depsgraph/intern/eval/deg_eval_flush.cc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'source/blender/depsgraph/intern') diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc index 04bfb200743..c0d5e08b80f 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -36,6 +36,7 @@ #include #include "BLI_utildefines.h" +#include "BLI_listbase.h" #include "BLI_task.h" #include "BLI_ghash.h" @@ -207,10 +208,21 @@ BLI_INLINE OperationDepsNode *flush_schedule_children( return result; } +void flush_engine_data_update(ID *id) +{ + if (GS(id->name) != ID_OB) { + return; + } + Object *object = (Object *)id; + BLI_LISTBASE_FOREACH(ObjectEngineData *, engine_data, &object->drawdata) { + engine_data->recalc |= id->recalc; + } +} + /* NOTE: It will also accumulate flags from changed components. */ -BLI_INLINE void flush_editors_id_update(Main *bmain, - Depsgraph *graph, - const DEGEditorUpdateContext *update_ctx) +void flush_editors_id_update(Main *bmain, + Depsgraph *graph, + const DEGEditorUpdateContext *update_ctx) { foreach (IDDepsNode *id_node, graph->id_nodes) { if (id_node->done != ID_STATE_MODIFIED) { @@ -241,6 +253,8 @@ BLI_INLINE void flush_editors_id_update(Main *bmain, /* Inform editors. */ if (deg_copy_on_write_is_expanded(id_cow)) { deg_editors_id_update(update_ctx, id_cow); + /* Inform draw engines that something was changed. */ + flush_engine_data_update(id_cow); } } } -- cgit v1.2.3