Commit: 6becdf5d001bdad59b2d191d2ebff5f5da115014 Author: Sergey Sharybin Date: Tue Jun 13 15:10:29 2017 +0200 Branches: master https://developer.blender.org/rB6becdf5d001bdad59b2d191d2ebff5f5da115014
Depsgraph: Pass function bindings by const reference Avoids using copy-constructor invoked every time we pass function to the builder functions. Should lower number of CPU ticks spent during DEG construction. =================================================================== M source/blender/depsgraph/intern/builder/deg_builder_nodes.cc M source/blender/depsgraph/intern/builder/deg_builder_nodes.h M source/blender/depsgraph/intern/nodes/deg_node_component.cc M source/blender/depsgraph/intern/nodes/deg_node_component.h =================================================================== diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index ff5cba89741..4419f65d8bf 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -183,7 +183,7 @@ ComponentDepsNode *DepsgraphNodeBuilder::add_component_node( OperationDepsNode *DepsgraphNodeBuilder::add_operation_node( ComponentDepsNode *comp_node, - DepsEvalOperationCb op, + const DepsEvalOperationCb& op, eDepsOperation_Code opcode, const char *name, int name_tag) @@ -210,7 +210,7 @@ OperationDepsNode *DepsgraphNodeBuilder::add_operation_node( ID *id, eDepsNode_Type comp_type, const char *comp_name, - DepsEvalOperationCb op, + const DepsEvalOperationCb& op, eDepsOperation_Code opcode, const char *name, int name_tag) @@ -222,7 +222,7 @@ OperationDepsNode *DepsgraphNodeBuilder::add_operation_node( OperationDepsNode *DepsgraphNodeBuilder::add_operation_node( ID *id, eDepsNode_Type comp_type, - DepsEvalOperationCb op, + const DepsEvalOperationCb& op, eDepsOperation_Code opcode, const char *name, int name_tag) diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index 6bc1c1dead4..a54b1c76c77 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -80,20 +80,20 @@ struct DepsgraphNodeBuilder { const char *comp_name = ""); OperationDepsNode *add_operation_node(ComponentDepsNode *comp_node, - DepsEvalOperationCb op, + const DepsEvalOperationCb& op, eDepsOperation_Code opcode, const char *name = "", int name_tag = -1); OperationDepsNode *add_operation_node(ID *id, eDepsNode_Type comp_type, const char *comp_name, - DepsEvalOperationCb op, + const DepsEvalOperationCb& op, eDepsOperation_Code opcode, const char *name = "", int name_tag = -1); OperationDepsNode *add_operation_node(ID *id, eDepsNode_Type comp_type, - DepsEvalOperationCb op, + const DepsEvalOperationCb& op, eDepsOperation_Code opcode, const char *name = "", int name_tag = -1); diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.cc b/source/blender/depsgraph/intern/nodes/deg_node_component.cc index 4a7667c485c..e87c87813e3 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_component.cc +++ b/source/blender/depsgraph/intern/nodes/deg_node_component.cc @@ -198,7 +198,7 @@ OperationDepsNode *ComponentDepsNode::has_operation(eDepsOperation_Code opcode, return has_operation(key); } -OperationDepsNode *ComponentDepsNode::add_operation(DepsEvalOperationCb op, +OperationDepsNode *ComponentDepsNode::add_operation(const DepsEvalOperationCb& op, eDepsOperation_Code opcode, const char *name, int name_tag) diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.h b/source/blender/depsgraph/intern/nodes/deg_node_component.h index f476d8ff202..4ef7dad3ac6 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_component.h +++ b/source/blender/depsgraph/intern/nodes/deg_node_component.h @@ -99,7 +99,7 @@ struct ComponentDepsNode : public DepsNode { * \param op: The operation to perform * \param name: Identifier for operation - used to find/locate it again */ - OperationDepsNode *add_operation(DepsEvalOperationCb op, + OperationDepsNode *add_operation(const DepsEvalOperationCb& op, eDepsOperation_Code opcode, const char *name, int name_tag); _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs