[Bf-blender-cvs] [feaeffa2bf5] profiler-editor: cleanup

Jacques Lucke noreply at git.blender.org
Thu Apr 29 11:30:48 CEST 2021


Commit: feaeffa2bf53cb12be11834ca2e043addde6c9c3
Author: Jacques Lucke
Date:   Tue Apr 27 15:55:54 2021 +0200
Branches: profiler-editor
https://developer.blender.org/rBfeaeffa2bf53cb12be11834ca2e043addde6c9c3

cleanup

===================================================================

M	source/blender/editors/space_profiler/profiler_layout.cc
M	source/blender/editors/space_profiler/profiler_layout.hh

===================================================================

diff --git a/source/blender/editors/space_profiler/profiler_layout.cc b/source/blender/editors/space_profiler/profiler_layout.cc
index dcc1ba9d3a7..6cb27e6b673 100644
--- a/source/blender/editors/space_profiler/profiler_layout.cc
+++ b/source/blender/editors/space_profiler/profiler_layout.cc
@@ -39,14 +39,14 @@ void ProfileNode::pack_added_children()
 
   /* Assume already packed children are sorted by begin time. */
   int tot_newly_inserted = 0;
-  tot_newly_inserted += this->try_pack_into_vector(children_on_same_thread_, true);
+  tot_newly_inserted += this->try_pack_into_vector(direct_children_, true);
 
   int iteration = 0;
   while (tot_newly_inserted < children_to_pack_.size()) {
-    if (iteration == packed_children_on_other_threads_.size()) {
-      packed_children_on_other_threads_.append({});
+    if (iteration == parallel_children_.size()) {
+      parallel_children_.append({});
     }
-    Vector<ProfileNode *> &children_vec = packed_children_on_other_threads_[iteration];
+    Vector<ProfileNode *> &children_vec = parallel_children_[iteration];
     iteration++;
     tot_newly_inserted += this->try_pack_into_vector(children_vec, false);
   }
@@ -192,10 +192,10 @@ void ProfileLayout::add(const RecordedProfile &recorded_profile)
 
 void ProfileNode::destruct_recursively()
 {
-  for (ProfileNode *node : children_on_same_thread_) {
+  for (ProfileNode *node : direct_children_) {
     node->destruct_recursively();
   }
-  for (Span<ProfileNode *> nodes : packed_children_on_other_threads_) {
+  for (Span<ProfileNode *> nodes : parallel_children_) {
     for (ProfileNode *node : nodes) {
       node->destruct_recursively();
     }
diff --git a/source/blender/editors/space_profiler/profiler_layout.hh b/source/blender/editors/space_profiler/profiler_layout.hh
index 4c780744f4b..fd23ec72c7a 100644
--- a/source/blender/editors/space_profiler/profiler_layout.hh
+++ b/source/blender/editors/space_profiler/profiler_layout.hh
@@ -37,9 +37,10 @@ class ProfileNode {
   uint64_t id_;
   uint64_t parent_id_;
   uint64_t thread_id_;
-  /* The nodes in these vectors are ordered by the begin time. */
-  Vector<ProfileNode *> children_on_same_thread_;
-  Vector<Vector<ProfileNode *>> packed_children_on_other_threads_;
+  /* The nodes in these vectors are ordered by the begin time. Nodes in a single vector should not
+   * overlap. */
+  Vector<ProfileNode *> direct_children_;
+  Vector<Vector<ProfileNode *>> parallel_children_;
 
   /* These nodes still have to be inserted into the vectors above. They are not sorted. */
   Vector<ProfileNode *> children_to_pack_;
@@ -79,12 +80,12 @@ class ProfileNode {
 
   Span<const ProfileNode *> children_on_same_thread() const
   {
-    return children_on_same_thread_;
+    return direct_children_;
   }
 
   Span<Vector<ProfileNode *>> stacked_children_in_other_threads() const
   {
-    return packed_children_on_other_threads_;
+    return parallel_children_;
   }
 
   static bool time_overlap(const ProfileNode &a, const ProfileNode &b);



More information about the Bf-blender-cvs mailing list