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

Function SetScreenTime

PresentData/PresentMonTraceConsumer.cpp:67–90  ·  view source on GitHub ↗

Set a ScreenTime for this present. If a ScreenTime has not yet been set, add it to Displayed and set Presented. Otherwise, if the set ScreenTime has no FrameType, overwrite both ScreenTime and FrameType. Otherwise, if the set ScreenTime is zero, overwrite ScreenTime. Otherwise, if the call has a FrameType, add it to the list.

Source from the content-addressed store, hash-verified

65//
66// Otherwise, if the call has a FrameType, add it to the list.
67static inline void SetScreenTime(std::shared_ptr<PresentEvent> const& p, uint64_t screenTime, FrameType frameType = FrameType::NotSet)
68{
69 DebugAssert(screenTime != 0);
70
71 auto displayedCount = p->Displayed.size();
72 if (displayedCount == 0) {
73 p->Displayed.emplace_back(frameType, screenTime);
74 p->FinalState = PresentResult::Presented;
75 } else if (p->Displayed.back().first == FrameType::NotSet) {
76 p->Displayed.back().first = frameType;
77 p->Displayed.back().second = screenTime;
78 } else if (p->Displayed.back().second == 0) {
79 DebugAssert(frameType == FrameType::NotSet);
80 for (size_t i = 0; i < displayedCount; ++i) {
81 if (p->Displayed[i].second == 0) {
82 p->Displayed.back().second = screenTime;
83 p->FinalState = PresentResult::Presented;
84 break;
85 }
86 }
87 } else if (frameType != FrameType::NotSet) {
88 p->Displayed.emplace_back(frameType, screenTime);
89 }
90}
91
92namespace {
93 struct WaitOnAddressShim {

Callers 5

HandleDxgkMMIOFlipMethod · 0.85
HandleDxgkSyncDPCMethod · 0.85
HandleDXGKEventMethod · 0.85
ApplyFlipFrameTypeMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected