Debug Draw 3D (and 2D) 1.5.0
Draw 3D debug graphics and 2D overlays with this add-on.
Loading...
Searching...
No Matches
stats_3d.h
1#pragma once
2
3#include "utils/compiler.h"
4
5GODOT_WARNING_DISABLE()
6#include <godot_cpp/classes/ref_counted.hpp>
7GODOT_WARNING_RESTORE()
8using namespace godot;
9
24class DebugDraw3DStats : public RefCounted {
25 GDCLASS(DebugDraw3DStats, RefCounted)
26
27protected:
29 static void _bind_methods();
30
31#define DEFINE_DEFAULT_PROP(name, type, def) \
32private: \
33 type name = def; \
34 \
35public: \
36 type get_##name() const { return name; } \
37 void set_##name(int64_t val) {}
38
39 DEFINE_DEFAULT_PROP(instances, int64_t, 0);
40 DEFINE_DEFAULT_PROP(lines, int64_t, 0);
41 DEFINE_DEFAULT_PROP(instances_physics, int64_t, 0);
42 DEFINE_DEFAULT_PROP(lines_physics, int64_t, 0);
43 DEFINE_DEFAULT_PROP(total_geometry, int64_t, 0);
44
45 DEFINE_DEFAULT_PROP(visible_instances, int64_t, 0);
46 DEFINE_DEFAULT_PROP(visible_lines, int64_t, 0);
47 DEFINE_DEFAULT_PROP(total_visible, int64_t, 0);
48
49 DEFINE_DEFAULT_PROP(time_filling_buffers_instances_usec, int64_t, 0);
50 DEFINE_DEFAULT_PROP(time_filling_buffers_lines_usec, int64_t, 0);
51 DEFINE_DEFAULT_PROP(time_filling_buffers_instances_physics_usec, int64_t, 0);
52 DEFINE_DEFAULT_PROP(time_filling_buffers_lines_physics_usec, int64_t, 0);
53 DEFINE_DEFAULT_PROP(total_time_filling_buffers_usec, int64_t, 0);
54
55 DEFINE_DEFAULT_PROP(time_culling_instances_usec, int64_t, 0);
56 DEFINE_DEFAULT_PROP(time_culling_lines_usec, int64_t, 0);
57 DEFINE_DEFAULT_PROP(total_time_culling_usec, int64_t, 0);
58
59 DEFINE_DEFAULT_PROP(total_time_spent_usec, int64_t, 0);
60
61 DEFINE_DEFAULT_PROP(created_scoped_configs, int64_t, 0);
62 DEFINE_DEFAULT_PROP(orphan_scoped_configs, int64_t, 0);
63
64 DEFINE_DEFAULT_PROP(nodes_label3d_visible, int64_t, 0);
65 DEFINE_DEFAULT_PROP(nodes_label3d_visible_physics, int64_t, 0);
66 DEFINE_DEFAULT_PROP(nodes_label3d_exists, int64_t, 0);
67 DEFINE_DEFAULT_PROP(nodes_label3d_exists_physics, int64_t, 0);
68 DEFINE_DEFAULT_PROP(nodes_label3d_exists_total, int64_t, 0);
69
70#undef DEFINE_DEFAULT_PROP
71
72 DebugDraw3DStats(){};
73
75 void set_nodes_stats(
76 const int64_t &p_nodes_label3d_visible,
77 const int64_t &p_nodes_label3d_visible_physics,
78 const int64_t &p_nodes_label3d_exists,
79 const int64_t &p_nodes_label3d_exists_physics);
80
82 void set_scoped_config_stats(
83 const int64_t &p_created_scoped_configs,
84 const int64_t &p_orphan_scoped_configs);
85
87 void set_render_stats(
88 const int64_t &p_instances,
89 const int64_t &p_lines,
90 const int64_t &p_visible_instances,
91 const int64_t &p_visible_lines,
92
93 const int64_t &p_instances_physics,
94 const int64_t &p_lines_physics,
95
96 const int64_t &p_time_filling_buffers_instances_usec,
97 const int64_t &p_time_filling_buffers_lines_usec,
98 const int64_t &p_time_culling_instances_usec,
99 const int64_t &p_time_culling_lines_usec);
100
102 void combine_with(const Ref<DebugDraw3DStats> p_other);
103};