crosire / d3d8to9

A D3D8 pseudo-driver which converts API calls and bytecode shaders to equivalent D3D9 ones.
BSD 2-Clause "Simplified" License
875 stars 77 forks source link

60 FPS lock in Max Payne #95

Closed deton24 closed 4 years ago

deton24 commented 5 years ago

I use Widescreen by 13AG as dinput.dll and only d3d8.dll without even d3d9.dll from reshade. I get 60 FPS lock. When I delete d3d8.dll (d3d8to9) it unlocks FPS.

AMD card.

Sethy1124 commented 5 years ago

If your monitor is only 60 Hz then it really doesn't matter as the game will only be 60fps even if an fps counter shows higher

HerMajestyDrMona commented 5 years ago

I think adding: Output.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;

At the end of function ConvertPresentParameters() in d3d8types.cpp removes the 60FPS limit.

elishacloud commented 4 years ago

I checked the game. Both Max Payne and Max Payne 2 send the following parameters:

From everything I have read and looking at the Microsoft documentation here and here these settings should enable vsync, as d3d8to9 does.

Here are two quotes from Microsoft's documentation:

D3DSWAPEFFECT_DISCARD For a full-screen swap chain, the presentation rate is determined by the value assigned to the FullScreen_PresentationInterval member of the D3DPRESENT_PARAMETERS structure when the device or swap chain is created. Unless this value is D3DPRESENT_INTERVAL_IMMEDIATE, the presentation will be synchronized with the vertical sync of the monitor.

Flag Description
D3DPRESENT_INTERVAL_ONE The driver will wait for the vertical retrace period. Present operations will not be affected more frequently than the screen refresh.

Either Microsoft's documentation is wrong, or there is a bug in the d3d8 implementation. I suspect the latter.

I don't believe there is any d3d8to9 bug here. I recommend either using your graphics card to disable vsync, using some third party tool that can do that or creating a custom build, as HerMajestyDrMona mentioned above.

image

mirh commented 1 year ago

https://github.com/crosire/d3d8to9/pull/143 TL;DR microsoft removed exclusive fullscreen from d3d8. And whether this had always been the case or yet another DWM quirk, thus you get windowed which means unlimited framerate.