Skip to content

Commit e1212d9

Browse files
stephanmeestersxezon
authored andcommitted
feat(profiling): Add trace zones and frame marks to Tracy profiling (TheSuperHackers#2202)
1 parent 775da20 commit e1212d9

5 files changed

Lines changed: 7 additions & 0 deletions

File tree

Core/GameEngine/Source/Common/FrameRateLimit.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ FrameRateLimit::FrameRateLimit()
3232

3333
Real FrameRateLimit::wait(UnsignedInt maxFps)
3434
{
35+
PROFILER_SECTION;
3536
LARGE_INTEGER tick;
3637
QueryPerformanceCounter(&tick);
3738
double elapsedSeconds = static_cast<double>(tick.QuadPart - m_start) / m_freq;

Generals/Code/GameEngine/Source/GameClient/GameClient.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,8 @@ DECLARE_PERF_TIMER(GameClient_draw)
490490
void GameClient::update()
491491
{
492492
USE_PERF_TIMER(GameClient_update)
493+
PROFILER_FRAME_MARK;
494+
PROFILER_SECTION_COLOR(0x2196F3);
493495
// create the FRAME_TICK message
494496
GameMessage *frameMsg = TheMessageStream->appendMessage( GameMessage::MSG_FRAME_TICK );
495497
frameMsg->appendTimestampArgument( getFrame() );

Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3124,6 +3124,7 @@ extern __int64 Total_Load_3D_Assets;
31243124
void GameLogic::update()
31253125
{
31263126
USE_PERF_TIMER(GameLogic_update)
3127+
PROFILER_SECTION_COLOR(0x4CAF50);
31273128

31283129
LatchRestore<Bool> inUpdateLatch(m_isInUpdate, TRUE);
31293130
#ifdef DO_UNIT_TIMINGS

GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,8 @@ DECLARE_PERF_TIMER(GameClient_draw)
511511
void GameClient::update()
512512
{
513513
USE_PERF_TIMER(GameClient_update)
514+
PROFILER_FRAME_MARK;
515+
PROFILER_SECTION_COLOR(0x2196F3);
514516
// create the FRAME_TICK message
515517
GameMessage *frameMsg = TheMessageStream->appendMessage( GameMessage::MSG_FRAME_TICK );
516518
frameMsg->appendTimestampArgument( getFrame() );

GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3654,6 +3654,7 @@ extern __int64 Total_Load_3D_Assets;
36543654
void GameLogic::update()
36553655
{
36563656
USE_PERF_TIMER(GameLogic_update)
3657+
PROFILER_SECTION_COLOR(0x4CAF50);
36573658

36583659
LatchRestore<Bool> inUpdateLatch(m_isInUpdate, TRUE);
36593660
#ifdef DO_UNIT_TIMINGS

0 commit comments

Comments
 (0)