Skip to content

Commit

Permalink
update dropped frame parsing for PresentMon 2
Browse files Browse the repository at this point in the history
  • Loading branch information
BoringBoredom committed Apr 8, 2024
1 parent f91a860 commit 4d9c55f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ function processCsv(
const frameTimeIndex = lowerCaseSplitRow.indexOf(indicator);
const cpuBusyIndex = lowerCaseSplitRow.indexOf("cpubusy");
const cpuWaitIndex = lowerCaseSplitRow.indexOf("cpuwait");
const displayedTimeIndex = lowerCaseSplitRow.indexOf("displayedtime");
const droppedIndex = lowerCaseSplitRow.indexOf("dropped");
const allowsTearingIndex = lowerCaseSplitRow.indexOf("allowstearing");
const dwmNotifiedIndex = lowerCaseSplitRow.indexOf("dwmnotified");
Expand Down Expand Up @@ -217,7 +218,10 @@ function processCsv(
presentModes.add(splitLine[presentModeIndex]);
syncIntervals.add(splitLine[syncIntervalIndex]);

if (parseInt(splitLine[droppedIndex], 10) === 1) {
if (
parseInt(splitLine[droppedIndex], 10) === 1 ||
splitLine[displayedTimeIndex] === "0.000000"
) {
dropped += 1;
}
if (parseInt(splitLine[allowsTearingIndex], 10) === 1) {
Expand All @@ -238,7 +242,7 @@ function processCsv(
color: colors[Math.floor(benchIndex++ / (colorRepeat + 1))],
duration,
frames: unsortedMs.length,
...(droppedIndex !== -1 && { dropped }),
...((droppedIndex !== -1 || displayedTimeIndex !== -1) && { dropped }),
...(allowsTearingIndex !== -1 && { allowsTearing }),
...(dwmNotified !== -1 && { dwmNotified }),
...(wasBatched !== -1 && { wasBatched }),
Expand Down

0 comments on commit 4d9c55f

Please sign in to comment.