From 566a458950ee30f60400a7624746342d19cf9695 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 10 Dec 2021 12:11:43 +1100 Subject: Cleanup: move public doc-strings into headers for 'depsgraph' - Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. Ref T92709 --- .../depsgraph/intern/builder/deg_builder_nodes.cc | 38 ++++++---------------- .../depsgraph/intern/builder/deg_builder_nodes.h | 21 ++++++++++++ .../intern/builder/deg_builder_pchanmap.cc | 3 -- .../intern/builder/deg_builder_pchanmap.h | 6 ++-- .../intern/builder/deg_builder_relations.cc | 6 ++-- .../builder/deg_builder_relations_drivers.cc | 1 - .../intern/builder/deg_builder_relations_drivers.h | 7 ++-- source/blender/depsgraph/intern/depsgraph.cc | 8 ----- source/blender/depsgraph/intern/depsgraph.h | 2 +- source/blender/depsgraph/intern/depsgraph_build.cc | 4 --- source/blender/depsgraph/intern/depsgraph_debug.cc | 6 ---- source/blender/depsgraph/intern/depsgraph_eval.cc | 2 -- source/blender/depsgraph/intern/depsgraph_query.cc | 1 - source/blender/depsgraph/intern/depsgraph_tag.cc | 5 --- source/blender/depsgraph/intern/depsgraph_type.cc | 2 -- .../blender/depsgraph/intern/depsgraph_update.cc | 1 - source/blender/depsgraph/intern/eval/deg_eval.cc | 7 ---- .../intern/eval/deg_eval_copy_on_write.cc | 10 ++++-- .../depsgraph/intern/eval/deg_eval_copy_on_write.h | 22 ++++++++----- .../depsgraph/intern/eval/deg_eval_flush.cc | 4 --- .../blender/depsgraph/intern/eval/deg_eval_flush.h | 8 +++-- source/blender/depsgraph/intern/node/deg_node.cc | 1 - source/blender/depsgraph/intern/node/deg_node.h | 1 + .../depsgraph/intern/node/deg_node_component.cc | 26 +++++++++++---- .../depsgraph/intern/node/deg_node_component.h | 2 ++ .../blender/depsgraph/intern/node/deg_node_id.cc | 1 - source/blender/depsgraph/intern/node/deg_node_id.h | 1 + .../depsgraph/intern/node/deg_node_operation.cc | 2 -- .../depsgraph/intern/node/deg_node_operation.h | 4 +++ 29 files changed, 98 insertions(+), 104 deletions(-) (limited to 'source/blender/depsgraph/intern') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 7da3ab78575..51582508b6f 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -390,8 +390,6 @@ void DepsgraphNodeBuilder::begin_build() * NOTE: This is split in two, a static function and a public method of the node builder, to allow * the code to access the builder's data more easily. */ -/* `id_cow_self` is the user of `id_pointer`, see also `LibraryIDLinkCallbackData` struct - * definition. */ int DepsgraphNodeBuilder::foreach_id_cow_detect_need_for_update_callback(ID *id_cow_self, ID *id_pointer) { @@ -440,21 +438,18 @@ static int foreach_id_cow_detect_need_for_update_callback(LibraryIDLinkCallbackD return builder->foreach_id_cow_detect_need_for_update_callback(id_cow_self, id); } -/* Check for IDs that need to be flushed (COW-updated) because the depsgraph itself created or - * removed some of their evaluated dependencies. - * - * NOTE: Currently the only ID types that depsgraph may decide to not evaluate/generate COW - * copies for, even though they are referenced by other data-blocks, are Collections and Objects - * (through their various visibility flags, and the ones from LayerCollections too). However, this - * code is kept generic as it makes it more future-proof, and optimization here would give - * negligible performance improvements in typical cases. - * - * NOTE: This mechanism may also 'fix' some missing update tagging from non-depsgraph code in - * some cases. This is slightly unfortunate (as it may hide issues in other parts of Blender - * code), but cannot really be avoided currently. - */ void DepsgraphNodeBuilder::update_invalid_cow_pointers() { + /* NOTE: Currently the only ID types that depsgraph may decide to not evaluate/generate COW + * copies for, even though they are referenced by other data-blocks, are Collections and Objects + * (through their various visibility flags, and the ones from #LayerCollections too). However, + * this code is kept generic as it makes it more future-proof, and optimization here would give + * negligible performance improvements in typical cases. + * + * NOTE: This mechanism may also 'fix' some missing update tagging from non-depsgraph code in + * some cases. This is slightly unfortunate (as it may hide issues in other parts of Blender + * code), but cannot really be avoided currently. */ + for (const IDNode *id_node : graph_->id_nodes) { if (id_node->previously_visible_components_mask == 0) { /* Newly added node/ID, no need to check it. */ @@ -1071,10 +1066,6 @@ void DepsgraphNodeBuilder::build_object_pointcache(Object *object) }); } -/** - * Build graph nodes for AnimData block and any animated images used. - * \param id: ID-Block which hosts the AnimData - */ void DepsgraphNodeBuilder::build_animdata(ID *id) { /* Special handling for animated images/sequences. */ @@ -1128,9 +1119,6 @@ void DepsgraphNodeBuilder::build_animdata_nlastrip_targets(ListBase *strips) } } -/** - * Build graph nodes to update the current frame in image users. - */ void DepsgraphNodeBuilder::build_animation_images(ID *id) { if (BKE_image_user_id_has_animation(id)) { @@ -1152,12 +1140,6 @@ void DepsgraphNodeBuilder::build_action(bAction *action) add_operation_node(&action->id, NodeType::ANIMATION, OperationCode::ANIMATION_EVAL); } -/** - * Build graph node(s) for Driver - * \param id: ID-Block that driver is attached to - * \param fcu: Driver-FCurve - * \param driver_index: Index in animation data drivers list - */ void DepsgraphNodeBuilder::build_driver(ID *id, FCurve *fcurve, int driver_index) { /* Create data node for this driver */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index d31290ecbff..c1c80042833 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -102,6 +102,10 @@ class DepsgraphNodeBuilder : public DepsgraphBuilder { virtual void begin_build(); virtual void end_build(); + /** + * `id_cow_self` is the user of `id_pointer`, + * see also `LibraryIDLinkCallbackData` struct definition. + */ int foreach_id_cow_detect_need_for_update_callback(ID *id_cow_self, ID *id_pointer); IDNode *add_id_node(ID *id); @@ -199,10 +203,23 @@ class DepsgraphNodeBuilder : public DepsgraphBuilder { virtual void build_rigidbody(Scene *scene); virtual void build_particle_systems(Object *object, bool is_object_visible); virtual void build_particle_settings(ParticleSettings *part); + /** + * Build graph nodes for #AnimData block and any animated images used. + * \param id: ID-Block which hosts the #AnimData + */ virtual void build_animdata(ID *id); virtual void build_animdata_nlastrip_targets(ListBase *strips); + /** + * Build graph nodes to update the current frame in image users. + */ virtual void build_animation_images(ID *id); virtual void build_action(bAction *action); + /** + * Build graph node(s) for Driver + * \param id: ID-Block that driver is attached to + * \param fcu: Driver-FCurve + * \param driver_index: Index in animation data drivers list + */ virtual void build_driver(ID *id, FCurve *fcurve, int driver_index); virtual void build_driver_variables(ID *id, FCurve *fcurve); virtual void build_driver_id_property(ID *id, const char *rna_path); @@ -280,6 +297,10 @@ class DepsgraphNodeBuilder : public DepsgraphBuilder { void *user_data); void tag_previously_tagged_nodes(); + /** + * Check for IDs that need to be flushed (COW-updated) + * because the depsgraph itself created or removed some of their evaluated dependencies. + */ void update_invalid_cow_pointers(); /* State which demotes currently built entities. */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.cc b/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.cc index 17c2925b7f4..79f358213d3 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.cc @@ -30,7 +30,6 @@ namespace blender::deg { -/* Debug contents of map */ void RootPChanMap::print_debug() { map_.foreach_item([](StringRefNull key, const Set &values) { @@ -42,13 +41,11 @@ void RootPChanMap::print_debug() }); } -/* Add a mapping. */ void RootPChanMap::add_bone(const char *bone, const char *root) { map_.lookup_or_add_default(bone).add(root); } -/* Check if there's a common root bone between two bones. */ bool RootPChanMap::has_common_root(const char *bone1, const char *bone2) const { const Set *bone1_roots = map_.lookup_ptr(bone1); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.h b/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.h index 0dd4062c353..42f9ec9cc6a 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_pchanmap.h @@ -29,13 +29,13 @@ namespace blender { namespace deg { struct RootPChanMap { - /* Debug contents of map. */ + /** Debug contents of map. */ void print_debug(); - /* Add a mapping. */ + /** Add a mapping. */ void add_bone(const char *bone, const char *root); - /* Check if there's a common root bone between two bones. */ + /** Check if there's a common root bone between two bones. */ bool has_common_root(const char *bone1, const char *bone2) const; protected: diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index a333f67839a..b195b2d9e11 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -2073,7 +2073,8 @@ void DepsgraphRelationBuilder::build_shapekeys(Key *key) * and also for the links coming from the shapekey data-blocks * - Animation/Drivers affecting the parameters of the geometry are made to * trigger updates on the obdata geometry component, which then trigger - * downstream re-evaluation of the individual instances of this geometry. */ + * downstream re-evaluation of the individual instances of this geometry. + */ void DepsgraphRelationBuilder::build_object_data_geometry(Object *object) { ID *obdata = (ID *)object->data; @@ -2868,7 +2869,8 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations() } } -/* Nested datablocks (node trees, shape keys) requires special relation to +/** + * Nested datablocks (node trees, shape keys) requires special relation to * ensure owner's datablock remapping happens after node tree itself is ready. * * This is similar to what happens in ntree_hack_remap_pointers(). diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc index bf3af571f0b..6e5c1f05cf3 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.cc @@ -83,7 +83,6 @@ bool DriverDescriptor::is_array() const return is_array_; } -/* Assumes that 'other' comes from the same RNA group, that is, has the same RNA path prefix. */ bool DriverDescriptor::is_same_array_as(const DriverDescriptor &other) const { if (!is_array_ || !other.is_array_) { diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.h b/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.h index c80c69be9e2..4ad5bdda1ef 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_drivers.h @@ -37,14 +37,17 @@ namespace deg { /* Helper class for determining which relations are needed between driver evaluation nodes. */ class DriverDescriptor { public: - /* Drivers are grouped by their RNA prefix. The prefix is the part of the RNA + /** + * Drivers are grouped by their RNA prefix. The prefix is the part of the RNA * path up to the last dot, the suffix is the remainder of the RNA path: * + * \code{.unparsed} * fcu->rna_path rna_prefix rna_suffix * ------------------------------- ---------------------- ---------- * 'color' '' 'color' * 'rigidbody_world.time_scale' 'rigidbody_world' 'time_scale' * 'pose.bones["master"].location' 'pose.bones["master"]' 'location' + * \endcode */ StringRef rna_prefix; StringRef rna_suffix; @@ -54,7 +57,7 @@ class DriverDescriptor { bool driver_relations_needed() const; bool is_array() const; - /* Assumes that 'other' comes from the same RNA group, that is, has the same RNA path prefix. */ + /** Assumes that 'other' comes from the same RNA group, that is, has the same RNA path prefix. */ bool is_same_array_as(const DriverDescriptor &other) const; OperationKey depsgraph_key() const; diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index 4c036417ba0..b348ab0f432 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -182,7 +182,6 @@ void Depsgraph::clear_id_nodes() clear_physics_relations(this); } -/* Add new relation between two nodes */ Relation *Depsgraph::add_new_relation(Node *from, Node *to, const char *description, int flags) { Relation *rel = nullptr; @@ -228,7 +227,6 @@ Relation *Depsgraph::check_nodes_connected(const Node *from, /* Low level tagging -------------------------------------- */ -/* Tag a specific node as needing updates. */ void Depsgraph::add_entry_tag(OperationNode *node) { /* Sanity check. */ @@ -280,7 +278,6 @@ ID *Depsgraph::get_cow_id(const ID *id_orig) const /* **************** */ /* Public Graph API */ -/* Initialize a new Depsgraph */ Depsgraph *DEG_graph_new(Main *bmain, Scene *scene, ViewLayer *view_layer, eEvaluationMode mode) { deg::Depsgraph *deg_depsgraph = new deg::Depsgraph(bmain, scene, view_layer, mode); @@ -288,10 +285,6 @@ Depsgraph *DEG_graph_new(Main *bmain, Scene *scene, ViewLayer *view_layer, eEval return reinterpret_cast(deg_depsgraph); } -/* Replace the "owner" pointers (currently Main/Scene/ViewLayer) of this depsgraph. - * Used for: - * - Undo steps when we do want to re-use the old depsgraph data as much as possible. - * - Rendering where we want to re-use objects between different view layers. */ void DEG_graph_replace_owners(struct Depsgraph *depsgraph, Main *bmain, Scene *scene, @@ -313,7 +306,6 @@ void DEG_graph_replace_owners(struct Depsgraph *depsgraph, } } -/* Free graph's contents and graph itself */ void DEG_graph_free(Depsgraph *graph) { if (graph == nullptr) { diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h index 913b61ca563..bfe6ed649f6 100644 --- a/source/blender/depsgraph/intern/depsgraph.h +++ b/source/blender/depsgraph/intern/depsgraph.h @@ -72,7 +72,7 @@ struct Depsgraph { IDNode *add_id_node(ID *id, ID *id_cow_hint = nullptr); void clear_id_nodes(); - /* Add new relationship between two nodes. */ + /** Add new relationship between two nodes. */ Relation *add_new_relation(Node *from, Node *to, const char *description, int flags = 0); /* Check whether two nodes are connected by relation with given diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc index 9e9191c5ab9..db00c595383 100644 --- a/source/blender/depsgraph/intern/depsgraph_build.cc +++ b/source/blender/depsgraph/intern/depsgraph_build.cc @@ -252,7 +252,6 @@ struct Depsgraph *DEG_get_graph_from_handle(struct DepsNodeHandle *node_handle) /* ******************** */ /* Graph Building API's */ -/* Build depsgraph for the given scene layer, and dump results in given graph container. */ void DEG_graph_build_from_view_layer(Depsgraph *graph) { deg::ViewLayerBuilderPipeline builder(graph); @@ -283,7 +282,6 @@ void DEG_graph_build_from_ids(Depsgraph *graph, ID **ids, const int num_ids) builder.build(); } -/* Tag graph relations for update. */ void DEG_graph_tag_relations_update(Depsgraph *graph) { DEG_DEBUG_PRINTF(graph, TAG, "%s: Tagging relations for update.\n", __func__); @@ -301,7 +299,6 @@ void DEG_graph_tag_relations_update(Depsgraph *graph) } } -/* Create or update relations in the specified graph. */ void DEG_graph_relations_update(Depsgraph *graph) { deg::Depsgraph *deg_graph = (deg::Depsgraph *)graph; @@ -312,7 +309,6 @@ void DEG_graph_relations_update(Depsgraph *graph) DEG_graph_build_from_view_layer(graph); } -/* Tag all relations for update. */ void DEG_relations_tag_update(Main *bmain) { DEG_GLOBAL_DEBUG_PRINTF(TAG, "%s: Tagging relations for update.\n", __func__); diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cc b/source/blender/depsgraph/intern/depsgraph_debug.cc index 3677f80469c..9e3cbdbec09 100644 --- a/source/blender/depsgraph/intern/depsgraph_debug.cc +++ b/source/blender/depsgraph/intern/depsgraph_debug.cc @@ -196,12 +196,6 @@ bool DEG_debug_consistency_check(Depsgraph *graph) /* ------------------------------------------------ */ -/** - * Obtain simple statistics about the complexity of the depsgraph. - * \param[out] r_outer: The number of outer nodes in the graph - * \param[out] r_operations: The number of operation nodes in the graph - * \param[out] r_relations: The number of relations between (executable) nodes in the graph - */ void DEG_stats_simple(const Depsgraph *graph, size_t *r_outer, size_t *r_operations, diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cc b/source/blender/depsgraph/intern/depsgraph_eval.cc index 0314219b725..7952f27507f 100644 --- a/source/blender/depsgraph/intern/depsgraph_eval.cc +++ b/source/blender/depsgraph/intern/depsgraph_eval.cc @@ -60,7 +60,6 @@ static void deg_flush_updates_and_refresh(deg::Depsgraph *deg_graph) deg::deg_evaluate_on_refresh(deg_graph); } -/* Evaluate all nodes tagged for updating. */ void DEG_evaluate_on_refresh(Depsgraph *graph) { deg::Depsgraph *deg_graph = reinterpret_cast(graph); @@ -77,7 +76,6 @@ void DEG_evaluate_on_refresh(Depsgraph *graph) deg_flush_updates_and_refresh(deg_graph); } -/* Frame-change happened for root scene that graph belongs to. */ void DEG_evaluate_on_framechange(Depsgraph *graph, float frame) { deg::Depsgraph *deg_graph = reinterpret_cast(graph); diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc index aab4c3ca0f6..6c1947728b5 100644 --- a/source/blender/depsgraph/intern/depsgraph_query.cc +++ b/source/blender/depsgraph/intern/depsgraph_query.cc @@ -200,7 +200,6 @@ ID *DEG_get_evaluated_id(const Depsgraph *depsgraph, ID *id) return id_node->id_cow; } -/* Get evaluated version of data pointed to by RNA pointer */ void DEG_get_evaluated_rna_pointer(const Depsgraph *depsgraph, PointerRNA *ptr, PointerRNA *r_ptr_eval) diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 60c64e19bde..2b0d0e6e780 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -755,7 +755,6 @@ const char *DEG_update_tag_as_string(IDRecalcFlag flag) /* Data-Based Tagging. */ -/* Tag given ID for an update in all the dependency graphs. */ void DEG_id_tag_update(ID *id, int flag) { DEG_id_tag_update_ex(G.main, id, flag); @@ -792,7 +791,6 @@ void DEG_graph_time_tag_update(struct Depsgraph *depsgraph) deg_graph->tag_time_source(); } -/* Mark a particular data-block type as having changing. */ void DEG_graph_id_type_tag(Depsgraph *depsgraph, short id_type) { if (id_type == ID_NT) { @@ -817,7 +815,6 @@ void DEG_id_type_tag(Main *bmain, short id_type) } } -/* Update dependency graph when visible scenes/layers changes. */ void DEG_graph_tag_on_visible_update(Depsgraph *depsgraph, const bool do_time) { deg::Depsgraph *graph = (deg::Depsgraph *)depsgraph; @@ -837,8 +834,6 @@ void DEG_enable_editors_update(Depsgraph *depsgraph) graph->use_editors_update = true; } -/* Check if something was changed in the database and inform - * editors about this. */ void DEG_editors_update(Depsgraph *depsgraph, bool time) { deg::Depsgraph *graph = (deg::Depsgraph *)depsgraph; diff --git a/source/blender/depsgraph/intern/depsgraph_type.cc b/source/blender/depsgraph/intern/depsgraph_type.cc index 43a21692f2a..0405a7d90b4 100644 --- a/source/blender/depsgraph/intern/depsgraph_type.cc +++ b/source/blender/depsgraph/intern/depsgraph_type.cc @@ -39,7 +39,6 @@ namespace deg = blender::deg; -/* Register all node types */ void DEG_register_node_types() { /* register node types */ @@ -48,7 +47,6 @@ void DEG_register_node_types() deg::deg_register_operation_depsnodes(); } -/* Free registry on exit */ void DEG_free_node_types() { } diff --git a/source/blender/depsgraph/intern/depsgraph_update.cc b/source/blender/depsgraph/intern/depsgraph_update.cc index bb72320ca67..ec287edbd12 100644 --- a/source/blender/depsgraph/intern/depsgraph_update.cc +++ b/source/blender/depsgraph/intern/depsgraph_update.cc @@ -50,7 +50,6 @@ void deg_editors_scene_update(const DEGEditorUpdateContext *update_ctx, bool upd } // namespace blender::deg -/* Set callbacks which are being called when depsgraph changes. */ void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, DEG_EditorUpdateSceneCb scene_func) { deg::deg_editor_update_id_cb = id_func; diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc index d6877adb66b..30aeeee5b2c 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval.cc @@ -361,13 +361,6 @@ static TaskPool *deg_evaluate_task_pool_create(DepsgraphEvalState *state) return BLI_task_pool_create_suspended(state, TASK_PRIORITY_HIGH); } -/** - * Evaluate all nodes tagged for updating, - * \warning This is usually done as part of main loop, but may also be - * called from frame-change update. - * - * \note Time sources should be all valid! - */ void deg_evaluate_on_refresh(Depsgraph *graph) { /* Nothing to update, early out. */ diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index 68a72638c7d..116dba054fa 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -906,7 +906,9 @@ ID *deg_update_copy_on_write_datablock(const Depsgraph *depsgraph, const IDNode return id_cow; } -/* NOTE: Depsgraph is supposed to have ID node already. */ +/** + * \note Depsgraph is supposed to have ID node already. + */ ID *deg_update_copy_on_write_datablock(const Depsgraph *depsgraph, ID *id_orig) { IDNode *id_node = depsgraph->find_id_node(id_orig); @@ -987,10 +989,12 @@ void discard_edit_mode_pointers(ID *id_cow) } // namespace -/* Free content of the CoW data-block +/** + Free content of the CoW data-block. * Notes: * - Does not recurse into nested ID data-blocks. - * - Does not free data-block itself. */ + * - Does not free data-block itself. + */ void deg_free_copy_on_write_datablock(ID *id_cow) { if (!check_datablock_expanded(id_cow)) { diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h index 70e510b5ef9..bc023766a46 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.h @@ -50,34 +50,40 @@ struct Depsgraph; class DepsgraphNodeBuilder; struct IDNode; -/* Makes sure given CoW data-block is brought back to state of the original +/** + * Makes sure given CoW data-block is brought back to state of the original * data-block. */ ID *deg_update_copy_on_write_datablock(const struct Depsgraph *depsgraph, const IDNode *id_node); ID *deg_update_copy_on_write_datablock(const struct Depsgraph *depsgraph, struct ID *id_orig); -/* Helper function which frees memory used by copy-on-written data-block. */ +/** Helper function which frees memory used by copy-on-written data-block. */ void deg_free_copy_on_write_datablock(struct ID *id_cow); -/* Callback function for depsgraph operation node which ensures copy-on-write +/** + * Callback function for depsgraph operation node which ensures copy-on-write * data-block is ready for use by further evaluation routines. */ void deg_evaluate_copy_on_write(struct ::Depsgraph *depsgraph, const struct IDNode *id_node); -/* Check that given ID is properly expanded and does not have any shallow - * copies inside. */ +/** + * Check that given ID is properly expanded and does not have any shallow + * copies inside. + */ bool deg_validate_copy_on_write_datablock(ID *id_cow); -/* Tag given ID block as being copy-on-written. */ +/** Tag given ID block as being copy-on-written. */ void deg_tag_copy_on_write_id(struct ID *id_cow, const struct ID *id_orig); -/* Check whether ID data-block is expanded. +/** + * Check whether ID data-block is expanded. * * TODO(sergey): Make it an inline function or a macro. */ bool deg_copy_on_write_is_expanded(const struct ID *id_cow); -/* Check whether copy-on-write data-block is needed for given ID. +/** + * Check whether copy-on-write data-block is needed for given ID. * * There are some exceptions on data-blocks which are covered by dependency graph * but which we don't want to start duplicating. diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc index a015491e2d7..7ec77689ba5 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -346,9 +346,6 @@ void invalidate_tagged_evaluated_data(Depsgraph *graph) } // namespace -/* Flush updates from tagged nodes outwards until all affected nodes - * are tagged. - */ void deg_graph_flush_updates(Depsgraph *graph) { /* Sanity checks. */ @@ -395,7 +392,6 @@ void deg_graph_flush_updates(Depsgraph *graph) invalidate_tagged_evaluated_data(graph); } -/* Clear tags from all operation nodes. */ void deg_graph_clear_tags(Depsgraph *graph) { /* Go over all operation nodes, clearing tags. */ diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.h b/source/blender/depsgraph/intern/eval/deg_eval_flush.h index ec661360fdf..d70df62cb38 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.h +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.h @@ -30,12 +30,14 @@ namespace deg { struct Depsgraph; -/* Flush updates from tagged nodes outwards until all affected nodes - * are tagged. +/** + * Flush updates from tagged nodes outwards until all affected nodes are tagged. */ void deg_graph_flush_updates(struct Depsgraph *graph); -/* Clear tags from all operation nodes. */ +/** + * Clear tags from all operation nodes. + */ void deg_graph_clear_tags(struct Depsgraph *graph); } // namespace deg diff --git a/source/blender/depsgraph/intern/node/deg_node.cc b/source/blender/depsgraph/intern/node/deg_node.cc index 22345a85576..8bc03d8b736 100644 --- a/source/blender/depsgraph/intern/node/deg_node.cc +++ b/source/blender/depsgraph/intern/node/deg_node.cc @@ -311,7 +311,6 @@ Node::~Node() } } -/* Generic identifier for Depsgraph Nodes. */ string Node::identifier() const { return string(nodeTypeAsString(type)) + " : " + name; diff --git a/source/blender/depsgraph/intern/node/deg_node.h b/source/blender/depsgraph/intern/node/deg_node.h index a5c58d163a7..7e093ab8765 100644 --- a/source/blender/depsgraph/intern/node/deg_node.h +++ b/source/blender/depsgraph/intern/node/deg_node.h @@ -201,6 +201,7 @@ struct Node { Node(); virtual ~Node(); + /** Generic identifier for Depsgraph Nodes. */ virtual string identifier() const; virtual void init(const ID * /*id*/, const char * /*subdata*/) diff --git a/source/blender/depsgraph/intern/node/deg_node_component.cc b/source/blender/depsgraph/intern/node/deg_node_component.cc index 7d56ef44979..b716877902c 100644 --- a/source/blender/depsgraph/intern/node/deg_node_component.cc +++ b/source/blender/depsgraph/intern/node/deg_node_component.cc @@ -43,7 +43,9 @@ namespace blender::deg { /* *********** */ /* Outer Nodes */ -/* Standard Component Methods ============================= */ +/* -------------------------------------------------------------------- */ +/** \name Standard Component Methods + * \{ */ ComponentNode::OperationIDKey::OperationIDKey() : opcode(OperationCode::OPERATION), name(""), name_tag(-1) @@ -86,7 +88,6 @@ ComponentNode::ComponentNode() operations_map = new Map(); } -/* Initialize 'component' node - from pointer data given */ void ComponentNode::init(const ID * /*id*/, const char * /*subdata*/) { /* hook up eval context? */ @@ -297,9 +298,12 @@ void ComponentNode::finalize_build(Depsgraph * /*graph*/) operations_map = nullptr; } -/* Bone Component ========================================= */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Bone Component + * \{ */ -/* Initialize 'bone component' node - from pointer data given */ void BoneComponentNode::init(const ID *id, const char *subdata) { /* generic component-node... */ @@ -315,7 +319,11 @@ void BoneComponentNode::init(const ID *id, const char *subdata) this->pchan = BKE_pose_channel_find_name(object->pose, subdata); } -/* Register all components. =============================== */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Register All Components + * \{ */ DEG_COMPONENT_NODE_DEFINE(Animation, ANIMATION, ID_RECALC_ANIMATION); /* TODO(sergey): Is this a correct tag? */ @@ -344,7 +352,11 @@ DEG_COMPONENT_NODE_DEFINE(GenericDatablock, GENERIC_DATABLOCK, 0); DEG_COMPONENT_NODE_DEFINE(Visibility, VISIBILITY, 0); DEG_COMPONENT_NODE_DEFINE(Simulation, SIMULATION, 0); -/* Node Types Register =================================== */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Node Types Register + * \{ */ void deg_register_component_depsnodes() { @@ -375,4 +387,6 @@ void deg_register_component_depsnodes() register_node_typeinfo(&DNTI_SIMULATION); } +/** \} */ + } // namespace blender::deg diff --git a/source/blender/depsgraph/intern/node/deg_node_component.h b/source/blender/depsgraph/intern/node/deg_node_component.h index 4a1841d5d63..9f108af8012 100644 --- a/source/blender/depsgraph/intern/node/deg_node_component.h +++ b/source/blender/depsgraph/intern/node/deg_node_component.h @@ -67,6 +67,7 @@ struct ComponentNode : public Node { ComponentNode(); ~ComponentNode(); + /** Initialize 'component' node - from pointer data given. */ void init(const ID *id, const char *subdata) override; virtual string identifier() const override; @@ -224,6 +225,7 @@ DEG_COMPONENT_NODE_DECLARE_GENERIC(Simulation); /* Bone Component */ struct BoneComponentNode : public ComponentNode { + /** Initialize 'bone component' node - from pointer data given. */ void init(const ID *id, const char *subdata); struct bPoseChannel *pchan; /* the bone that this component represents */ diff --git a/source/blender/depsgraph/intern/node/deg_node_id.cc b/source/blender/depsgraph/intern/node/deg_node_id.cc index 2b1ebc663fe..baad8318de2 100644 --- a/source/blender/depsgraph/intern/node/deg_node_id.cc +++ b/source/blender/depsgraph/intern/node/deg_node_id.cc @@ -73,7 +73,6 @@ uint64_t IDNode::ComponentIDKey::hash() const BLI_ghashutil_strhash_p(name)); } -/* Initialize 'id' node - from pointer data given. */ void IDNode::init(const ID *id, const char *UNUSED(subdata)) { BLI_assert(id != nullptr); diff --git a/source/blender/depsgraph/intern/node/deg_node_id.h b/source/blender/depsgraph/intern/node/deg_node_id.h index 073469598dc..257e42b8e67 100644 --- a/source/blender/depsgraph/intern/node/deg_node_id.h +++ b/source/blender/depsgraph/intern/node/deg_node_id.h @@ -58,6 +58,7 @@ struct IDNode : public Node { const char *name; }; + /** Initialize 'id' node - from pointer data given. */ virtual void init(const ID *id, const char *subdata) override; void init_copy_on_write(ID *id_cow_hint = nullptr); ~IDNode(); diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.cc b/source/blender/depsgraph/intern/node/deg_node_operation.cc index c25dc6fc8d5..eaae5d2d5dc 100644 --- a/source/blender/depsgraph/intern/node/deg_node_operation.cc +++ b/source/blender/depsgraph/intern/node/deg_node_operation.cc @@ -218,8 +218,6 @@ string OperationNode::identifier() const return string(operationCodeAsString(opcode)) + "(" + name + ")"; } -/* Full node identifier, including owner name. - * used for logging and debug prints. */ string OperationNode::full_identifier() const { string owner_str = owner->owner->name; diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.h b/source/blender/depsgraph/intern/node/deg_node_operation.h index a17186da941..31cbb9702ba 100644 --- a/source/blender/depsgraph/intern/node/deg_node_operation.h +++ b/source/blender/depsgraph/intern/node/deg_node_operation.h @@ -233,6 +233,10 @@ struct OperationNode : public Node { OperationNode(); virtual string identifier() const override; + /** + * Full node identifier, including owner name. + * used for logging and debug prints. + */ string full_identifier() const; virtual void tag_update(Depsgraph *graph, eUpdateSource source) override; -- cgit v1.2.3