1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-28 20:23:51 +00:00

Add SourceLocation macros

This commit is contained in:
Hugo Amiard 2020-08-07 17:09:31 +02:00 committed by David Farrell
parent fb60fb9928
commit aea72b28ce

View File

@ -105,6 +105,10 @@
#include "client/TracyProfiler.hpp"
#include "client/TracyScoped.hpp"
#define TracySourceLocation( varname ) static const tracy::SourceLocationData varname { nullptr, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 };
#define TracySourceLocationN( varname, name ) static const tracy::SourceLocationData varname { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 };
#define TracySourceLocationNC( varname, name, color ) static const tracy::SourceLocationData varname { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color };
#if defined TRACY_HAS_CALLSTACK && defined TRACY_CALLSTACK
# define ZoneNamed( varname, active ) static constexpr tracy::SourceLocationData TracyConcat(__tracy_source_location,__LINE__) { nullptr, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
# define ZoneNamedN( varname, name, active ) static constexpr tracy::SourceLocationData TracyConcat(__tracy_source_location,__LINE__) { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );