[Bf-blender-cvs] [4a0f3be] master: OpenSubdiv: Make new geometry relations ensures dependent data exists on CPU

Sergey Sharybin noreply at git.blender.org
Mon Aug 3 16:16:40 CEST 2015


Commit: 4a0f3bece31be4997dd19c8ee8faa5ae6a1914e3
Author: Sergey Sharybin
Date:   Mon Aug 3 16:04:33 2015 +0200
Branches: master
https://developer.blender.org/rB4a0f3bece31be4997dd19c8ee8faa5ae6a1914e3

OpenSubdiv: Make new geometry relations ensures dependent data exists on CPU

===================================================================

M	source/blender/blenkernel/intern/depsgraph.c
M	source/blender/depsgraph/intern/depsgraph.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index b7ad438..62491f1 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -1141,7 +1141,14 @@ void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel
 	/* TODO(sergey): Find a better place for this. */
 #ifdef WITH_OPENSUBDIV
 	if ((rel & DAG_RL_DATA_DATA) != 0) {
-		fob1->eval_flags |= DAG_EVAL_NEED_CPU;
+		if (fob1->type == ID_OB) {
+			if ((fob1->eval_flags & DAG_EVAL_NEED_CPU) == 0) {
+				Object *object = fob1->ob;
+				/* Make sure object has all the data on CPU. */
+				object->recalc |= OB_RECALC_DATA;
+				fob1->eval_flags |= DAG_EVAL_NEED_CPU;
+			}
+		}
 	}
 #endif
 
diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc
index 94c01f3..12b3a36 100644
--- a/source/blender/depsgraph/intern/depsgraph.cc
+++ b/source/blender/depsgraph/intern/depsgraph.cc
@@ -357,7 +357,10 @@ DepsRelation *Depsgraph::add_new_relation(OperationDepsNode *from,
 #ifdef WITH_OPENSUBDIV
 	if (type == DEPSREL_TYPE_GEOMETRY_EVAL) {
 		IDDepsNode *id_to = to->owner->owner;
-		id_to->eval_flags |= DAG_EVAL_NEED_CPU;
+		if ((id_to->eval_flags & DAG_EVAL_NEED_CPU) == 0) {
+			id_to->tag_update(this);
+			id_to->eval_flags |= DAG_EVAL_NEED_CPU;
+		}
 	}
 #endif
 	return rel;




More information about the Bf-blender-cvs mailing list