Nodes: minor speedup for usage inferencing
This reduces some overhead for group input nodes where many sockets are not used. This helps a bit with resolving the performance regression in #146949. Pull Request: https://projects.blender.org/blender/blender/pulls/147610
This commit is contained in:
@@ -105,8 +105,12 @@ class SocketUsageInferencerImpl {
|
||||
bool is_group_input_used(const int input_i)
|
||||
{
|
||||
for (const bNode *node : root_tree_.group_input_nodes()) {
|
||||
const SocketInContext socket{nullptr, &node->output_socket(input_i)};
|
||||
if (this->is_socket_used(socket)) {
|
||||
const bNodeSocket &socket = node->output_socket(input_i);
|
||||
if (!socket.is_directly_linked()) {
|
||||
continue;
|
||||
}
|
||||
const SocketInContext socket_ctx{nullptr, &socket};
|
||||
if (this->is_socket_used(socket_ctx)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user