Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 15 Dec 2017 16:55:23 +0000 (17:55 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 15 Dec 2017 16:55:23 +0000 (17:55 +0100)
1  2 
source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
source/blender/depsgraph/intern/depsgraph.cc
source/blender/depsgraph/intern/depsgraph_intern.h
source/blender/depsgraph/intern/depsgraph_type_defines.cc
source/blender/depsgraph/intern/depsgraph_types.h
source/blender/depsgraph/intern/nodes/deg_node.cc
source/blender/depsgraph/intern/nodes/deg_node_component.cc

index 5111db08e035eeb0fb935b45ab06cdf976f1706c,d7457b9eb6c92a40342a17223bcdf6fe158fafce..bd3d74b307bb9b59230c2323a0d757aa7fd56f6f
@@@ -398,11 -403,9 +398,13 @@@ static void deg_debug_graphviz_node(con
                        }
                        break;
                }
 -              default:
 +              case DEG_NODE_TYPE_UNDEFINED:
 +              case DEG_NODE_TYPE_TIMESOURCE:
 +              case DEG_NODE_TYPE_OPERATION:
                        deg_debug_graphviz_node_single(ctx, node);
                        break;
++              case NUM_DEG_NODE_TYPES:
++                      break;
        }
  }
  
index 1227db4c1bb98ad69723f90af896f3bb638550a3,30ab21b1d8cc66f6cc38f01320dc4276d4a7d210..995157f5c9a6c2045f689ec0f7608841c0d75c3c
@@@ -279,27 -273,15 +279,27 @@@ IDDepsNode *Depsgraph::find_id_node(con
        return reinterpret_cast<IDDepsNode *>(BLI_ghash_lookup(id_hash, id));
  }
  
 -IDDepsNode *Depsgraph::add_id_node(ID *id, const char *name)
 +IDDepsNode *Depsgraph::add_id_node(ID *id, bool do_tag, ID *id_cow_hint)
  {
 +      BLI_assert((id->tag & LIB_TAG_COPY_ON_WRITE) == 0);
        IDDepsNode *id_node = find_id_node(id);
        if (!id_node) {
-               DepsNodeFactory *factory = deg_get_node_factory(DEG_NODE_TYPE_ID_REF);
+               DepsNodeFactory *factory = deg_type_get_factory(DEG_NODE_TYPE_ID_REF);
 -              id_node = (IDDepsNode *)factory->create_node(id, "", name);
 -              id->tag |= LIB_TAG_DOIT;
 -              /* register */
 +              id_node = (IDDepsNode *)factory->create_node(id, "", id->name);
 +              id_node->init_copy_on_write(id_cow_hint);
 +              if (do_tag) {
 +                      id->tag |= LIB_TAG_DOIT;
 +              }
 +              /* Register node in ID hash.
 +               *
 +               * NOTE: We address ID nodes by the original ID pointer they are
 +               * referencing to.
 +               */
                BLI_ghash_insert(id_hash, id, id_node);
 +              id_nodes.push_back(id_node);
 +      }
 +      else if (do_tag) {
 +              id->tag |= LIB_TAG_DOIT;
        }
        return id_node;
  }
index b12becc5589f04101af14cbd068f18a41a3f39ef,b2dbe5d2a6278397538e867e06ee1e19585346b3..d091f42bf8094f6e3244cad279adfab90e5fb190
@@@ -144,11 -122,11 +144,14 @@@ typedef enum eDepsNode_Type 
        DEG_NODE_TYPE_EVAL_PARTICLES,
        /* Material Shading Component */
        DEG_NODE_TYPE_SHADING,
 +      DEG_NODE_TYPE_SHADING_PARAMETERS,
        /* Cache Component */
        DEG_NODE_TYPE_CACHE,
 +      /* Batch Cache Component */
 +      DEG_NODE_TYPE_BATCH_CACHE,
+       /* Total number of meaningful node types. */
+       NUM_DEG_NODE_TYPES,
  } eDepsNode_Type;
  
  /* Identifiers for common operations (as an enum). */
index 6229159632306361b6ef2764b9c306158f02301f,1d4d542e7cc0e1d29b2be9b37ec6ee109ca24626..3f70f8e128103f886cece5ee19ba01735da0ef3f
@@@ -250,8 -202,8 +250,8 @@@ ComponentDepsNode *IDDepsNode::add_comp
  {
        ComponentDepsNode *comp_node = find_component(type, name);
        if (!comp_node) {
-               DepsNodeFactory *factory = deg_get_node_factory(type);
+               DepsNodeFactory *factory = deg_type_get_factory(type);
 -              comp_node = (ComponentDepsNode *)factory->create_node(this->id, "", name);
 +              comp_node = (ComponentDepsNode *)factory->create_node(this->id_orig, "", name);
  
                /* Register. */
                ComponentIDKey *key = OBJECT_GUARDED_NEW(ComponentIDKey, type, name);
index 011814539829da80d34d09b25df55ffcb873be5c,17f35acee79c9eb7755276c373fe6ca1598eec0c..f4530ecebdb27497402c237fcfa7da169d92ba34
@@@ -227,8 -231,8 +227,8 @@@ OperationDepsNode *ComponentDepsNode::a
  {
        OperationDepsNode *op_node = find_operation(opcode, name, name_tag);
        if (!op_node) {
-               DepsNodeFactory *factory = deg_get_node_factory(DEG_NODE_TYPE_OPERATION);
+               DepsNodeFactory *factory = deg_type_get_factory(DEG_NODE_TYPE_OPERATION);
 -              op_node = (OperationDepsNode *)factory->create_node(this->owner->id, "", name);
 +              op_node = (OperationDepsNode *)factory->create_node(this->owner->id_orig, "", name);
  
                /* register opnode in this component's operation set */
                OperationIDKey *key = OBJECT_GUARDED_NEW(OperationIDKey, opcode, name, name_tag);