0

What can cause IDXGISwapChain2's frame latency waitable to timeout?

I'm trying to implement this recommendation from Microsoft: Reduce latency with DXGI 1.3 swap chains, but this code here from the article:

  DWORD result = WaitForSingleObjectEx(
        m_frameLatencyWaitableObject,
        1000, // 1 second timeout (shouldn't ever occur)
        true
        );

sometimes (not always) returns WAIT_TIMEOUT although the article says it shouldn't ever occur. I probably do something I shouldn't, but what can cause this waitable to timeout?

  • Maybe you are recreating swap chain and `frameLatencyWaitableObject` is not a current object anymore? – user7860670 Oct 17 '19 at 18:22
  • I think the comment should read "should not occur under normal conditions". If the system is heavily loaded, such as with 100% CPU utilization or intensive swap file activity w/ low free memory conditions, this particular waiting thread might get its execution time delayed for a second. – Roman R. Oct 18 '19 at 06:44
  • I've checked and the waitable is still valid (I don't recreate the swapchain, I just resize buffers when the window is resized). And, no, the system (cpu, gpu, memory) is not under heavy load at all. – Jean-René Friton Oct 19 '19 at 06:43
  • Is this during resize of buffers? – Roman R. Oct 20 '19 at 14:47
  • @RomanR - not particularly. Actually, I'm wondering if the waitable doesn't require the Present (or Present1) to be called before. I though the waitable was like a timer, but it may just wait on the swapchain Present call... – Jean-René Friton Oct 23 '19 at 08:50

0 Answers0