From 2a13ce1e61d8881d445293a132d087eb8c14bdc3 Mon Sep 17 00:00:00 2001 From: Omar Emara Date: Wed, 31 Aug 2022 16:59:54 +0200 Subject: 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 --- source/blender/draw/intern/draw_view_data.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/draw/intern/draw_view_data.h') diff --git a/source/blender/draw/intern/draw_view_data.h b/source/blender/draw/intern/draw_view_data.h index 918b9e81f87..f2c34c15f08 100644 --- a/source/blender/draw/intern/draw_view_data.h +++ b/source/blender/draw/intern/draw_view_data.h @@ -107,6 +107,7 @@ ViewportEngineData *DRW_view_data_engine_data_get_ensure(DRWViewData *view_data, void DRW_view_data_use_engine(DRWViewData *view_data, struct DrawEngineType *engine_type); void DRW_view_data_reset(DRWViewData *view_data); void DRW_view_data_free_unused(DRWViewData *view_data); +void DRW_view_data_engines_view_update(DRWViewData *view_data); double *DRW_view_data_cache_time_get(DRWViewData *view_data); DefaultFramebufferList *DRW_view_data_default_framebuffer_list_get(DRWViewData *view_data); DefaultTextureList *DRW_view_data_default_texture_list_get(DRWViewData *view_data); -- cgit v1.2.3