-
Notifications
You must be signed in to change notification settings - Fork 266
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
Implement D3D waitable and tearable swapchains #485
base: master
Are you sure you want to change the base?
Conversation
I've expanded on this PR a bit further because I wanted to implement waitable swapchains which changes the flow a bit (recreating the swapchain). |
I'm a bit torn on this one (pun intended 😄 ) -- I think the direction is reasonable but the details might need some tweaking.
|
Is the suggestion to have tearing always turned on because Veldrid can do whatever it wants? I have two concerns here:
I'd need to dig deeper to see what causes (2), but if my interpretation of your suggestion is accurate then I'm willing to see if I can get anywhere.
Sounds good. How would you expose the fence? Another method like
Agree. |
We're going to continue working on this to our/our users' expectations, resolving issues as we go, and keep this PR updated as things are changed around to fit that. |
Perhaps to be seen as required for #484 since Microsoft recommend this while using the flip model.
This PR implements two things:
GraphicsDevice.AllowTearing
, which only has an effect when VSync is disabled. In combination with the flip model, this allows frames to be pushed to the GPU as fast as possible and results in the lowest frame latency possible. It's akin to the OpenGL-esque "exclusive fullscreen" model of presentation.GraphicsDevice.WaitForNextFrameReady()
. This can be placed at the very start of the draw procedure causing it to wait until the GPU is ready to begin rendering the next frame. As documented here, this doesn't come with the overhead of an additional frame of latency that VSync does.Input lag testing (PresentMon/CapFrameX):
AllowTearing
WaitForNextFrameReady()
One thing to note is that in this PR I've reduced the maximum frame latency to 1, which is not always advisable and is usually a user-controlled value. This value is based on our own requirements so I'm wondering how to expose it in a more general way way from Veldrid.