Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/depsgraph.cc
| Show All 32 Lines | |||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_console.h" | #include "BLI_console.h" | ||||
| #include "BLI_hash.h" | #include "BLI_hash.h" | ||||
| #include "BLI_ghash.h" | #include "BLI_ghash.h" | ||||
| extern "C" { | extern "C" { | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_idcode.h" | |||||
| } | } | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "DEG_depsgraph_debug.h" | #include "DEG_depsgraph_debug.h" | ||||
| #include "intern/depsgraph_update.h" | #include "intern/depsgraph_update.h" | ||||
| #include "intern/eval/deg_eval_copy_on_write.h" | #include "intern/eval/deg_eval_copy_on_write.h" | ||||
| Show All 27 Lines | : time_source(NULL), | ||||
| debug_is_evaluating(false), | debug_is_evaluating(false), | ||||
| is_render_pipeline_depsgraph(false) | is_render_pipeline_depsgraph(false) | ||||
| { | { | ||||
| BLI_spin_init(&lock); | BLI_spin_init(&lock); | ||||
| id_hash = BLI_ghash_ptr_new("Depsgraph id hash"); | id_hash = BLI_ghash_ptr_new("Depsgraph id hash"); | ||||
| entry_tags = BLI_gset_ptr_new("Depsgraph entry_tags"); | entry_tags = BLI_gset_ptr_new("Depsgraph entry_tags"); | ||||
| debug_flags = G.debug; | debug_flags = G.debug; | ||||
| memset(id_type_updated, 0, sizeof(id_type_updated)); | memset(id_type_updated, 0, sizeof(id_type_updated)); | ||||
| memset(id_type_exist, 0, sizeof(id_type_exist)); | |||||
| memset(physics_relations, 0, sizeof(physics_relations)); | memset(physics_relations, 0, sizeof(physics_relations)); | ||||
| } | } | ||||
| Depsgraph::~Depsgraph() | Depsgraph::~Depsgraph() | ||||
| { | { | ||||
| clear_id_nodes(); | clear_id_nodes(); | ||||
| BLI_ghash_free(id_hash, NULL, NULL); | BLI_ghash_free(id_hash, NULL, NULL); | ||||
| BLI_gset_free(entry_tags, NULL); | BLI_gset_free(entry_tags, NULL); | ||||
| Show All 33 Lines | if (!id_node) { | ||||
| id_node = (IDNode *)factory->create_node(id, "", id->name); | id_node = (IDNode *)factory->create_node(id, "", id->name); | ||||
| id_node->init_copy_on_write(id_cow_hint); | id_node->init_copy_on_write(id_cow_hint); | ||||
| /* Register node in ID hash. | /* Register node in ID hash. | ||||
| * | * | ||||
| * NOTE: We address ID nodes by the original ID pointer they are | * NOTE: We address ID nodes by the original ID pointer they are | ||||
| * referencing to. */ | * referencing to. */ | ||||
| BLI_ghash_insert(id_hash, id, id_node); | BLI_ghash_insert(id_hash, id, id_node); | ||||
| id_nodes.push_back(id_node); | id_nodes.push_back(id_node); | ||||
| id_type_exist[BKE_idcode_to_index(GS(id->name))] = 1; | |||||
| } | } | ||||
| return id_node; | return id_node; | ||||
| } | } | ||||
| void Depsgraph::clear_id_nodes_conditional(const std::function<bool(ID_Type id_type)> &filter) | void Depsgraph::clear_id_nodes_conditional(const std::function<bool(ID_Type id_type)> &filter) | ||||
| { | { | ||||
| for (IDNode *id_node : id_nodes) { | for (IDNode *id_node : id_nodes) { | ||||
| if (id_node->id_cow == NULL) { | if (id_node->id_cow == NULL) { | ||||
| ▲ Show 20 Lines • Show All 209 Lines • Show Last 20 Lines | |||||