Emit dedicated Vsync frame messages.

This commit is contained in:
Bartosz Taudul 2022-07-30 19:53:40 +02:00
parent 8b4385498d
commit 91b002267e
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -216,20 +216,6 @@ void WINAPI EventRecordCallback( PEVENT_RECORD record )
} }
} }
static constexpr const char* VsyncName[] = {
"[0] Vsync",
"[1] Vsync",
"[2] Vsync",
"[3] Vsync",
"[4] Vsync",
"[5] Vsync",
"[6] Vsync",
"[7] Vsync",
"Vsync"
};
static uint32_t VsyncTarget[8] = {};
void WINAPI EventRecordCallbackVsync( PEVENT_RECORD record ) void WINAPI EventRecordCallbackVsync( PEVENT_RECORD record )
{ {
#ifdef TRACY_ON_DEMAND #ifdef TRACY_ON_DEMAND
@ -242,24 +228,9 @@ void WINAPI EventRecordCallbackVsync( PEVENT_RECORD record )
const auto vs = (const VSyncInfo*)record->UserData; const auto vs = (const VSyncInfo*)record->UserData;
int idx = 0; TracyLfqPrepare( QueueType::FrameVsync );
do MemWrite( &item->frameVsync.time, hdr.TimeStamp.QuadPart );
{ MemWrite( &item->frameVsync.id, vs->vidPnTargetId );
if( VsyncTarget[idx] == 0 )
{
VsyncTarget[idx] = vs->vidPnTargetId;
break;
}
else if( VsyncTarget[idx] == vs->vidPnTargetId )
{
break;
}
}
while( ++idx < 8 );
TracyLfqPrepare( QueueType::FrameMarkMsg );
MemWrite( &item->frameMark.time, hdr.TimeStamp.QuadPart );
MemWrite( &item->frameMark.name, uint64_t( VsyncName[idx] ) );
TracyLfqCommit; TracyLfqCommit;
} }