Add more profile events

This commit is contained in:
Wojtek Figat
2021-07-06 16:17:11 +02:00
parent bf67c62311
commit 9f9e5b49cc
8 changed files with 47 additions and 4 deletions

View File

@@ -112,6 +112,22 @@ inline void ScopedZone::Text( const char* txt, size_t size )
TracyLfqCommit;
}
inline void ScopedZone::Text(const Char* txt, size_t size)
{
assert( size < std::numeric_limits<uint16_t>::max() );
if( !m_active ) return;
#ifdef TRACY_ON_DEMAND
if( GetProfiler().ConnectionId() != m_connectionId ) return;
#endif
auto ptr = (char*)tracy_malloc( size );
for( int i = 0; i < size; i++)
ptr[i] = (char)txt[i];
TracyLfqPrepare( QueueType::ZoneText );
MemWrite( &item->zoneTextFat.text, (uint64_t)ptr );
MemWrite( &item->zoneTextFat.size, (uint16_t)size );
TracyLfqCommit;
}
inline void ScopedZone::Name( const char* txt, size_t size )
{
assert( size < std::numeric_limits<uint16_t>::max() );

View File

@@ -59,6 +59,7 @@ public:
~ScopedZone();
void Text( const char* txt, size_t size );
void Text( const Char* txt, size_t size );
void Name( const char* txt, size_t size );
void Name( const Char* txt, size_t size );
void Color( uint32_t color );