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:
authorOmar Emara <mail@OmarEmara.dev>2022-08-31 17:59:54 +0300
committerOmar Emara <mail@OmarEmara.dev>2022-08-31 17:59:54 +0300
commit2a13ce1e61d8881d445293a132d087eb8c14bdc3 (patch)
tree4fa9a281e99a7006b5b70d8f3d846953a2a3c5c1 /source/blender/draw/intern/draw_manager.c
parent370b17a8c6b61c81ed98be979ad098c46aedf073 (diff)
Fix T100700: Compositor crashes when disabled then enabled
The viewport compositor crashes when it is disabled then enabled after the compositor node tree is edited. This happens because the compositor engine uses the view_update callback of the draw engine type to detect changes in the node tree and reset its state for future evaluation. However, the draw manager only calls the view_update callback for enabled engines, so the compositor never receives the needed updates to properly reset its state and then crashes at draw time. This patch call the view_update callback for all registered engines regardless if they are enabled or not, that way, they always receive the potentially important updated needed to maintain a correct state. Aside from the compositor engine, this change affects the EEVEE and Workbench engines because they are the only engines that utilizes this callback. However, both of them only reset a flag that is checked at draw time. So the change should have no side effects. For the EEVEE engine, we just add a null check in case it was not instanced, while Workbench already have the appropriate null check. Differential Revision: https://developer.blender.org/D15821 Reviewed By: Clement Foucault
Diffstat (limited to 'source/blender/draw/intern/draw_manager.c')
-rw-r--r--source/blender/draw/intern/draw_manager.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 3be2ddf5173..3d62c32308a 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -1344,11 +1344,7 @@ void DRW_notify_view_update(const DRWUpdateContext *update_ctx)
drw_engines_enable(view_layer, engine_type, gpencil_engine_needed);
drw_engines_data_validate();
- DRW_ENABLED_ENGINE_ITER (DST.view_data_active, draw_engine, data) {
- if (draw_engine->view_update) {
- draw_engine->view_update(data);
- }
- }
+ DRW_view_data_engines_view_update(DST.view_data_active);
drw_engines_disable();
}
@@ -1400,11 +1396,7 @@ static void drw_notify_view_update_offscreen(struct Depsgraph *depsgraph,
drw_engines_enable(view_layer, engine_type, gpencil_engine_needed);
drw_engines_data_validate();
- DRW_ENABLED_ENGINE_ITER (DST.view_data_active, draw_engine, data) {
- if (draw_engine->view_update) {
- draw_engine->view_update(data);
- }
- }
+ DRW_view_data_engines_view_update(DST.view_data_active);
drw_engines_disable();
}