IIRC, this is a common idiom. Here the glFinish will wait not only until all the rendering for the current frame is finished, but also until any downsample necessary for presenting the current frame has completed as well and for the frame to be presented. AFAIK with this, unless your rendering code is breaking frame, you can be reasonably sure that after this you’re at vblank.
If you don’t do the glFinish(), the GL driver may read on ahead grabbing GL commands for the next frame (or frames) even before you’ve presented this frame, and will block on random GL calls in some future frame when the pipeline fills. This leads to the CPU side getting fairly out-of-sync with the GPU side, which can cause problems.
I was wondering… so in this case, where I’ve managed to move most of my main work to a single thread/context, and the thread is for this one job, blocking the CPU to wait for the frame to complete does no harm?
Far as I know, should be fine. Been using it for quite a while. It’s about the only decent way to get good intraframe timing stats on the CPU in the GL thread. Otherwise you have the GL driver blocking things at random points, and not necessarily even for the frame to be displayed next.