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

Add FNA3D_REDUCED_FRAME_LATENCY support for D3D11 #194

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kg
Copy link
Contributor

@kg kg commented Jan 20, 2024

By default up to 3 frames can be queued for rendering, which increases rendering latency by default. In my testing reducing the queue length to 1 reduces windowed mode max display/render latency from 30ms/47ms to 20ms/30ms, and the average latency is improved further.

I made the name generic since it might be possible to do this for Vulkan too somehow. In my testing OpenGL already has ideal latency (much lower than D3D11 or Vulkan). Vulkan's windowed latency on my test configuration is the same as D3D11's, while OpenGL's is 16ms/16ms.

In my test scenario with this active, the maximum FPS (when vsync is off) goes down from 4000 to around 3300. I don't know if this would meaningfully negatively impact real games, but it seems like it would be really useful for games like Celeste.

Measurements from PresentMon.

@kg
Copy link
Contributor Author

kg commented Jan 21, 2024

For context I found some Unity games that appear to do this based on their D3D11 latency. Unreal Engine does this by default in specific cases, and has a configuration variable for it that defaults to 3. So I think it makes sense to keep this off by default if we add it.

@kg
Copy link
Contributor Author

kg commented Jan 22, 2024

We may also want to set swapchainDesc.BufferCount to 2 in reduced latency mode instead of the default of 3.

@kg
Copy link
Contributor Author

kg commented Jan 22, 2024

We may also want to set swapchainDesc.BufferCount to 2 in reduced latency mode instead of the default of 3.

Doing this reduces the latency to 13ms/24ms on my system.

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

Successfully merging this pull request may close these issues.

None yet

2 participants