This is an early WIP of the GLX backend. I go through that with a chainsaw
at the moment and hope for some feedback by people knowing all the history
about it and stop me before accidentally cutting off the branch we are
sitting on. ;)
- Make the code less convoluted.
- Sync paint with vblanks if extensions required for that are available
- Reduce delay by pushing paint to end of vblank cycle, see .
- Remove triple buffering. A compositor does not need this when it doesn't screw up in some other way.
- Remove vsync option. Always sync with vblanks.
- Replace GLX_MESA_, GLX_EXT_. and GLX_SGI_swap_control with GLX_OML_sync_control only, since this is the standard nowadays and we don't need to optimize for every legacy X device in the world.
- Remove blocksForRetrace, instead use the Intel swap event or glFinish to sync with vblank.
glFinish should block till vblank, see .(doesn't seem to be true per se, maybe driver dependent)
- In endRenderingFrame don't present a second time. Why was it there in the first place? -> Thanks to @fredrik's comments this is now clear: in beginRenderingFrame it's called if we don't block on retrace and if do block in endRenderingFrame and according to comment because damage gets reset in the later case it would be noop in beginRenderingFrame. Needs to get replaced though to make the code less complex.
- When swap events are available don't use the fallback timer.
- Delay timer reduces latency between paint and vsync
- Move present to endRenderingFrame to have less than one frame of latency.
- For now perform compositing always from event loop. Without it Wayland session crashes. Probably otherwise hidden issue in Effects.
- Cleanup: Remove more plumbing for vsync and retrace blocking and swap-profiler
- Is glFinish really blocking till vblank? X Present extension provides events to get notified about vblank, but since we channel through GLX this is not available directly to my knowledge. So it's kind of weird that there is only the Intel swap event to wrap that behavior explicitly.
- Compositor has a compositing timer. It seems we always wait for it, but if we sync with vblank there is no reason to do it this way. Instead only use is as a fallback in case sync with vblank is not supported?