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
This commit is contained in:
2021-11-23 17:37:31 +01:00
parent fab39440e9
commit e4986f92f3
9 changed files with 289 additions and 2 deletions

View File

@@ -337,8 +337,9 @@ static void node_draw_frame_prepare(const bContext *UNUSED(C), bNodeTree *ntree,
node->totr = rect;
}
static void node_draw_frame_label(bNodeTree *ntree, bNode *node, const float aspect)
static void node_draw_frame_label(bNodeTree *ntree, bNode *node, SpaceNode *snode)
{
const float aspect = snode->runtime->aspect;
/* XXX font id is crap design */
const int fontid = UI_style_get()->widgetlabel.uifont_id;
NodeFrame *data = (NodeFrame *)node->storage;
@@ -468,7 +469,9 @@ static void node_draw_frame(const bContext *C,
}
/* label and text */
node_draw_frame_label(ntree, node, snode->runtime->aspect);
node_draw_frame_label(ntree, node, snode);
node_draw_extra_info_panel(snode, node);
UI_block_end(C, node->block);
UI_block_draw(C, node->block);