Debug Draw 3D (and 2D) 1.4.5
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#undef DEFINE_DEFAULT_PROP
65
67
69 void set_scoped_config_stats(
70 const int64_t &p_created_scoped_configs,
71 const int64_t &p_orphan_scoped_configs);
72
74 void set_render_stats(
75 const int64_t &p_instances,
76 const int64_t &p_lines,
77 const int64_t &p_visible_instances,
78 const int64_t &p_visible_lines,
79
80 const int64_t &p_instances_phys,
81 const int64_t &p_lines_phys,
82
83 const int64_t &p_time_filling_buffers_instances_usec,
84 const int64_t &p_time_filling_buffers_lines_usec,
85 const int64_t &p_time_culling_instances_usec,
86 const int64_t &p_time_culling_lines_usec);
87
89 void combine_with(const Ref<DebugDraw3DStats> p_other);
90};
You can get statistics about 3D rendering from this class.
Definition stats_3d.h:24