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:
authorErik <ecke101@gmail.com>2021-11-23 19:37:31 +0300
committerErik <ecke101@gmail.com>2021-11-23 19:37:31 +0300
commite4986f92f32b096aa85440f8f517e38fcdf15e07 (patch)
treebde68bc3eb6ab0f656676417e92be0c122ef313c /source/blender/nodes/intern/geometry_nodes_eval_log.cc
parentfab39440e94d94b0a6ea8ef7771312adbab98e66 (diff)
Geometry Nodes: Node execution time overlay
Adds a new overlay called "Timings" to the Geometry Node editor. This shows the node execution time in milliseconds above the node. For group nodes and frames, the total time for all nodes inside (recursively) is shown. Group output node shows the node tree total. The code is prepared for easily adding new rows of information to the box above the node in the future. Differential Revision: https://developer.blender.org/D13256
Diffstat (limited to 'source/blender/nodes/intern/geometry_nodes_eval_log.cc')
-rw-r--r--source/blender/nodes/intern/geometry_nodes_eval_log.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/nodes/intern/geometry_nodes_eval_log.cc b/source/blender/nodes/intern/geometry_nodes_eval_log.cc
index 782ab43336c..4cba9669647 100644
--- a/source/blender/nodes/intern/geometry_nodes_eval_log.cc
+++ b/source/blender/nodes/intern/geometry_nodes_eval_log.cc
@@ -25,6 +25,8 @@
#include "BLT_translation.h"
+#include <chrono>
+
namespace blender::nodes::geometry_nodes_eval_log {
using fn::CPPType;
@@ -64,6 +66,12 @@ ModifierLog::ModifierLog(GeoLogger &logger)
node_with_warning.node);
node_log.warnings_.append(node_with_warning.warning);
}
+
+ for (NodeWithExecutionTime &node_with_exec_time : local_logger.node_exec_times_) {
+ NodeLog &node_log = this->lookup_or_add_node_log(log_by_tree_context,
+ node_with_exec_time.node);
+ node_log.exec_time_ = node_with_exec_time.exec_time;
+ }
}
}
@@ -471,4 +479,9 @@ void LocalGeoLogger::log_node_warning(DNode node, NodeWarningType type, std::str
node_warnings_.append({node, {type, std::move(message)}});
}
+void LocalGeoLogger::log_execution_time(DNode node, std::chrono::microseconds exec_time)
+{
+ node_exec_times_.append({node, exec_time});
+}
+
} // namespace blender::nodes::geometry_nodes_eval_log