mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Emit dedicated Vsync frame messages.
This commit is contained in:
parent
8b4385498d
commit
91b002267e
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user