Blender V4.3
deg_debug.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2013 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
12
13#include "BKE_global.hh"
14
16
17namespace blender::deg {
18
20 public:
22
23 bool do_time_debug() const;
24
27
28 /* NOTE: Corresponds to G_DEBUG_DEPSGRAPH_* flags. */
29 int flags;
30
31 /* Name of this dependency graph (is used for debug prints, helping to distinguish graphs
32 * created for different view layer). */
33 string name;
34
35 protected:
36 /* Maximum number of counters used to calculate frame rate of depsgraph update. */
37 static const constexpr int MAX_FPS_COUNTERS = 64;
38
39 /* Point in time when last graph evaluation began.
40 * Is initialized from begin_graph_evaluation() when time debug is enabled.
41 */
43};
44
45#define DEG_DEBUG_PRINTF(depsgraph, type, ...) \
46 do { \
47 if (DEG_debug_flags_get(depsgraph) & G_DEBUG_DEPSGRAPH_##type) { \
48 DEG_debug_print_begin(depsgraph); \
49 fprintf(stdout, __VA_ARGS__); \
50 } \
51 } while (0)
52
53#define DEG_GLOBAL_DEBUG_PRINTF(type, ...) \
54 do { \
55 if (G.debug & G_DEBUG_DEPSGRAPH_##type) { \
56 fprintf(stdout, __VA_ARGS__); \
57 } \
58 } while (0)
59
60#define DEG_ERROR_PRINTF(...) \
61 do { \
62 fprintf(stderr, __VA_ARGS__); \
63 fflush(stderr); \
64 } while (0)
65
66bool terminal_do_color(void);
67string color_for_pointer(const void *pointer);
68string color_end(void);
69
70} // namespace blender::deg
static const constexpr int MAX_FPS_COUNTERS
Definition deg_debug.h:37
bool terminal_do_color()
Definition deg_debug.cc:58
string color_for_pointer(const void *pointer)
Definition deg_debug.cc:63
string color_end()
Definition deg_debug.cc:75