Skip to content

Commit b135f9c

Browse files
Fixes for correctly finding app index for both console and ipm. Also added a fix where the flip frame type was being applied even the present ids didn't match.
1 parent 8a60b74 commit b135f9c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

IntelPresentMon/PresentMonMiddleware/ConcreteMiddleware.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,9 +519,9 @@ static void ReportMetricsHelper(
519519
size_t displayIndex = displayed && nextDisplayedPresent != nullptr ? displayCount - 1 : 0;
520520

521521
// Figure out what display index to attribute cpu work, gpu work, animation error, and input
522-
// latency to.
522+
// latency to. Start looking from the current display index.
523523
size_t appIndex = 0;
524-
for (size_t i = 0; i < displayCount; ++i) {
524+
for (size_t i = displayIndex; i < displayCount; ++i) {
525525
if (p->Displayed_FrameType[i] == FrameType::NotSet ||
526526
p->Displayed_FrameType[i] == FrameType::Application) {
527527
appIndex = i;
@@ -1190,7 +1190,7 @@ static void ReportMetrics(
11901190
}
11911191
return;
11921192
}
1193-
1193+
11941194
double ConcreteMiddleware::CalculateStatistic(std::vector<double>& inData, PM_STAT stat) const
11951195
{
11961196
if (inData.size() == 1) {

PresentData/PresentMonTraceConsumer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ void PMTraceConsumer::HandleDXGKEvent(EVENT_RECORD* pEventRecord)
12431243
// Apply any pending FlipFrameType events
12441244
auto ii = mPendingFlipFrameTypeEvents.find(vidPnLayerId);
12451245
if (ii != mPendingFlipFrameTypeEvents.end()) {
1246-
if (present != nullptr) {
1246+
if (present != nullptr && ii->second.PresentId == PresentId[i]) {
12471247
ApplyFlipFrameType(present, ii->second.Timestamp, ii->second.FrameType);
12481248
}
12491249
mPendingFlipFrameTypeEvents.erase(ii);

PresentMon/OutputThread.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ static void ReportMetricsHelper(
310310
size_t displayIndex = displayed && nextDisplayedPresent != nullptr ? displayCount - 1 : 0;
311311

312312
// Figure out what display index to attribute cpu work, gpu work, animation error, and input
313-
// latency to.
313+
// latency to. Start looking from the current display index.
314314
size_t appIndex = 0;
315-
for (size_t i = 0; i < displayCount; ++i) {
315+
for (size_t i = displayIndex; i < displayCount; ++i) {
316316
if (p->Displayed[i].first == FrameType::NotSet ||
317317
p->Displayed[i].first == FrameType::Application) {
318318
appIndex = i;

0 commit comments

Comments
 (0)