Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor benchgfx #10191

merged 1 commit into from Nov 8, 2019


Copy link

ZehMatt commented Nov 3, 2019

The old benchgfx was a little bit odd and did not really tell anything other than how much time really elapsed, on top there was a pretty good variance in it.

A few things this PR does:

  • It will generate now a screenshoft by zoom levels * rotations * iterations.
  • Pre-initialize viewports and dpis before making screenshots, before they had been included in the time but initialization usually happens only once, also fixing a bug where the viewport zoom was incorrectly initialized resulting in always having a viewport at zero.
  • The new default value for the iteration count is now defaulted to 20 to reflect the changes.
  • Raises accuracy by using double instead of float.
  • The variance is now gone because initialization can vary a bit due to memory allocation.
  • More meaningful output which is also easier to parse if one must.
>openrct2 benchgfx parks/bpb.sv6 20
Engine: Software
Render Count: 240
Zoom[0] average: 0.058009s, 17 FPS
Zoom[1] average: 0.026519s, 38 FPS
Zoom[2] average: 0.012787s, 78 FPS
Total average: 0.032438s, 31 FPS
Time: 7.78519s

Having multiple runs now has at best a variance of 1 FPS which is now more than okay.

@ZehMatt ZehMatt requested a review from IntelOrca Nov 3, 2019
@ZehMatt ZehMatt force-pushed the ZehMatt:refactor/benchgfx branch from c100b34 to b79563f Nov 3, 2019
@janisozaur janisozaur self-requested a review Nov 7, 2019
@ZehMatt ZehMatt force-pushed the ZehMatt:refactor/benchgfx branch from b79563f to 1abe074 Nov 8, 2019
@ZehMatt ZehMatt force-pushed the ZehMatt:refactor/benchgfx branch from 1abe074 to d3103b6 Nov 8, 2019
@ZehMatt ZehMatt merged commit f4a1b75 into OpenRCT2:develop Nov 8, 2019
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build failed
continuous-integration/appveyor/pr AppVeyor build succeeded
@ZehMatt ZehMatt deleted the ZehMatt:refactor/benchgfx branch Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.