Blender
V4.3
source
blender
compositor
realtime_compositor
COM_profiler.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2024 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
5
#pragma once
6
7
#include "
BLI_map.hh
"
8
#include "
BLI_timeit.hh
"
9
10
#include "
DNA_node_types.h
"
11
12
#include "
NOD_derived_node_tree.hh
"
13
14
namespace
blender::realtime_compositor
{
15
16
class
Context;
17
18
/* -------------------------------------------------------------------------------------------------
19
* Profiler
20
*
21
* A class that profiles the evaluation of the compositor and tracks information like the
22
* evaluation time of every node. */
23
class
Profiler
{
24
private
:
25
/* Stores the evaluation time of each node instance keyed by its instance key. Note that
26
* pixel-wise nodes like Math nodes will not be measured, that's because they are compiled
27
* together with other pixel-wise operations in a single operation, so we can't measure the
28
* evaluation time of each individual node. */
29
Map<bNodeInstanceKey, timeit::Nanoseconds>
nodes_evaluation_times_;
30
31
public
:
32
/* Returns a reference to the nodes evaluation times. */
33
Map<bNodeInstanceKey, timeit::Nanoseconds>
&
get_nodes_evaluation_times
();
34
35
/* Set the evaluation time of the node identified by the given node instance key. */
36
void
set_node_evaluation_time
(
bNodeInstanceKey
node_instance_key,
timeit::Nanoseconds
time);
37
38
/* Finalize profiling by computing node group times. This should be called after evaluation. */
39
void
finalize
(
const
bNodeTree
&
node_tree
);
40
41
private
:
42
/* Computes the evaluation time of every group node inside the given tree recursively by
43
* accumulating the evaluation time of its nodes, setting the computed time to the group nodes.
44
* The time is returned since the method is called recursively. */
45
timeit::Nanoseconds
accumulate_node_group_times(
const
bNodeTree
&
node_tree
,
46
bNodeInstanceKey
instance_key);
47
};
48
49
}
// namespace blender::realtime_compositor
BLI_map.hh
BLI_timeit.hh
DNA_node_types.h
NOD_derived_node_tree.hh
blender::Map
Definition
BLI_map.hh:129
blender::realtime_compositor::Profiler
Definition
COM_profiler.hh:23
blender::realtime_compositor::Profiler::finalize
void finalize(const bNodeTree &node_tree)
Definition
profiler.cc:66
blender::realtime_compositor::Profiler::set_node_evaluation_time
void set_node_evaluation_time(bNodeInstanceKey node_instance_key, timeit::Nanoseconds time)
Definition
profiler.cc:23
blender::realtime_compositor::Profiler::get_nodes_evaluation_times
Map< bNodeInstanceKey, timeit::Nanoseconds > & get_nodes_evaluation_times()
Definition
profiler.cc:18
node_tree
node_tree
Definition
eevee_material_info.hh:383
blender::realtime_compositor
Definition
BKE_node.hh:80
blender::timeit::Nanoseconds
std::chrono::nanoseconds Nanoseconds
Definition
BLI_timeit.hh:16
bNodeInstanceKey
Definition
DNA_node_types.h:561
bNodeTree
Definition
DNA_node_types.h:675
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0