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

Limit frame rate to display refresh #4056

Merged
merged 6 commits into from
Jun 11, 2024
Merged

Limit frame rate to display refresh #4056

merged 6 commits into from
Jun 11, 2024

Conversation

doitsujin
Copy link
Owner

@doitsujin doitsujin commented Jun 6, 2024

We cannot perform mode switches in non-Windows environments, but we still report display modes with lower refresh rates to the application. In some cases, this leads to bugs since games that have a built-in FPS limiter can reasonably assume that a 60 Hz display mode with Vsync enabled will also cap the frame rate at 60.

This implements a heuristic that measures the current frame rate, and if significantly higher than the target refresh rate, engages the FPS limiter after a few frames.

Existing configuration options as well as DXVK_FRAME_RATE will always take precedence, and setting the config to -1 unconditionally disables the limiter.

Might need some testing since some specific games might be a bit on the dumb side and default to something like 24 Hz for no reason at all with no way to change it in game (Crysis 1?).

@Blisto91
Copy link
Contributor

Blisto91 commented Jun 6, 2024

Existing configuration options as well as DXVK_FRAME_RATE will always take precedence, and setting the config to -1 unconditionally disables the limiter.

If the env var works with -1 too now then remember to update the readme

@doitsujin doitsujin merged commit 51f2e24 into master Jun 11, 2024
8 checks passed
@doitsujin doitsujin deleted the limit-refresh-rate branch October 23, 2024 15:52
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

Successfully merging this pull request may close these issues.

2 participants