MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / HandleDxgkSyncDPC

Method HandleDxgkSyncDPC

PresentData/PresentMonTraceConsumer.cpp:681–702  ·  view source on GitHub ↗

The VSyncDPC/HSyncDPC contains a field telling us what flipped to screen. This is the way to track completion of a fullscreen present.

Source from the content-addressed store, hash-verified

679// The VSyncDPC/HSyncDPC contains a field telling us what flipped to screen.
680// This is the way to track completion of a fullscreen present.
681void PMTraceConsumer::HandleDxgkSyncDPC(uint64_t timestamp, uint32_t submitSequence)
682{
683 auto pEvent = FindPresentBySubmitSequence(submitSequence);
684 if (pEvent != nullptr) {
685
686 VerboseTraceBeforeModifyingPresent(pEvent.get());
687 SetScreenTime(pEvent, timestamp);
688
689 // For Hardware_Legacy_Flip, we are done tracking the present. If we
690 // aren't expecting a subsequent *SyncMultiPlaneDPC_Info event, then we
691 // complete the present now.
692 //
693 // If we are expecting a subsequent *SyncMultiPlaneDPC_Info event, then
694 // we wait for it to complete the present. This is because there are
695 // rare cases where there may be multiple in-flight presents with the
696 // same submit sequence and waiting ensures that both the VSyncDPC and
697 // *SyncMultiPlaneDPC events match to the same present.
698 if (pEvent->PresentMode == PresentMode::Hardware_Legacy_Flip && !pEvent->WaitForMPOFlipEvent) {
699 CompletePresent(pEvent);
700 }
701 }
702}
703
704// These events are emitted during submission of all types of windowed presents
705// while DWM is on and gives us a token we can use to match with the

Callers

nothing calls this directly

Calls 1

SetScreenTimeFunction · 0.85

Tested by

no test coverage detected