diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-29 18:42:04 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-29 19:54:20 +0300 |
commit | 9577ebde79cb5deb696f70fd7d218d8b358b0263 (patch) | |
tree | e23f22ba835578dc6753848b9ef2ce8d7ab3bd6f /source/blender/depsgraph/intern | |
parent | 006c66b1ff5972c5badff7a7f53f638e27e24cd4 (diff) |
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
Diffstat (limited to 'source/blender/depsgraph/intern')
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval_flush.cc | 20 |
1 files changed, 17 insertions, 3 deletions
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 <deque> #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); } } } |