eugeneloza / decoherence

Project moved to https://gitlab.com/EugeneLoza/decoherence
GNU General Public License v3.0
10 stars 7 forks source link

Why FPS is limited to 60? #478

Closed eugeneloza closed 6 years ago

eugeneloza commented 6 years ago

For some reason FPS is capped at 60Hz. While Application.LimitFPS := 0. Should check it.

michaliskambi commented 6 years ago

This probably means you have "vertical synchronization" turned "on", which is normal and default on modern GPUs. You should deactivate it to see as many FPS as possible -- how to do it depends on GPU, NVidia and AMD have their own applications, like "NVidia X Server Settings" with option called "Sync To VBlank".

screenshot at 2018-03-23 19 32 51

See various notes about FPS on https://castle-engine.io/manual_optimization.php . In particular, heed the warning there:

Note that the monitor will actually drop some frames above it's frequency, like 60. (This is relevant only if "vertical synchronization" is off.) This may cause you to observe that above some threshold, FPS are "easier to gain" by optimizations, which may lead you to a false judgement about which optimizations are more useful than others. To make a good judgement about what is faster / slower, compare two versions of your program when only one thing changes.

eugeneloza commented 6 years ago

Yeah, thanks! I was suspecting VSYNC for this issue, however, with the same video card and the same MESA I had VSYNC 100 Hz in my previous Debian installation. It might have changed to 60 after reinstalling Debian because of that.

eugeneloza commented 6 years ago

And it doesn't seem like MESA has VSYNC anywhere explicitly (should be in config?), while Display reports 59.8 Hz :)

eugeneloza commented 6 years ago

Analyzing this issue deeper, yes, this is MESA-related issue (looks like it's Stretch-related, see https://www.raspberrypi.org/forums/viewtopic.php?t=191791).

Running synchronized to the vertical refresh. The framerate should be approximately the same as the monitor refresh rate.

which is 60 Hz.

eugeneloza commented 6 years ago

So, yeah. This is not a bug, it's just driver.