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

[D3D11] Use FlipSequential instead of Discard on Win8+? #515

Open
RaZeR-RBI opened this issue Aug 25, 2023 · 3 comments
Open

[D3D11] Use FlipSequential instead of Discard on Win8+? #515

RaZeR-RBI opened this issue Aug 25, 2023 · 3 comments

Comments

@RaZeR-RBI
Copy link
Contributor

Greetings!
After a bit of testing of my project on Windows 10, I've noticed that I get increased frame latency while running in windowed mode on D3D11.
I've measured it through PresentMon CLI, which told me that the swapchain uses GPU GDI copy for compositing with latency before displaying (msUntilDisplayed) hovering around 45 ms.
After replacing SwapEffect.Discard with SwapEffect.FlipSequential for Win32SwapchainSource (so it's now just like the UWP one), latency dropped to 30 ms, so given my display refresh rate the net result is about one frame less latency.

I'm not much experienced with D3D (I've worked mostly with OpenGL), so I'm not aware of any shortcomings to this except that it's seem to be incompatible with Win7 according to docs (which is probably due to DWM changes between versions if I understand correctly).

The question is, can we add a Windows version check to D3D11Swapchain so it will use FlipSequential if running on Win8+ for better performance?

@RaZeR-RBI
Copy link
Contributor Author

I've just found out that there's a related pull request #484, though it doesn't contain a version check, so it'll break on Win7.

@peppy
Copy link
Contributor

peppy commented Aug 25, 2023

Of note, we fixed the breakage and are using it in production on our fork (see: ppy#25)

@smoogipoo maybe push this to #484 if it's a quick cherry pick?

@smoogipoo
Copy link
Contributor

It's a bit more than a cherry pick, but I've ported the fix to #484 .

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

3 participants