Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-09-08 18:21:48 +0300
committerJacques Lucke <jacques@blender.org>2022-09-08 18:21:48 +0300
commit011a1f3335ceb58e798ac306f860f10c223cc9da (patch)
treed3bce3ab022fb14e8248d8b700057d8e95a3ad3b
parent9007489c515269c6ef90b3ebf853fb2e2e0d36a5 (diff)
-rw-r--r--source/blender/nodes/NOD_geometry_nodes_log.hh1
-rw-r--r--source/blender/nodes/intern/geometry_nodes_log.cc58
2 files changed, 32 insertions, 27 deletions
diff --git a/source/blender/nodes/NOD_geometry_nodes_log.hh b/source/blender/nodes/NOD_geometry_nodes_log.hh
index 297702bd0b2..e239654fc33 100644
--- a/source/blender/nodes/NOD_geometry_nodes_log.hh
+++ b/source/blender/nodes/NOD_geometry_nodes_log.hh
@@ -156,6 +156,7 @@ class GeoTreeLog {
private:
GeoModifierLog *modifier_log_;
Vector<GeoTreeLogger *> tree_loggers_;
+ VectorSet<ComputeContextHash> children_hashes_;
bool reduced_node_warnings_ = false;
bool reduced_node_run_times_ = false;
bool reduced_socket_values_ = false;
diff --git a/source/blender/nodes/intern/geometry_nodes_log.cc b/source/blender/nodes/intern/geometry_nodes_log.cc
index db1f5311534..715ea1291ab 100644
--- a/source/blender/nodes/intern/geometry_nodes_log.cc
+++ b/source/blender/nodes/intern/geometry_nodes_log.cc
@@ -124,6 +124,11 @@ GeoNodeLog::~GeoNodeLog() = default;
GeoTreeLog::GeoTreeLog(GeoModifierLog *modifier_log, Vector<GeoTreeLogger *> tree_loggers)
: modifier_log_(modifier_log), tree_loggers_(std::move(tree_loggers))
{
+ for (GeoTreeLogger *tree_logger : tree_loggers_) {
+ for (const ComputeContextHash &hash : tree_logger->children_hashes) {
+ children_hashes_.add(hash);
+ }
+ }
}
GeoTreeLog::~GeoTreeLog() = default;
@@ -195,17 +200,16 @@ void GeoTreeLog::ensure_node_warnings()
this->nodes.lookup_or_add_default(warnings.first).warnings.append(warnings.second);
this->all_warnings.append(warnings.second);
}
- for (const ComputeContextHash &child_hash : tree_logger->children_hashes) {
- GeoTreeLog &child_log = modifier_log_->get_tree_log(child_hash);
- child_log.ensure_node_warnings();
- const std::optional<std::string> &group_node_name =
- child_log.tree_loggers_[0]->group_node_name;
- if (group_node_name.has_value()) {
- this->nodes.lookup_or_add_default(*group_node_name)
- .warnings.extend(child_log.all_warnings);
- }
- this->all_warnings.extend(child_log.all_warnings);
+ }
+ for (const ComputeContextHash &child_hash : children_hashes_) {
+ GeoTreeLog &child_log = modifier_log_->get_tree_log(child_hash);
+ child_log.ensure_node_warnings();
+ const std::optional<std::string> &group_node_name =
+ child_log.tree_loggers_[0]->group_node_name;
+ if (group_node_name.has_value()) {
+ this->nodes.lookup_or_add_default(*group_node_name).warnings.extend(child_log.all_warnings);
}
+ this->all_warnings.extend(child_log.all_warnings);
}
reduced_node_warnings_ = true;
}
@@ -223,16 +227,16 @@ void GeoTreeLog::ensure_node_run_time()
this->nodes.lookup_or_add_default_as(node_name).run_time += duration;
this->run_time_sum += duration;
}
- for (const ComputeContextHash &child_hash : tree_logger->children_hashes) {
- GeoTreeLog &child_log = modifier_log_->get_tree_log(child_hash);
- child_log.ensure_node_run_time();
- const std::optional<std::string> &group_node_name =
- child_log.tree_loggers_[0]->group_node_name;
- if (group_node_name.has_value()) {
- this->nodes.lookup_or_add_default(*group_node_name).run_time += child_log.run_time_sum;
- }
- this->run_time_sum += child_log.run_time_sum;
+ }
+ for (const ComputeContextHash &child_hash : children_hashes_) {
+ GeoTreeLog &child_log = modifier_log_->get_tree_log(child_hash);
+ child_log.ensure_node_run_time();
+ const std::optional<std::string> &group_node_name =
+ child_log.tree_loggers_[0]->group_node_name;
+ if (group_node_name.has_value()) {
+ this->nodes.lookup_or_add_default(*group_node_name).run_time += child_log.run_time_sum;
}
+ this->run_time_sum += child_log.run_time_sum;
}
reduced_node_run_times_ = true;
}
@@ -322,14 +326,14 @@ void GeoTreeLog::ensure_used_named_attributes()
tree_logger->used_named_attributes_) {
add_attribute(std::get<0>(item), std::get<1>(item), std::get<2>(item));
}
- for (const ComputeContextHash &child_hash : tree_logger->children_hashes) {
- GeoTreeLog &child_log = modifier_log_->get_tree_log(child_hash);
- child_log.ensure_used_named_attributes();
- if (const std::optional<std::string> &group_node_name =
- child_log.tree_loggers_[0]->group_node_name) {
- for (const auto &item : child_log.used_named_attributes.items()) {
- add_attribute(*group_node_name, item.key, item.value);
- }
+ }
+ for (const ComputeContextHash &child_hash : children_hashes_) {
+ GeoTreeLog &child_log = modifier_log_->get_tree_log(child_hash);
+ child_log.ensure_used_named_attributes();
+ if (const std::optional<std::string> &group_node_name =
+ child_log.tree_loggers_[0]->group_node_name) {
+ for (const auto &item : child_log.used_named_attributes.items()) {
+ add_attribute(*group_node_name, item.key, item.value);
}
}
}