As explained at Optimizing DirectX apps for low latency input..., the use of DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT can make the application more responsive. I have a couple of questions on this:
Thanks
The call to Present (or Present1) is non-blocking and returns pretty quickly. It just indicates to the API that you are done with the frame and are ready to show the frame buffer. In order to keep the CPU from getting too far ahead of the GPU, Windows by default will block on the Present once 3 frames are queued up. This normally will smooth out in apps at some steady-rate, but this additional latency can be a real problem for touch-based UI applications.
CoreWindow APIs are only usable for WinRT-based platforms like UWP for Windows 10, Windows Store, Windows phone 8, and Xbox one. They are not usable for Windows desktop apps.
What you can do in a Windows desktop app is use the DXGI_PRESENT_DO_NOT_WAIT flag and if the Present returns a failure code of DXGI_PRESENT_DO_NOT_WAIT your applications knows that it's got a number of frames queued up. You could do other work to wait a bit, throttle your content, or do other clever things with this but most games just run 'flat out' and let the game block if it's rendering too fast.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With