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

Method FindPresentBySubmitSequence

PresentData/PresentMonTraceConsumer.cpp:629–650  ·  view source on GitHub ↗

Lookup the present associated with this submit sequence. Because some DXGK events that reference submit sequence id don't include the queue context, it's possible (though rare) that there are multiple presents in flight with the same submit sequence id. If that is the case, we pick the oldest one.

Source from the content-addressed store, hash-verified

627// it's possible (though rare) that there are multiple presents in flight with
628// the same submit sequence id. If that is the case, we pick the oldest one.
629std::shared_ptr<PresentEvent> PMTraceConsumer::FindPresentBySubmitSequence(uint32_t submitSequence)
630{
631 auto ii = mPresentBySubmitSequence.find(submitSequence);
632 if (ii != mPresentBySubmitSequence.end()) {
633 auto presentsBySubmitSequence = &ii->second;
634
635 auto jj = presentsBySubmitSequence->begin();
636 auto je = presentsBySubmitSequence->end();
637 DebugAssert(jj != je);
638 if (jj != je) {
639 auto present = jj->second;
640 for (++jj; jj != je; ++jj) {
641 if (present->PresentStartTime > jj->second->PresentStartTime) {
642 present = jj->second;
643 }
644 }
645 return present;
646 }
647 }
648
649 return std::shared_ptr<PresentEvent>();
650}
651
652// An MMIOFlip event is emitted when an MMIOFlip packet is dequeued. All GPU
653// work submitted prior to the flip has been completed.

Callers

nothing calls this directly

Calls 2

endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected