diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-08-03 16:57:22 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-08-03 16:57:22 +0300 |
commit | 7cfb05dcb0790cc4aa209ecb63649aa756cb730f (patch) | |
tree | 28aa72d4ef934d2f3c3206e653a522f9844ed8ba /source/blender/depsgraph | |
parent | b4e1b7b18c16f5fa7e8b7f475061e73dad3f4338 (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/depsgraph')
-rw-r--r-- | source/blender/depsgraph/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/depsgraph/SConscript | 3 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph.cc | 9 |
3 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/depsgraph/CMakeLists.txt b/source/blender/depsgraph/CMakeLists.txt index dcdb14d0ba0..f3ff709e98b 100644 --- a/source/blender/depsgraph/CMakeLists.txt +++ b/source/blender/depsgraph/CMakeLists.txt @@ -115,4 +115,8 @@ if(WITH_BOOST) add_definitions(-DHAVE_BOOST_FUNCTION_BINDINGS) endif() +if(WITH_OPENSUBDIV) + add_definitions(-DWITH_OPENSUBDIV) +endif() + blender_add_lib(bf_depsgraph "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/depsgraph/SConscript b/source/blender/depsgraph/SConscript index dd0552e19a2..7f49e8f4643 100644 --- a/source/blender/depsgraph/SConscript +++ b/source/blender/depsgraph/SConscript @@ -69,6 +69,9 @@ else: if env['WITH_BF_LEGACY_DEPSGRAPH']: defs.append('WITH_LEGACY_DEPSGRAPH') +if env['WITH_BF_OPENSUBDIV']: + defs.append('WITH_OPENSUBDIV') + env.BlenderLib(libname='bf_depsgraph', sources=sources, includes=incs, defines=defs, libtype=['core', 'player'], priority=[200, 40]) diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index e9b2a06cf7b..94c01f362be 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -44,6 +44,8 @@ extern "C" { #include "DNA_object_types.h" #include "DNA_sequence_types.h" +#include "BKE_depsgraph.h" + #include "RNA_access.h" } @@ -351,6 +353,13 @@ DepsRelation *Depsgraph::add_new_relation(OperationDepsNode *from, { /* Create new relation, and add it to the graph. */ DepsRelation *rel = OBJECT_GUARDED_NEW(DepsRelation, from, to, type, description); + /* TODO(sergey): Find a better place for this. */ +#ifdef WITH_OPENSUBDIV + if (type == DEPSREL_TYPE_GEOMETRY_EVAL) { + IDDepsNode *id_to = to->owner->owner; + id_to->eval_flags |= DAG_EVAL_NEED_CPU; + } +#endif return rel; } |