Depsgraph: Remove workaround for Blender Internal in viewport
This commit effectively reverts fix T45702 done in 067fe2719a.
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.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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" */
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user