1
0
Fork 0

Fix: framerate window showed a slightly higher rate than actually measured (#8682)

The first point was counted, but also initialized as "last". As
such, it didn't add to "total", but did add to "count", which made
the "count" 1 more than the total actually represents.
pull/8684/head
Patric Stout 2021-02-16 20:37:58 +01:00 committed by GitHub
parent c9bcc12265
commit 7bdb2e79ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -151,6 +151,10 @@ namespace {
/* Total duration covered by collected points */
TimingMeasurement total = 0;
/* We have nothing to compare the first point against */
point--;
if (point < 0) point = NUM_FRAMERATE_POINTS - 1;
while (point != last_point) {
/* Only record valid data points, but pretend the gaps in measurements aren't there */
if (this->durations[point] != INVALID_DURATION) {