Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-08-27 13:01:20 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-08-27 13:01:20 +0300
commit43dab7833ab06f5d2939023bee29e999b310310b (patch)
treea8cacb220ce309ff6eb7ca3f72d95ca192effb52
parentefc6f9438f3dc624b1d6156036bd57ddce952747 (diff)
OpenSubdiv: Fix crash toggling edit mode with new depsgraph
-rw-r--r--source/blender/blenkernel/intern/scene.c5
-rw-r--r--source/blender/depsgraph/DEG_depsgraph.h2
-rw-r--r--source/blender/depsgraph/intern/depsgraph_eval.cc5
3 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 701483af43f..9e3af970afd 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -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);
diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h
index b91f99ecd20..a772f4ee2e3 100644
--- a/source/blender/depsgraph/DEG_depsgraph.h
+++ b/source/blender/depsgraph/DEG_depsgraph.h
@@ -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,
diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cc b/source/blender/depsgraph/intern/depsgraph_eval.cc
index 0a1563e7704..e8065766332 100644
--- a/source/blender/depsgraph/intern/depsgraph_eval.cc
+++ b/source/blender/depsgraph/intern/depsgraph_eval.cc
@@ -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;
+}