[Bf-blender-cvs] [48d4b0d] depsgraph_refactor: Modified API's for adding operations to handle opcodes

Joshua Leung noreply at git.blender.org
Wed Dec 17 04:41:02 CET 2014


Commit: 48d4b0dd050e4113cdb9348877d4fc7e0a876567
Author: Joshua Leung
Date:   Sat Dec 13 02:14:22 2014 +1300
Branches: depsgraph_refactor
https://developer.blender.org/rB48d4b0dd050e4113cdb9348877d4fc7e0a876567

Modified API's for adding operations to handle opcodes

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

M	source/blender/depsgraph/intern/depsgraph_build.cpp
M	source/blender/depsgraph/intern/depsgraph_build.h
M	source/blender/depsgraph/intern/depsnode_component.cpp
M	source/blender/depsgraph/intern/depsnode_component.h

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

diff --git a/source/blender/depsgraph/intern/depsgraph_build.cpp b/source/blender/depsgraph/intern/depsgraph_build.cpp
index 3560ad8..e03bd9c 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build.cpp
@@ -215,19 +215,21 @@ ComponentDepsNode *DepsgraphNodeBuilder::add_component_node(ID *id, eDepsNode_Ty
 }
 
 OperationDepsNode *DepsgraphNodeBuilder::add_operation_node(ComponentDepsNode *comp_node,
-                                                            eDepsOperation_Type optype, DepsEvalOperationCb op, const string &description)
+                                                            eDepsOperation_Type optype, DepsEvalOperationCb op, 
+                                                            eDepsOperation_Code opcode, const string &description)
 {
-	OperationDepsNode *op_node = comp_node->add_operation(optype, op, description);
+	OperationDepsNode *op_node = comp_node->add_operation(optype, op, opcode, description);
 	m_graph->operations.push_back(op_node);
 	return op_node;
 }
 
 OperationDepsNode *DepsgraphNodeBuilder::add_operation_node(ID *id, eDepsNode_Type comp_type, const string &comp_name,
-                                                            eDepsOperation_Type optype, DepsEvalOperationCb op, const string &description)
+                                                            eDepsOperation_Type optype, DepsEvalOperationCb op,
+                                                            eDepsOperation_Code opcode, const string &description)
 {
 	ComponentDepsNode *comp_node = add_component_node(id, comp_type, comp_name);
 	
-	OperationDepsNode *op_node = comp_node->add_operation(optype, op, description);
+	OperationDepsNode *op_node = comp_node->add_operation(optype, op, opcode, description);
 	m_graph->operations.push_back(op_node);
 	
 	return op_node;
@@ -260,7 +262,7 @@ void DepsgraphNodeBuilder::verify_entry_exit_operations(ComponentDepsNode *node)
 	}
 	else if (entry_ops.size() > 1) {
 		/* multiple entry ops, add a barrier node as a single entry point */
-		node->entry_operation = add_operation_node(node, DEPSOP_TYPE_INIT, NULL, "Entry");
+		node->entry_operation = add_operation_node(node, DEPSOP_TYPE_INIT, NULL, DEG_OPCODE_NOOP, "Entry");
 		for (OperationsVector::const_iterator it = entry_ops.begin(); it != entry_ops.end(); ++it) {
 			OperationDepsNode *op_node = *it;
 			m_graph->add_new_relation(node->entry_operation, op_node, DEPSREL_TYPE_OPERATION, "Component entry relation");
@@ -273,7 +275,7 @@ void DepsgraphNodeBuilder::verify_entry_exit_operations(ComponentDepsNode *node)
 	}
 	else if (exit_ops.size() > 1) {
 		/* multiple exit ops, add a barrier node as a single exit point */
-		node->exit_operation = add_operation_node(node, DEPSOP_TYPE_OUT, NULL, "Exit");
+		node->exit_operation = add_operation_node(node, DEPSOP_TYPE_OUT, NULL, DEG_OPCODE_NOOP, "Exit");
 		for (OperationsVector::const_iterator it = exit_ops.begin(); it != exit_ops.end(); ++it) {
 			OperationDepsNode *op_node = *it;
 			m_graph->add_new_relation(op_node, node->exit_operation, DEPSREL_TYPE_OPERATION, "Component exit relation");
@@ -357,6 +359,7 @@ OperationDepsNode *DepsgraphRelationBuilder::find_node(const OperationKey &key)
 	if (!comp_node)
 		return NULL;
 	
+	// XXX...
 	OperationDepsNode *op_node = comp_node->find_operation(key.name);
 	return op_node;
 }
diff --git a/source/blender/depsgraph/intern/depsgraph_build.h b/source/blender/depsgraph/intern/depsgraph_build.h
index 0fa1b6a..ff22b01 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.h
+++ b/source/blender/depsgraph/intern/depsgraph_build.h
@@ -67,14 +67,14 @@ struct DepsgraphNodeBuilder {
 	
 	ComponentDepsNode *add_component_node(ID *id, eDepsNode_Type comp_type, const string &comp_name = "");
 	
-	OperationDepsNode *add_operation_node(ComponentDepsNode *comp_node,
-	                                      eDepsOperation_Type optype, DepsEvalOperationCb op, const string &description);
-	OperationDepsNode *add_operation_node(ID *id, eDepsNode_Type comp_type, const string &comp_name,
-	                                      eDepsOperation_Type optype, DepsEvalOperationCb op, const string &description);
-	OperationDepsNode *add_operation_node(ID *id, eDepsNode_Type comp_type,
-	                                      eDepsOperation_Type optype, DepsEvalOperationCb op, const string &description)
+	OperationDepsNode *add_operation_node(ComponentDepsNode *comp_node, eDepsOperation_Type optype,
+	                                      DepsEvalOperationCb op, eDepsOperation_Code opcode, const string &description = "");
+	OperationDepsNode *add_operation_node(ID *id, eDepsNode_Type comp_type, const string &comp_name, eDepsOperation_Type optype,
+	                                      DepsEvalOperationCb op, eDepsOperation_Code opcode, const string &description = "");
+	OperationDepsNode *add_operation_node(ID *id, eDepsNode_Type comp_type, eDepsOperation_Type optype,
+	                                      DepsEvalOperationCb op, eDepsOperation_Code opcode, const string &description = "")
 	{
-		return add_operation_node(id, comp_type, "", optype, op, description);
+		return add_operation_node(id, comp_type, "", optype, op, opcode, description);
 	}
 	
 	void verify_entry_exit_operations();
diff --git a/source/blender/depsgraph/intern/depsnode_component.cpp b/source/blender/depsgraph/intern/depsnode_component.cpp
index 647ed5d..facede3 100644
--- a/source/blender/depsgraph/intern/depsnode_component.cpp
+++ b/source/blender/depsgraph/intern/depsnode_component.cpp
@@ -91,7 +91,7 @@ OperationDepsNode *ComponentDepsNode::find_operation(const string &name) const
 	return it != this->operations.end() ? it->second : NULL;
 }
 
-OperationDepsNode *ComponentDepsNode::add_operation(eDepsOperation_Type optype, DepsEvalOperationCb op, const string &name)
+OperationDepsNode *ComponentDepsNode::add_operation(eDepsOperation_Type optype, DepsEvalOperationCb op, eDepsOperation_Code opcode, const string &name)
 {
 	OperationDepsNode *op_node = find_operation(name);
 	if (!op_node) {
@@ -106,6 +106,7 @@ OperationDepsNode *ComponentDepsNode::add_operation(eDepsOperation_Type optype,
 	/* attach extra data */
 	op_node->evaluate = op;
 	op_node->optype = optype;
+	op_node->opcode = opcode;
 	op_node->name = name;
 	
 	return op_node;
diff --git a/source/blender/depsgraph/intern/depsnode_component.h b/source/blender/depsgraph/intern/depsnode_component.h
index 4ee31b4..2ce3b4b 100644
--- a/source/blender/depsgraph/intern/depsnode_component.h
+++ b/source/blender/depsgraph/intern/depsnode_component.h
@@ -64,7 +64,7 @@ struct ComponentDepsNode : public DepsNode {
 	 * < op: The operation to perform
 	 * < name: Identifier for operation - used to find/locate it again
 	 */
-	OperationDepsNode *add_operation(eDepsOperation_Type optype, DepsEvalOperationCb op, const string &name);
+	OperationDepsNode *add_operation(eDepsOperation_Type optype, DepsEvalOperationCb op, eDepsOperation_Code opcode, const string &name);
 	void remove_operation(const string &name);
 	void clear_operations();




More information about the Bf-blender-cvs mailing list