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-03 16:57:22 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-08-03 16:57:22 +0300
commit7cfb05dcb0790cc4aa209ecb63649aa756cb730f (patch)
tree28aa72d4ef934d2f3c3206e653a522f9844ed8ba /source/blender/blenkernel
parentb4e1b7b18c16f5fa7e8b7f475061e73dad3f4338 (diff)
OpenSubdiv: Resolve crashes when other object depends on subsurf-ed object
Cases like using subsurfed object as a boolean operand can't be evaluated on GPU and needs to have all the CCG on CPU. This commit resolves existing configuration to survive, but new configurations would need to have some sort of forced object update so all the data is being moved on CPU if it was previously on GPU.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_depsgraph.h4
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c7
2 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_depsgraph.h b/source/blender/blenkernel/BKE_depsgraph.h
index 862f91f567e..7d7db332dd2 100644
--- a/source/blender/blenkernel/BKE_depsgraph.h
+++ b/source/blender/blenkernel/BKE_depsgraph.h
@@ -72,6 +72,10 @@ enum {
* who're using curve deform, where_on_path and so.
*/
DAG_EVAL_NEED_CURVE_PATH = 1,
+ /* Scene evaluation would need to have object's data on CPU,
+ * meaning no GPU shortcuts is allowed.
+ */
+ DAG_EVAL_NEED_CPU = 2,
};
/* Global initialization/deinitialization */
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 2fd53045e29..b7ad43869b7 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -1138,6 +1138,13 @@ void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel
/* parent relation is for cycle checking */
dag_add_parent_relation(forest, fob1, fob2, rel, name);
+ /* 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;
+ }
+#endif
+
while (itA) { /* search if relation exist already */
if (itA->node == fob2) {
itA->type |= rel;