mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Fix tracy implementation when no callstack sampling is desired.
This commit is contained in:
parent
bad1287b62
commit
6b98a57b8e
1 changed files with 7 additions and 4 deletions
|
|
@ -39,19 +39,22 @@
|
||||||
#define TRACY_ENABLE
|
#define TRACY_ENABLE
|
||||||
#include <tracy/Tracy.hpp>
|
#include <tracy/Tracy.hpp>
|
||||||
|
|
||||||
#ifndef TRACY_CALLSTACK
|
|
||||||
#define TRACY_CALLSTACK 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Define tracing macros.
|
// Define tracing macros.
|
||||||
#define GodotProfileFrameMark FrameMark
|
#define GodotProfileFrameMark FrameMark
|
||||||
#define GodotProfileZone(m_zone_name) ZoneScopedN(m_zone_name)
|
#define GodotProfileZone(m_zone_name) ZoneScopedN(m_zone_name)
|
||||||
#define GodotProfileZoneGroupedFirst(m_group_name, m_zone_name) ZoneNamedN(__godot_tracy_zone_##m_group_name, m_zone_name, true)
|
#define GodotProfileZoneGroupedFirst(m_group_name, m_zone_name) ZoneNamedN(__godot_tracy_zone_##m_group_name, m_zone_name, true)
|
||||||
#define GodotProfileZoneGroupedEndEarly(m_group_name, m_zone_name) __godot_tracy_zone_##m_group_name.~ScopedZone();
|
#define GodotProfileZoneGroupedEndEarly(m_group_name, m_zone_name) __godot_tracy_zone_##m_group_name.~ScopedZone();
|
||||||
|
#ifndef TRACY_CALLSTACK
|
||||||
|
#define GodotProfileZoneGrouped(m_group_name, m_zone_name) \
|
||||||
|
GodotProfileZoneGroupedEndEarly(m_group_name, m_zone_name); \
|
||||||
|
static constexpr tracy::SourceLocationData TracyConcat(__tracy_source_location, TracyLine){ m_zone_name, TracyFunction, TracyFile, (uint32_t)TracyLine, 0 }; \
|
||||||
|
new (&__godot_tracy_zone_##m_group_name) tracy::ScopedZone(&TracyConcat(__tracy_source_location, TracyLine), true)
|
||||||
|
#else
|
||||||
#define GodotProfileZoneGrouped(m_group_name, m_zone_name) \
|
#define GodotProfileZoneGrouped(m_group_name, m_zone_name) \
|
||||||
GodotProfileZoneGroupedEndEarly(m_group_name, m_zone_name); \
|
GodotProfileZoneGroupedEndEarly(m_group_name, m_zone_name); \
|
||||||
static constexpr tracy::SourceLocationData TracyConcat(__tracy_source_location, TracyLine){ m_zone_name, TracyFunction, TracyFile, (uint32_t)TracyLine, 0 }; \
|
static constexpr tracy::SourceLocationData TracyConcat(__tracy_source_location, TracyLine){ m_zone_name, TracyFunction, TracyFile, (uint32_t)TracyLine, 0 }; \
|
||||||
new (&__godot_tracy_zone_##m_group_name) tracy::ScopedZone(&TracyConcat(__tracy_source_location, TracyLine), TRACY_CALLSTACK, true)
|
new (&__godot_tracy_zone_##m_group_name) tracy::ScopedZone(&TracyConcat(__tracy_source_location, TracyLine), TRACY_CALLSTACK, true)
|
||||||
|
#endif
|
||||||
|
|
||||||
void godot_init_profiler();
|
void godot_init_profiler();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue