justinstenning / Direct3DHook

DirectX Capture and Overlays by using Direct3D API hooks
http://spazzarama.com/2011/03/14/c-screen-capture-and-overlays-for-direct3d-9-10-and-11-using-api-hooks
MIT License
582 stars 176 forks source link

FPS are double what they should be for certain d3d11 titles #53

Open jazzup opened 7 years ago

jazzup commented 7 years ago

In Metro Last Light/Crysis 3/Splinter Cell Blacklist and perhaps others, displayed frames per second are twice what they should be.

before

I've found a fix for this and I've uploaded a fork. I'm not versed in GitHub but I think I've done it right. Here's an image after the fix:

after

Because the fix breaks fps reading for d3d9 and d3d10, I made 2 separate FramesPerSecond11.cs only for d3d11. I also made minor changes to BaseDXHook.cs and DXHookD3D11.cs.

It's a different way of calculating fps based on LastPresentCount, code which I found here on GitHub.

justinstenning commented 7 years ago

Thanks @jazzup I will take a look at your changes.