OpenSubdiv: Fix crash toggling edit mode with new depsgraph

This commit is contained in:
Sergey Sharybin 2015-08-27 12:01:20 +02:00
parent efc6f9438f
commit 43dab7833a
3 changed files with 12 additions and 0 deletions

View File

@ -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);

View File

@ -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,

View File

@ -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;
}