diff --git a/Tracy.hpp b/Tracy.hpp index 4ef18a97..508b2e1f 100644 --- a/Tracy.hpp +++ b/Tracy.hpp @@ -59,6 +59,11 @@ #define TracyAllocS(x,y,z) #define TracyFreeS(x,y) +#define TracyMessageS(x,y,z) +#define TracyMessageLS(x,y) +#define TracyMessageCS(x,y,z,w) +#define TracyMessageLCS(x,y,z) + #else #include "client/TracyLock.hpp" @@ -103,16 +108,22 @@ #define TracyPlot( name, val ) tracy::Profiler::PlotData( name, val ); #define TracyPlotConfig( name, type ) tracy::Profiler::ConfigurePlot( name, type ); -#define TracyMessage( txt, size ) tracy::Profiler::Message( txt, size, 0 ); -#define TracyMessageL( txt ) tracy::Profiler::Message( txt, 0 ); -#define TracyMessageC( txt, size, color ) tracy::Profiler::MessageColor( txt, size, color, 0 ); -#define TracyMessageLC( txt, color ) tracy::Profiler::MessageColor( txt, color, 0 ); #define TracyAppInfo( txt, size ) tracy::Profiler::MessageAppInfo( txt, size ); #if defined TRACY_HAS_CALLSTACK && defined TRACY_CALLSTACK +# define TracyMessage( txt, size ) tracy::Profiler::Message( txt, size, TRACY_CALLSTACK ); +# define TracyMessageL( txt ) tracy::Profiler::Message( txt, TRACY_CALLSTACK ); +# define TracyMessageC( txt, size, color ) tracy::Profiler::MessageColor( txt, size, color, TRACY_CALLSTACK ); +# define TracyMessageLC( txt, color ) tracy::Profiler::MessageColor( txt, color, TRACY_CALLSTACK ); + # define TracyAlloc( ptr, size ) tracy::Profiler::MemAllocCallstack( ptr, size, TRACY_CALLSTACK ); # define TracyFree( ptr ) tracy::Profiler::MemFreeCallstack( ptr, TRACY_CALLSTACK ); #else +# define TracyMessage( txt, size ) tracy::Profiler::Message( txt, size, 0 ); +# define TracyMessageL( txt ) tracy::Profiler::Message( txt, 0 ); +# define TracyMessageC( txt, size, color ) tracy::Profiler::MessageColor( txt, size, color, 0 ); +# define TracyMessageLC( txt, color ) tracy::Profiler::MessageColor( txt, color, 0 ); + # define TracyAlloc( ptr, size ) tracy::Profiler::MemAlloc( ptr, size ); # define TracyFree( ptr ) tracy::Profiler::MemFree( ptr ); #endif @@ -130,6 +141,11 @@ # define TracyAllocS( ptr, size, depth ) tracy::Profiler::MemAllocCallstack( ptr, size, depth ); # define TracyFreeS( ptr, depth ) tracy::Profiler::MemFreeCallstack( ptr, depth ); + +# define TracyMessageS( txt, size, depth ) tracy::Profiler::Message( txt, size, depth ); +# define TracyMessageLS( txt, depth ) tracy::Profiler::Message( txt, depth ); +# define TracyMessageCS( txt, size, color, depth ) tracy::Profiler::MessageColor( txt, size, color, depth ); +# define TracyMessageLCS( txt, color, depth ) tracy::Profiler::MessageColor( txt, color, depth ); #else # define ZoneNamedS( varname, depth, active ) ZoneNamed( varname, active ) # define ZoneNamedNS( varname, name, depth, active ) ZoneNamedN( varname, name, active ) @@ -143,6 +159,11 @@ # define TracyAllocS( ptr, size, depth ) TracyAlloc( ptr, size ) # define TracyFreeS( ptr, depth ) TracyFree( ptr ) + +# define TracyMessageS( txt, size, depth ) TracyMessage( txt, size ) +# define TracyMessageLS( txt, depth ) TracyMessageL( txt ) +# define TracyMessageCS( txt, size, color, depth ) TracyMessageC( txt, size, color ) +# define TracyMessageLCS( txt, color, depth ) TracyMessageLC( txt, color ) #endif #endif diff --git a/TracyC.h b/TracyC.h index 9c1e000b..8ed505a2 100644 --- a/TracyC.h +++ b/TracyC.h @@ -95,12 +95,27 @@ TRACY_API void ___tracy_emit_memory_alloc_callstack( const void* ptr, size_t siz TRACY_API void ___tracy_emit_memory_free( const void* ptr ); TRACY_API void ___tracy_emit_memory_free_callstack( const void* ptr, int depth ); +TRACY_API void ___tracy_emit_message( const char* txt, size_t size, int callstack ); +TRACY_API void ___tracy_emit_messageL( const char* txt, int callstack ); +TRACY_API void ___tracy_emit_messageC( const char* txt, size_t size, uint32_t color, int callstack ); +TRACY_API void ___tracy_emit_messageLC( const char* txt, uint32_t color, int callstack ); + #if defined TRACY_HAS_CALLSTACK && defined TRACY_CALLSTACK # define TracyCAlloc( ptr, size ) ___tracy_emit_memory_alloc_callstack( ptr, size, TRACY_CALLSTACK ) # define TracyCFree( ptr ) ___tracy_emit_memory_alloc_free_callstack( ptr, TRACY_CALLSTACK ) + +# define TracyCMessage( txt, size ) ___tracy_emit_message( txt, size, TRACY_CALLSTACK ); +# define TracyCMessageL( txt ) ___tracy_emit_messageL( txt, TRACY_CALLSTACK ); +# define TracyCMessageC( txt, size, color ) ___tracy_emit_messageC( txt, size, color, TRACY_CALLSTACK ); +# define TracyCMessageLC( txt, color ) ___tracy_emit_messageLC( txt, color, TRACY_CALLSTACK ); #else # define TracyCAlloc( ptr, size ) ___tracy_emit_memory_alloc( ptr, size ); # define TracyCFree( ptr ) ___tracy_emit_memory_free( ptr ); + +# define TracyCMessage( txt, size ) ___tracy_emit_message( txt, size, 0 ); +# define TracyCMessageL( txt ) ___tracy_emit_messageL( txt, 0 ); +# define TracyCMessageC( txt, size, color ) ___tracy_emit_messageC( txt, size, color, 0 ); +# define TracyCMessageLC( txt, color ) ___tracy_emit_messageLC( txt, color, 0 ); #endif @@ -117,17 +132,9 @@ TRACY_API void ___tracy_emit_frame_image( const void* image, uint16_t w, uint16_ TRACY_API void ___tracy_emit_plot( const char* name, double val ); -TRACY_API void ___tracy_emit_message( const char* txt, size_t size, int callstack ); -TRACY_API void ___tracy_emit_messageL( const char* txt, int callstack ); -TRACY_API void ___tracy_emit_messageC( const char* txt, size_t size, uint32_t color, int callstack ); -TRACY_API void ___tracy_emit_messageLC( const char* txt, uint32_t color, int callstack ); TRACY_API void ___tracy_emit_message_appinfo( const char* txt, size_t size ); #define TracyCPlot( name, val ) ___tracy_emit_plot( name, val ); -#define TracyCMessage( txt, size ) ___tracy_emit_message( txt, size, 0 ); -#define TracyCMessageL( txt ) ___tracy_emit_messageL( txt, 0 ); -#define TracyCMessageC( txt, size, color ) ___tracy_emit_messageC( txt, size, color, 0 ); -#define TracyCMessageLC( txt, color ) ___tracy_emit_messageLC( txt, color, 0 ); #define TracyCAppInfo( txt, color ) ___tracy_emit_message_appinfo( txt, color ); @@ -139,6 +146,11 @@ TRACY_API void ___tracy_emit_message_appinfo( const char* txt, size_t size ); # define TracyCAllocS( ptr, size, depth ) ___tracy_emit_memory_alloc_callstack( ptr, size, depth ) # define TracyCFreeS( ptr, depth ) ___tracy_emit_memory_alloc_free_callstack( ptr, depth ) + +# define TracyCMessageS( txt, size, depth ) ___tracy_emit_message( txt, size, depth ); +# define TracyCMessageLS( txt, depth ) ___tracy_emit_messageL( txt, depth ); +# define TracyCMessageCS( txt, size, color, depth ) ___tracy_emit_messageC( txt, size, color, depth ); +# define TracyCMessageLCS( txt, color, depth ) ___tracy_emit_messageLC( txt, color, depth ); #endif #endif