OpenSubdiv: Fix crash toggling edit mode with new depsgraph
This commit is contained in:
parent
efc6f9438f
commit
43dab7833a
|
@ -1804,6 +1804,11 @@ void BKE_scene_update_tagged(EvaluationContext *eval_ctx, Main *bmain, Scene *sc
|
|||
else
|
||||
#endif
|
||||
{
|
||||
#ifdef OPENSUBDIV_GL_WORKAROUND
|
||||
if (DEG_needs_eval(scene->depsgraph)) {
|
||||
scene_free_unused_opensubdiv_cache(scene);
|
||||
}
|
||||
#endif
|
||||
DEG_evaluate_on_refresh(eval_ctx, scene->depsgraph, scene);
|
||||
/* TODO(sergey): This is to beocme a node in new depsgraph. */
|
||||
BKE_mask_update_scene(bmain, scene);
|
||||
|
|
|
@ -193,6 +193,8 @@ void DEG_evaluate_on_refresh(struct EvaluationContext *eval_ctx,
|
|||
Depsgraph *graph,
|
||||
struct Scene *scene);
|
||||
|
||||
bool DEG_needs_eval(Depsgraph *graph);
|
||||
|
||||
/* Editors Integration -------------------------- */
|
||||
|
||||
/* Mechanism to allow editors to be informed of depsgraph updates,
|
||||
|
|
|
@ -392,3 +392,8 @@ void DEG_evaluate_on_framechange(EvaluationContext *eval_ctx,
|
|||
/* Perform recalculation updates. */
|
||||
DEG_evaluate_on_refresh_ex(eval_ctx, graph, layers);
|
||||
}
|
||||
|
||||
bool DEG_needs_eval(Depsgraph *graph)
|
||||
{
|
||||
return graph->entry_tags.size() != 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue