Skip to content

kwinglutils: Clean up signaled persistent vbo fences at the start of the frame

With a persistent vbo, kwin will allocate one big enough buffer and allocate memory out of it.

In order to prevent overwriting vertex buffer data that is currently being accessed by the GPU, fences are inserted at the end of frame.

The signaled fences are destroyed after the buffer swap operation, which seems a bit odd because the just inserted fence most likely won't be signaled. Perhaps it's a historical artifact?

This change rearranges fence cleanup so it's performed right before starting a new frame. With it, kwin will most likely re-use the previously used memory chunk because there will be plenty of time for the fence to become signaled.

Another motivation behind this change is to make refactoring SceneOpenGL code easier. As is, m_backend->endFrame() is wrapped in GLVertexBuffer::endOfFrame() and GLVertexBuffer::framePosted(). With that, the Compositor can't call m_backend->endFrame(), which can be desired for cleaning up render backend abstractions.

Edited by Vlad Zahorodnii

Merge request reports