2
\$\begingroup\$

It appears that some drivers implement a "flip queue" such that, even with vsync enabled, the first few calls to swap buffers return immediately (queuing those frames for later use). It is only after this queue is filled that buffer swaps will block to synchronize with vblank.

This behavior is detrimental to my application. It creates latency. Does anyone know of a way to disable it or a workaround for dealing with it?

The OpenGL Wiki on Swap Interval suggests a call to glFinish after the swap but I've had no such luck with that trick.

\$\endgroup\$
3
  • \$\begingroup\$ The purpose of buffers is to prevent flickering. If there was no buffer, you would see each object as it was being drawn. \$\endgroup\$
    – Lysol
    Jan 29 '14 at 0:52
  • \$\begingroup\$ Yes, buffers prevent flickering, but more than a single back buffer is unnecessary to do this. The question is about this "triple" or more buffering, which adds latency. \$\endgroup\$
    – user41442
    Jan 29 '14 at 5:39
  • \$\begingroup\$ @AidanMueller: I'm not referring to double/triple buffering. I'm referring to a queue beyond these buffers. A queue that feeds the back buffer. Many drivers implement this queue with no means to disable it. \$\endgroup\$
    – user41500
    Jan 29 '14 at 18:37
1
\$\begingroup\$

The "flip queue" that feeds the back buffer is nowadays closely tied to double/triple buffering, as there are almost no implementations that copy the back buffer into the front buffer anymore.

You may be setting the swap interval to 1; try setting it to 0, instead. This will disable vsync, but should improve your latency measurements. Ways of reducing latency are highly driver-specific, and you should check the manufacturer site for OpenGL optimization guides/best practices, or something similar.

Most graphics drivers have terrible latency, and coupled with latencies in displays, users generally experience input lag on the order of ~100 ms. By the way, this is what allows cloud gaming services to work, as users are so used to this latency that they won't notice a 70 ms round-trip to a server that is rendering the frames.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.