title: OpenGL SwapBuffers() latency on Windows 10
body: <p>I'm writing hardware decoding software that takes a stream of a Desktop over the network and displays it in an OpenGL window. I need the total stream latency to be as close to real time as possible. To measure the latency, I have a stopwatch running on the source Desktop and then use a camera to take a picture of the source and the application together. The end-to-end latency ends up being the difference in timer reading from the source to the application.</p>
  <p>As of now, I have a end-to-end latency of around 83-100ms. And I'm fairly confident the latency from [Encoding &gt; Network &gt; Decoding &gt; OpenGL's SwapBuffers() in the application] is taking around 50ms. This leaves me with ~33ms of latency unaccounted for.</p>
  <p>So why does it seem that SwapBuffers() is taking 33ms (2 frames) to finally show on the screen? Is this just how long OpenGL takes? I was under the impression SwapBuffers() would take one frame cycle at most to finish the swap. Are there settings I can look into that would make this faster? I have Vsync turned off in the GPU settings and have set <code>wglSwapInterval(0)</code></p>