diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_engine.c | 2 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 12 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_view_data.cc | 10 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_view_data.h | 1 |
4 files changed, 14 insertions, 11 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c index f04405d7110..5ae4b730cfa 100644 --- a/source/blender/draw/engines/eevee/eevee_engine.c +++ b/source/blender/draw/engines/eevee/eevee_engine.c @@ -366,7 +366,7 @@ static void eevee_draw_scene(void *vedata) static void eevee_view_update(void *vedata) { EEVEE_StorageList *stl = ((EEVEE_Data *)vedata)->stl; - if (stl->g_data) { + if (stl && stl->g_data) { stl->g_data->view_updated = true; } } 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(); } diff --git a/source/blender/draw/intern/draw_view_data.cc b/source/blender/draw/intern/draw_view_data.cc index 3dc28dc9a9a..55f1ab83b3a 100644 --- a/source/blender/draw/intern/draw_view_data.cc +++ b/source/blender/draw/intern/draw_view_data.cc @@ -197,6 +197,16 @@ void DRW_view_data_free_unused(DRWViewData *view_data) } } +void DRW_view_data_engines_view_update(DRWViewData *view_data) +{ + for (ViewportEngineData &engine_data : view_data->engines) { + DrawEngineType *draw_engine = engine_data.engine_type->draw_engine; + if (draw_engine->view_update) { + draw_engine->view_update(&engine_data); + } + } +} + double *DRW_view_data_cache_time_get(DRWViewData *view_data) { return &view_data->cache_time; 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); |