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

60 FPS lock in Max Payne #95

Closed
deton24 opened this issue Jan 30, 2019 · 7 comments
Closed

60 FPS lock in Max Payne #95

deton24 opened this issue Jan 30, 2019 · 7 comments

Comments

@deton24
Copy link

deton24 commented Jan 30, 2019

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

AMD card.

@Sethy1124
Copy link

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
Copy link
Contributor

I think adding:
Output.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;

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

@HerMajestyDrMona HerMajestyDrMona mentioned this issue Aug 3, 2019
Closed
@elishacloud
Copy link
Contributor

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

  • Windowed = false
  • SwapEffect = D3DSWAPEFFECT_DISCARD
  • FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT
  • FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_ONE

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
Copy link

mirh commented Apr 16, 2023

#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.

@deton24
Copy link
Author

deton24 commented Sep 18, 2024

To raise 60 FPS limit in pre-1809 W10 builds, and while not using windowed mode or custom d3d8to9 build, use RivaTuner Statistics Server, add MaxPayne.exe and set "Custom Direct3D support". It will start to use 120 FPS limit from now on.
When the option is set when the game is minimized, you must sometimes task switch twice or restart the game to make it work.

Physics issues in Max Payne start somewhere above 144 FPS. Curiously, it ignores whatever I set in Framerate limit. The same goes for whatever is set in Radeon Chill. You can also unlock FPS completely, by setting Radeon Enhanced Sync, but it might cause stuttering if FPS fluctuates too much (and mentioned physics issues), plus if you push OpenALSoft settings for DSOAL too much, the sound might occasionally stutter.

Latest 1.12.0 d3d8to9 used, with also Reshade 2.0 as d3d9.dll, although the app is rather still falsely reported as d3d8 in RivaTuner's OSD.

@elishacloud
Copy link
Contributor

elishacloud commented Sep 18, 2024

@deton24, you can also use dxwrapper with the below settings. This will force vsync to be disabled and you can set the FPS limit speed.

D3d8to9                    = 1
EnableVSync                = 0
ForceVsyncMode             = 1
LimitPerFrameFPS           = 119.88

@deton24
Copy link
Author

deton24 commented Sep 19, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants