Depsgraph: Use explicit parameters eval operation code

This replaces usage of generic PLACEHOLDEWR with string lookup with more
explicit opcode. This should make it faster to build dependency graph by
avoiding string comparisons when it's not needed.

There should be no user measurable different.
This commit is contained in:
Sergey Sharybin 2017-07-18 11:55:06 +02:00
parent 917bff4f44
commit 2fe5cf4807
2 changed files with 24 additions and 19 deletions

View File

@ -603,9 +603,10 @@ void DepsgraphNodeBuilder::build_world(World *world)
/* world itself */
add_component_node(world_id, DEG_NODE_TYPE_PARAMETERS);
add_operation_node(world_id, DEG_NODE_TYPE_PARAMETERS, NULL,
DEG_OPCODE_PLACEHOLDER, "Parameters Eval");
add_operation_node(world_id,
DEG_NODE_TYPE_PARAMETERS,
NULL,
DEG_OPCODE_PARAMETERS_EVAL);
/* textures */
build_texture_stack(world->mtex);
@ -776,8 +777,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
op_node = add_operation_node(&ob->id,
DEG_NODE_TYPE_PARAMETERS,
NULL,
DEG_OPCODE_PLACEHOLDER,
"Parameters Eval");
DEG_OPCODE_PARAMETERS_EVAL);
op_node->set_as_exit();
/* Temporary uber-update node, which does everything.
@ -949,8 +949,10 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
op_node->set_as_exit();
/* Parameters for driver sources. */
add_operation_node(obdata, DEG_NODE_TYPE_PARAMETERS, NULL,
DEG_OPCODE_PLACEHOLDER, "Parameters Eval");
add_operation_node(obdata,
DEG_NODE_TYPE_PARAMETERS,
NULL,
DEG_OPCODE_PARAMETERS_EVAL);
}
/* Cameras */
@ -965,8 +967,10 @@ void DepsgraphNodeBuilder::build_camera(Object *ob)
build_animdata(&cam->id);
add_operation_node(camera_id, DEG_NODE_TYPE_PARAMETERS, NULL,
DEG_OPCODE_PLACEHOLDER, "Parameters Eval");
add_operation_node(camera_id,
DEG_NODE_TYPE_PARAMETERS,
NULL,
DEG_OPCODE_PARAMETERS_EVAL);
if (cam->dof_ob != NULL) {
/* TODO(sergey): For now parametrs are on object level. */
@ -990,8 +994,10 @@ void DepsgraphNodeBuilder::build_lamp(Object *ob)
add_component_node(lamp_id, DEG_NODE_TYPE_PARAMETERS);
/* TODO(sergey): Is it really how we're supposed to work with drivers? */
add_operation_node(lamp_id, DEG_NODE_TYPE_PARAMETERS, NULL,
DEG_OPCODE_PLACEHOLDER, "Parameters Eval");
add_operation_node(lamp_id,
DEG_NODE_TYPE_PARAMETERS,
NULL,
DEG_OPCODE_PARAMETERS_EVAL);
/* lamp's nodetree */
if (la->nodetree) {
@ -1014,8 +1020,10 @@ void DepsgraphNodeBuilder::build_nodetree(bNodeTree *ntree)
build_animdata(ntree_id);
/* Parameters for drivers. */
op_node = add_operation_node(ntree_id, DEG_NODE_TYPE_PARAMETERS, NULL,
DEG_OPCODE_PLACEHOLDER, "Parameters Eval");
op_node = add_operation_node(ntree_id,
DEG_NODE_TYPE_PARAMETERS,
NULL,
DEG_OPCODE_PARAMETERS_EVAL);
op_node->set_as_exit();
/* nodetree's nodes... */

View File

@ -1639,8 +1639,7 @@ void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree)
OperationKey parameters_key(ntree_id,
DEG_NODE_TYPE_PARAMETERS,
DEG_OPCODE_PLACEHOLDER,
"Parameters Eval");
DEG_OPCODE_PARAMETERS_EVAL);
/* nodetree's nodes... */
LINKLIST_FOREACH (bNode *, bnode, &ntree->nodes) {
@ -1659,8 +1658,7 @@ void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree)
}
OperationKey group_parameters_key(&group_ntree->id,
DEG_NODE_TYPE_PARAMETERS,
DEG_OPCODE_PLACEHOLDER,
"Parameters Eval");
DEG_OPCODE_PARAMETERS_EVAL);
add_relation(group_parameters_key, parameters_key, "Group Node");
}
}
@ -1692,8 +1690,7 @@ void DepsgraphRelationBuilder::build_material(Material *ma)
build_nodetree(ma->nodetree);
OperationKey ntree_key(&ma->nodetree->id,
DEG_NODE_TYPE_PARAMETERS,
DEG_OPCODE_PLACEHOLDER,
"Parameters Eval");
DEG_OPCODE_PARAMETERS_EVAL);
OperationKey material_key(&ma->id,
DEG_NODE_TYPE_SHADING,
DEG_OPCODE_PLACEHOLDER,