Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
| Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| IDNode *DepsgraphNodeBuilder::add_id_node(ID *id) | IDNode *DepsgraphNodeBuilder::add_id_node(ID *id) | ||||
| { | { | ||||
| IDNode *id_node = NULL; | IDNode *id_node = NULL; | ||||
| ID *id_cow = NULL; | ID *id_cow = NULL; | ||||
| IDComponentsMask previously_visible_components_mask = 0; | IDComponentsMask previously_visible_components_mask = 0; | ||||
| uint32_t previous_eval_flags = 0; | uint32_t previous_eval_flags = 0; | ||||
| uint64_t previous_customdata_mask = 0; | uint64_t previous_customdata_vmask = 0; | ||||
| uint64_t previous_customdata_emask = 0; | |||||
| uint64_t previous_customdata_fmask = 0; | |||||
| uint64_t previous_customdata_lmask = 0; | |||||
| uint64_t previous_customdata_pmask = 0; | |||||
| IDInfo *id_info = (IDInfo *)BLI_ghash_lookup(id_info_hash_, id); | IDInfo *id_info = (IDInfo *)BLI_ghash_lookup(id_info_hash_, id); | ||||
sergey: Why all this complexity? In the entire file of this change? | |||||
| if (id_info != NULL) { | if (id_info != NULL) { | ||||
| id_cow = id_info->id_cow; | id_cow = id_info->id_cow; | ||||
| previously_visible_components_mask = | previously_visible_components_mask = | ||||
| id_info->previously_visible_components_mask; | id_info->previously_visible_components_mask; | ||||
| previous_eval_flags = id_info->previous_eval_flags; | previous_eval_flags = id_info->previous_eval_flags; | ||||
| previous_customdata_mask = id_info->previous_customdata_mask; | previous_customdata_vmask = id_info->previous_customdata_vmask; | ||||
| previous_customdata_emask = id_info->previous_customdata_emask; | |||||
| previous_customdata_fmask = id_info->previous_customdata_fmask; | |||||
| previous_customdata_lmask = id_info->previous_customdata_lmask; | |||||
| previous_customdata_pmask = id_info->previous_customdata_pmask; | |||||
| /* Tag ID info to not free the CoW ID pointer. */ | /* Tag ID info to not free the CoW ID pointer. */ | ||||
| id_info->id_cow = NULL; | id_info->id_cow = NULL; | ||||
| } | } | ||||
| id_node = graph_->add_id_node(id, id_cow); | id_node = graph_->add_id_node(id, id_cow); | ||||
| id_node->previously_visible_components_mask = | id_node->previously_visible_components_mask = | ||||
| previously_visible_components_mask; | previously_visible_components_mask; | ||||
| id_node->previous_eval_flags = previous_eval_flags; | id_node->previous_eval_flags = previous_eval_flags; | ||||
| id_node->previous_customdata_mask = previous_customdata_mask; | id_node->previous_customdata_vmask = previous_customdata_vmask; | ||||
| id_node->previous_customdata_emask = previous_customdata_emask; | |||||
| id_node->previous_customdata_fmask = previous_customdata_fmask; | |||||
| id_node->previous_customdata_lmask = previous_customdata_lmask; | |||||
| id_node->previous_customdata_pmask = previous_customdata_pmask; | |||||
| /* Currently all ID nodes are supposed to have copy-on-write logic. | /* Currently all ID nodes are supposed to have copy-on-write logic. | ||||
| * | * | ||||
| * NOTE: Zero number of components indicates that ID node was just created. */ | * NOTE: Zero number of components indicates that ID node was just created. */ | ||||
| if (BLI_ghash_len(id_node->components) == 0) { | if (BLI_ghash_len(id_node->components) == 0) { | ||||
| ComponentNode *comp_cow = | ComponentNode *comp_cow = | ||||
| id_node->add_component(NodeType::COPY_ON_WRITE); | id_node->add_component(NodeType::COPY_ON_WRITE); | ||||
| OperationNode *op_cow = comp_cow->add_operation( | OperationNode *op_cow = comp_cow->add_operation( | ||||
| function_bind(deg_evaluate_copy_on_write, _1, id_node), | function_bind(deg_evaluate_copy_on_write, _1, id_node), | ||||
| ▲ Show 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | if (deg_copy_on_write_is_expanded(id_node->id_cow) && | ||||
| id_info->id_cow = id_node->id_cow; | id_info->id_cow = id_node->id_cow; | ||||
| } | } | ||||
| else { | else { | ||||
| id_info->id_cow = NULL; | id_info->id_cow = NULL; | ||||
| } | } | ||||
| id_info->previously_visible_components_mask = | id_info->previously_visible_components_mask = | ||||
| id_node->visible_components_mask; | id_node->visible_components_mask; | ||||
| id_info->previous_eval_flags = id_node->eval_flags; | id_info->previous_eval_flags = id_node->eval_flags; | ||||
| id_info->previous_customdata_mask = id_node->customdata_mask; | id_info->previous_customdata_vmask = id_node->customdata_vmask; | ||||
| id_info->previous_customdata_emask = id_node->customdata_emask; | |||||
| id_info->previous_customdata_fmask = id_node->customdata_fmask; | |||||
| id_info->previous_customdata_lmask = id_node->customdata_lmask; | |||||
| id_info->previous_customdata_pmask = id_node->customdata_pmask; | |||||
| BLI_ghash_insert(id_info_hash_, id_node->id_orig, id_info); | BLI_ghash_insert(id_info_hash_, id_node->id_orig, id_info); | ||||
| id_node->id_cow = NULL; | id_node->id_cow = NULL; | ||||
| } | } | ||||
| GSET_FOREACH_BEGIN(OperationNode *, op_node, graph_->entry_tags) | GSET_FOREACH_BEGIN(OperationNode *, op_node, graph_->entry_tags) | ||||
| { | { | ||||
| ComponentNode *comp_node = op_node->owner; | ComponentNode *comp_node = op_node->owner; | ||||
| IDNode *id_node = comp_node->owner; | IDNode *id_node = comp_node->owner; | ||||
| ▲ Show 20 Lines • Show All 1,367 Lines • Show Last 20 Lines | |||||
Why all this complexity? In the entire file of this change?