Talk:Swap Interval

From OpenGL Wiki
Revision as of 19:47, 11 September 2011 by X-Fi6 (talk | contribs)
Jump to: navigation, search

vsync with glFinish

I'm concerned about the accuracy of this statement:

On Windows, apart from rendering the picture at least twice as fast as the monitor's refresh rate (per the rules of the Sampling Theorem), SwapBuffers() combined with glFinish() is the only method supported on modern hardware to perfectly achieve vertical synchronization (vsync).

I have never seen this stated anywhere. I am not aware of any reason for a SwapBuffers operation to have to be followed by glFinish in order to vsync. The point of swap interval is to not have to do anything special (other than specifying the swap interval) to get vsync support. Do you have some source for this information? Alfonse 02:09, 11 September 2011 (PDT)

  • Yeah, check the previous revision! (Although that in itself may not be reliable.) X-Fi6 02:46, 11 September 2011 (PDT)
The only reference made to glFinish previously was simply describing its behavior. The point of vsync-ing is not to force the CPU to wait for the GPU to finish rendering. It is to force the GPU to not swap the framebuffers unless a vblank is going on. Whether that makes SwapBuffers operations asynchronous to the CPU or not is irrelevant; what matters is that it eliminates tearing (seeing half of one frame and half of another). Nothing on this page said that using glFinish was necessary to "perfectly achieve vertical synchronization". Alfonse 04:35, 11 September 2011 (PDT)
Alright, it's sort of a double whammy. A modern compositor like Aero or Compiz should already take care of not drawing to the screen until the window's client area is completely drawn. But I suppose that was SwapBuffers's original intent. CPU<->V-blank synchronization is a nice optional benefit. (Although again, to qualify for "perfect vertical synchronization", this synchronization does help.) X-Fi6 12:47, 11 September 2011 (PDT)