diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-28 14:56:01 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-28 16:24:56 +0300 |
commit | db2a603f6ef8ffc6f0b72fe108710d88ccd2f85d (patch) | |
tree | 7492e592b577bbb0cea3721e33ae5ffb3a27835e | |
parent | 86bfce6794a527e553b3a9a294dda89f035ed3b6 (diff) |
Depsgraph: Remove workaround for Blender Internal in viewport
This commit effectively reverts fix T45702 done in 067fe2719a99.
Reasoning:
- Blender Internal is being replaced with Eevee, and will be removed entirely
rather soon.
- All render engines are planned to have own depsgraph, so such threading
conflicts should no longer be an issue.
- We don't want to spend time on porting workarounds for EOL things to a new
design. Less code -- faster the work :)
- If such notifications will end up needed for some other cases, we would
need to re-implement this a more proper depsgraph tagging/flushing and make
it to work with all copy-on-write datablocks and everything.
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 6 | ||||
-rw-r--r-- | source/blender/depsgraph/DEG_depsgraph.h | 8 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph.cc | 12 | ||||
-rw-r--r-- | source/blender/editors/include/ED_render.h | 1 | ||||
-rw-r--r-- | source/blender/editors/render/render_update.c | 17 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 3 |
6 files changed, 4 insertions, 43 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 7fa7aa71eae..a345a273cac 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1562,11 +1562,7 @@ void BKE_scene_graph_update_for_newframe(EvaluationContext *eval_ctx, * for example, clearing update tags from bmain. */ const float ctime = BKE_scene_frame_get(scene); - /* Inform editors we are starting scene update. */ - DEG_editors_update_pre(bmain, scene, true); - /* Keep this first. - * TODO(sergey): Should it be after the editors update? - */ + /* Keep this first. */ BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_FRAME_CHANGE_PRE); /* Update animated image textures for particles, modifiers, gpu, etc, * call this at the start so modifiers with textures don't lag 1 frame. diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h index 930794a1778..dc6afee409c 100644 --- a/source/blender/depsgraph/DEG_depsgraph.h +++ b/source/blender/depsgraph/DEG_depsgraph.h @@ -252,16 +252,10 @@ typedef void (*DEG_EditorUpdateIDCb)(struct Main *bmain, struct ID *id); typedef void (*DEG_EditorUpdateSceneCb)(struct Main *bmain, struct Scene *scene, int updated); -typedef void (*DEG_EditorUpdateScenePreCb)(struct Main *bmain, - struct Scene *scene, - bool time); /* Set callbacks which are being called when depsgraph changes. */ void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, - DEG_EditorUpdateSceneCb scene_func, - DEG_EditorUpdateScenePreCb scene_pre_func); - -void DEG_editors_update_pre(struct Main *bmain, struct Scene *scene, bool time); + DEG_EditorUpdateSceneCb scene_func); #ifdef __cplusplus } /* extern "C" */ diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index d4907eeff46..d60d4ad5a6f 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -78,7 +78,6 @@ namespace DEG { static DEG_EditorUpdateIDCb deg_editor_update_id_cb = NULL; static DEG_EditorUpdateSceneCb deg_editor_update_scene_cb = NULL; -static DEG_EditorUpdateScenePreCb deg_editor_update_scene_pre_cb = NULL; Depsgraph::Depsgraph() : time_source(NULL), @@ -513,17 +512,8 @@ void DEG_graph_free(Depsgraph *graph) /* Set callbacks which are being called when depsgraph changes. */ void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, - DEG_EditorUpdateSceneCb scene_func, - DEG_EditorUpdateScenePreCb scene_pre_func) + DEG_EditorUpdateSceneCb scene_func) { DEG::deg_editor_update_id_cb = id_func; DEG::deg_editor_update_scene_cb = scene_func; - DEG::deg_editor_update_scene_pre_cb = scene_pre_func; -} - -void DEG_editors_update_pre(Main *bmain, Scene *scene, bool time) -{ - if (DEG::deg_editor_update_scene_pre_cb != NULL) { - DEG::deg_editor_update_scene_pre_cb(bmain, scene, time); - } } diff --git a/source/blender/editors/include/ED_render.h b/source/blender/editors/include/ED_render.h index 707d7c6c693..1898b9cb5d1 100644 --- a/source/blender/editors/include/ED_render.h +++ b/source/blender/editors/include/ED_render.h @@ -49,7 +49,6 @@ void ED_render_id_flush_update(struct Main *bmain, struct ID *id); void ED_render_engine_changed(struct Main *bmain); void ED_render_engine_area_exit(struct Main *bmain, struct ScrArea *sa); void ED_render_scene_update(struct Main *bmain, struct Scene *scene, int updated); -void ED_render_scene_update_pre(struct Main *bmain, struct Scene *scene, bool time); void ED_viewport_render_kill_jobs(struct wmWindowManager *wm, struct Main *bmain, bool free_database); struct Scene *ED_render_job_get_scene(const struct bContext *C); diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c index 8956ef79958..2a316e1c793 100644 --- a/source/blender/editors/render/render_update.c +++ b/source/blender/editors/render/render_update.c @@ -163,23 +163,6 @@ void ED_render_scene_update(Main *bmain, Scene *scene, int updated) recursive_check = false; } -void ED_render_scene_update_pre(Main *bmain, Scene *scene, bool time) -{ - /* Blender internal might access to the data which is gonna to be freed - * by the scene update functions. This applies for example to simulation - * data like smoke and fire. - */ - if (time && !BKE_scene_use_new_shading_nodes(scene)) { - bScreen *sc; - ScrArea *sa; - for (sc = bmain->screen.first; sc; sc = sc->id.next) { - for (sa = sc->areabase.first; sa; sa = sa->next) { - ED_render_engine_area_exit(bmain, sa); - } - } - } -} - void ED_render_engine_area_exit(Main *bmain, ScrArea *sa) { /* clear all render engines in this area */ diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index fc1805e102f..4975e818051 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -178,8 +178,7 @@ void WM_init(bContext *C, int argc, const char **argv) BKE_blender_callback_test_break_set(wm_window_testbreak); /* blender.c */ BKE_spacedata_callback_id_remap_set(ED_spacedata_id_remap); /* screen.c */ DEG_editors_set_update_cb(ED_render_id_flush_update, - ED_render_scene_update, - ED_render_scene_update_pre); + ED_render_scene_update); ED_spacetypes_init(); /* editors/space_api/spacetype.c */ |