|
39 | 39 | #define TRACY_ENABLE |
40 | 40 | #include <tracy/Tracy.hpp> |
41 | 41 |
|
42 | | -#ifndef TRACY_CALLSTACK |
43 | | -#define TRACY_CALLSTACK 0 |
44 | | -#endif |
45 | | - |
46 | 42 | // Define tracing macros. |
47 | 43 | #define GodotProfileFrameMark FrameMark |
48 | 44 | #define GodotProfileZone(m_zone_name) ZoneScopedN(m_zone_name) |
49 | 45 | #define GodotProfileZoneGroupedFirst(m_group_name, m_zone_name) ZoneNamedN(__godot_tracy_zone_##m_group_name, m_zone_name, true) |
50 | 46 | #define GodotProfileZoneGroupedEndEarly(m_group_name, m_zone_name) __godot_tracy_zone_##m_group_name.~ScopedZone(); |
| 47 | +#ifndef TRACY_CALLSTACK |
| 48 | +#define GodotProfileZoneGrouped(m_group_name, m_zone_name) \ |
| 49 | + GodotProfileZoneGroupedEndEarly(m_group_name, m_zone_name); \ |
| 50 | + static constexpr tracy::SourceLocationData TracyConcat(__tracy_source_location, TracyLine){ m_zone_name, TracyFunction, TracyFile, (uint32_t)TracyLine, 0 }; \ |
| 51 | + new (&__godot_tracy_zone_##m_group_name) tracy::ScopedZone(&TracyConcat(__tracy_source_location, TracyLine), true) |
| 52 | +#else |
51 | 53 | #define GodotProfileZoneGrouped(m_group_name, m_zone_name) \ |
52 | 54 | GodotProfileZoneGroupedEndEarly(m_group_name, m_zone_name); \ |
53 | 55 | static constexpr tracy::SourceLocationData TracyConcat(__tracy_source_location, TracyLine){ m_zone_name, TracyFunction, TracyFile, (uint32_t)TracyLine, 0 }; \ |
54 | 56 | new (&__godot_tracy_zone_##m_group_name) tracy::ScopedZone(&TracyConcat(__tracy_source_location, TracyLine), TRACY_CALLSTACK, true) |
| 57 | +#endif |
55 | 58 |
|
56 | 59 | void godot_init_profiler(); |
57 | 60 |
|
|
0 commit comments