OpenGL Wiki tells something interesting regarding GPU/CPU synchronization in the last paragraph of the Swap Interval topic page:
If GPU<->CPU synchronization is desired, you should use a high-precision/multimedia timer rather than glFinish after a buffer swap.
glFinish()
or glFenceSync()
based approaches aren't working well, as suggested by the quoted text. I believe that those high-precision / multimedia timers are not part of the OpenGL Specification. So:
Does anyone know how to use high-precision/multimedia timers in order to call some CPU code (perhaps grab a timestamp) immediately after the buffer swap on a V-Synched display?
I target a solution written in C++ and compiled on Linux, but any library name, code bits or intuition would greatly help!