Add C API for frame markup.

This commit is contained in:
Bartosz Taudul 2019-06-24 20:42:52 +02:00
parent ee99ce833c
commit 48e08acb62
2 changed files with 38 additions and 0 deletions

View File

@ -25,6 +25,12 @@ typedef const void* TracyCZoneCtx;
#define TracyCAlloc(x,y) #define TracyCAlloc(x,y)
#define TracyCFree(x) #define TracyCFree(x)
#define TracyCFrameMark
#define TracyCFrameMarkNamed(x)
#define TracyCFrameMarkStart(x)
#define TracyCFrameMarkEnd(x)
#define TracyCFrameImage(x,y,z,w,a)
#else #else
#ifndef TracyConcat #ifndef TracyConcat
@ -88,6 +94,18 @@ void ___tracy_emit_memory_free_callstack( const void* ptr, int depth );
# define TracyCFree( ptr ) ___tracy_emit_memory_free( ptr ); # define TracyCFree( ptr ) ___tracy_emit_memory_free( ptr );
#endif #endif
void ___tracy_emit_frame_mark( const char* name );
void ___tracy_emit_frame_mark_start( const char* name );
void ___tracy_emit_frame_mark_end( const char* name );
void ___tracy_emit_frame_image( void* image, uint16_t w, uint16_t h, uint8_t offset, int flip );
#define TracyCFrameMark ___tracy_emit_frame_mark( 0 );
#define TracyCFrameMarkNamed( name ) ___tracy_emit_frame_mark( name );
#define TracyCFrameMarkStart( name ) ___tracy_emit_frame_mark_start( name );
#define TracyCFrameMarkEnd( name ) ___tracy_emit_frame_mark_end( name );
#define TracyCFrameImage( image, width, height, offset, flip ) ___tracy_emit_frame_image( image, width, height, offset, flip );
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -2264,6 +2264,26 @@ void ___tracy_emit_memory_free_callstack( const void* ptr, int depth )
tracy::Profiler::MemFreeCallstack( ptr, depth ); tracy::Profiler::MemFreeCallstack( ptr, depth );
} }
void ___tracy_emit_frame_mark( const char* name )
{
tracy::Profiler::SendFrameMark( name );
}
void ___tracy_emit_frame_mark_start( const char* name )
{
tracy::Profiler::SendFrameMark( name, tracy::QueueType::FrameMarkMsgStart );
}
void ___tracy_emit_frame_mark_end( const char* name )
{
tracy::Profiler::SendFrameMark( name, tracy::QueueType::FrameMarkMsgEnd );
}
void ___tracy_emit_frame_image( void* image, uint16_t w, uint16_t h, uint8_t offset, int flip )
{
tracy::Profiler::SendFrameImage( image, w, h, offset, flip );
}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif