Nodes: Remove unnecessary node tree socket tagging

`SOCK_IN_USE` is now set in `update_socket_used_tags` in
`node_tree_update.cc` when a node tree is changed.
It doesn't need to run every single redraw. Removing this
results in a small speedup of 0.4 ms when drawing a tree
with about 4000 nodes (from about 70 ms total).

Differential Revision: https://developer.blender.org/D13645
This commit is contained in:
Hans Goudey 2021-12-22 11:25:55 -06:00
parent 6a71b2af66
commit e2a9e7e803
3 changed files with 0 additions and 22 deletions

View File

@ -827,7 +827,6 @@ void nodeClearActiveID(struct bNodeTree *ntree, short idtype);
struct bNode *nodeGetActiveTexture(struct bNodeTree *ntree);
int nodeSocketIsHidden(const struct bNodeSocket *sock);
void ntreeTagUsedSockets(struct bNodeTree *ntree);
void nodeSetSocketAvailability(struct bNodeTree *ntree,
struct bNodeSocket *sock,
bool is_available);

View File

@ -4304,26 +4304,6 @@ void ntreeUpdateNodeLevels(bNodeTree *ntree)
}
}
void ntreeTagUsedSockets(bNodeTree *ntree)
{
/* first clear data */
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) {
sock->flag &= ~SOCK_IN_USE;
}
LISTBASE_FOREACH (bNodeSocket *, sock, &node->outputs) {
sock->flag &= ~SOCK_IN_USE;
}
}
LISTBASE_FOREACH (bNodeLink *, link, &ntree->links) {
link->fromsock->flag |= SOCK_IN_USE;
if (!(link->flag & NODE_LINK_MUTED)) {
link->tosock->flag |= SOCK_IN_USE;
}
}
}
void ntreeUpdateAllNew(Main *main)
{
Vector<bNodeTree *> new_ntrees;

View File

@ -2380,7 +2380,6 @@ static void node_update_nodetree(const bContext &C,
{
/* Make sure socket "used" tags are correct, for displaying value buttons. */
SpaceNode *snode = CTX_wm_space_node(&C);
ntreeTagUsedSockets(&ntree);
count_multi_input_socket_links(ntree, *snode);