Blender  V2.93
deg_eval_stats.cc
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2017 Blender Foundation.
17  * All rights reserved.
18  */
19 
25 
26 #include "BLI_utildefines.h"
27 
28 #include "intern/depsgraph.h"
29 
30 #include "intern/node/deg_node.h"
34 
35 namespace blender::deg {
36 
38 {
39  /* Reset current evaluation stats for ID and component nodes.
40  * Those are not filled in by the evaluation engine. */
41  for (Node *node : graph->id_nodes) {
42  IDNode *id_node = (IDNode *)node;
43  for (ComponentNode *comp_node : id_node->components.values()) {
44  comp_node->stats.reset_current();
45  }
47  }
48  /* Now accumulate operation timings to components and IDs. */
49  for (OperationNode *op_node : graph->operations) {
50  ComponentNode *comp_node = op_node->owner;
51  IDNode *id_node = comp_node->owner;
53  comp_node->stats.current_time += op_node->stats.current_time;
54  }
55 }
56 
57 } // namespace blender::deg
OperationNode * node
Depsgraph * graph
const IDNode * id_node
void deg_eval_stats_aggregate(Depsgraph *graph)
OperationNodes operations
Definition: depsgraph.h:126
IDDepsNodes id_nodes
Definition: depsgraph.h:103
Map< ComponentIDKey, ComponentNode * > components
Definition: deg_node_id.h:96