Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/render/render_update.c
| Show All 37 Lines | |||||
| #include "DRW_engine.h" | #include "DRW_engine.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_threads.h" | #include "BLI_threads.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_global.h" | |||||
| #include "BKE_icons.h" | #include "BKE_icons.h" | ||||
| #include "BKE_layer.h" | #include "BKE_layer.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_material.h" | #include "BKE_material.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "BKE_workspace.h" | #include "BKE_workspace.h" | ||||
| #include "RE_engine.h" | #include "RE_engine.h" | ||||
| #include "RE_pipeline.h" | #include "RE_pipeline.h" | ||||
| #include "ED_node.h" | #include "ED_node.h" | ||||
| #include "ED_render.h" | #include "ED_render.h" | ||||
| #include "ED_view3d.h" | #include "ED_view3d.h" | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "GPU_extensions.h" | |||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "render_intern.h" // own include | #include "render_intern.h" // own include | ||||
| /***************************** Render Engines ********************************/ | /***************************** Render Engines ********************************/ | ||||
| void ED_render_scene_update(const DEGEditorUpdateContext *update_ctx, int updated) | void ED_render_scene_update(const DEGEditorUpdateContext *update_ctx, int updated) | ||||
| { | { | ||||
| /* viewport rendering update on data changes, happens after depsgraph | /* viewport rendering update on data changes, happens after depsgraph | ||||
| * updates if there was any change. context is set to the 3d view */ | * updates if there was any change. context is set to the 3d view */ | ||||
| Main *bmain = update_ctx->bmain; | Main *bmain = update_ctx->bmain; | ||||
| Scene *scene = update_ctx->scene; | Scene *scene = update_ctx->scene; | ||||
| ViewLayer *view_layer = update_ctx->view_layer; | ViewLayer *view_layer = update_ctx->view_layer; | ||||
| bContext *C; | bContext *C; | ||||
| wmWindowManager *wm; | wmWindowManager *wm; | ||||
| wmWindow *win; | wmWindow *win; | ||||
| static bool recursive_check = false; | static bool recursive_check = false; | ||||
| /* don't do this render engine update if we're updating the scene from | /* don't do this render engine update if we're updating the scene from | ||||
| * other threads doing e.g. rendering or baking jobs */ | * other threads doing e.g. rendering or baking jobs */ | ||||
| if (!BLI_thread_is_main()) { | if (!BLI_thread_is_main()) { | ||||
| return; | return; | ||||
| } | } | ||||
| /* When rendering EEVEE using the main thread we should also skip the view update. EEVEE motion | |||||
| * blur can trigger a scene update. Normally the `BLI_thread_is_main` should exit this case. */ | |||||
| if (G.is_rendering && GPU_main_thread_workaround() && BKE_scene_uses_blender_eevee(scene)) { | |||||
| return; | |||||
| } | |||||
| /* don't call this recursively for frame updates */ | /* don't call this recursively for frame updates */ | ||||
| if (recursive_check) { | if (recursive_check) { | ||||
| return; | return; | ||||
| } | } | ||||
| /* Do not call if no WM available, see T42688. */ | /* Do not call if no WM available, see T42688. */ | ||||
| if (BLI_listbase_is_empty(&bmain->wm)) { | if (BLI_listbase_is_empty(&bmain->wm)) { | ||||
| ▲ Show 20 Lines • Show All 228 Lines • Show Last 20 Lines | |||||