picom/src/backend/gl
Yuxuan Shui 86d3739374
core: frame pacing
Use frame timing and render time statistic to pace frames.

Right now the criteria are simple:

* Don't render multiple frames in one vblank cycle. Otherwise the
  rendered frame will be delay multiple cycles, which isn't ideal.
* Start rendering as late as possible while still hitting vblank.

Refresh rate is estimated from a rolling average of frame timing. Render
time is predicted from the rolling maximum of past 128 frames. The
window size still needs to be investigated.

Remove glFinish calls and GL_MaxFramesAllowed=1, frame pacing superseeds
them.

Professionals might laugh at how rudimentary this is, but hopefully this
is better than what we had before. Which is absolutely nothing at all.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-06-08 20:35:24 +01:00
..
blur.c options: add dithered-present option 2022-11-30 05:33:21 +00:00
egl.c core: frame pacing 2023-06-08 20:35:24 +01:00
egl.h backends: add egl backend 2022-09-29 08:03:12 +01:00
gl_common.c core: frame pacing 2023-06-08 20:35:24 +01:00
gl_common.h backend: add last_render_time interface. 2023-06-08 20:35:23 +01:00
glx.c core: frame pacing 2023-06-08 20:35:24 +01:00
glx.h backend: add new optional API: device_status 2022-02-08 10:31:41 +00:00
shaders.c glx: calculate residual in both directions 2023-05-08 15:01:50 +01:00