elvissteinjr / DesktopPlus

Advanced desktop access for OpenVR
GNU General Public License v3.0
454 stars 29 forks source link

Performance Monitor reports 0 FPS if game is running at low FPS #25

Closed Unmoon closed 3 years ago

Unmoon commented 3 years ago

Noticed that the overlay is displaying 0 FPS if I'm getting ~20FPS, and potentially (didn't pay much attention) even at ~45FPS in VRChat. Frame time etc seems to work fine.

Performance options: image

Version 2.5.1 Beta RTX 2070, driver version 466.27

elvissteinjr commented 3 years ago

FPS count displayed is based on SteamVR's counted frame data. In particular, it's currently based on the number of frames presented minus the reprojected ones during the last second (without that it'd always seem fullspeed unless when hard dropping frames). That would in theory mean that all frames were reprojected when it displays 0 FPS... there might be some truth to this but I suppose that also includes only partially synthesized or late-warped ones then.

So much for that. Either way it's not really intuitive. As for fixing it, I'll need to look into it. It seems like adding Compositor_FrameTiming::m_nNumMisPresented (Edit: Compositor_CumulativeStats::m_nNumReprojectedFramesTimedOut makes more sense and looks promising) to the frame count might just be it, but documentation is very thin so I'll need to check if this leads to correct values. Worst case I'm considering to just calculate the value from the frame time in these scenarios if that doesn't work.

I've seen the 0 fps value before on my end, but didn't really think much of it as SteamVR likes to play tricks every now and then and other low fps situations displayed fine. But I'll look into fixing it. Thanks for the report.

elvissteinjr commented 3 years ago

I believe this should be fixed now. Numbers look good on my end at least. I've also put up a new beta build that contains the fix, so you can check it out right away.

Let me know if there's still something wrong with it. Thanks again.

Unmoon commented 3 years ago

Thanks, it does seem good, if a bit less stable than what VRChat reports.

Unmoon commented 3 years ago

At very low fps (20), it's now reporting 100/120, which is probably correct if you consider the reprojected frames.
I'd prefer seeing actual frames rendered, even if they are "late" and need to go through the reprojection pipeline.

elvissteinjr commented 3 years ago

Sorry for the delayed response. Trying out some things I've found a better method of getting the frame count... it's actually painfully obvious (using compositor frame timing index, which only increases for full new frames) and works even with no VR scene app running.

I do believe this works fine for both CPU and GPU limited frame rate scenarios... but I keep saying that. Before going back and worth with beta builds on this, maybe it'd be good idea to run this through you first. Are you able to compile the project yourself? It's pretty straight forward if you have Visual Studio installed, otherwise I'll probably just upload a build with the change here. Code is pushed already.

Unmoon commented 3 years ago

Thanks again, I got master built and gave it a go - it seems to mirror the VRChat FPS display, and in general feels right.