Commit 53473d72 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik Committed by Kai Uwe Broulik
Browse files

kwinglutils: Assert glFenceSync



This really should not fail unless we did something seriously wrong
on our end, such as changing GL context during paintScreen.

If we add an invalid `GLSync` to the queue it can lead to very hard
to debug crashes in seemingly unrelated parts of the rendering
process, when the queue is drained, potentially seconds after the
actual failure that occurred here.

Signed-off-by: default avatarEike Hein <eike.hein@mbition.io>
parent 2d56154f
Pipeline #138535 passed with stage
in 13 minutes and 49 seconds
......@@ -1755,6 +1755,7 @@ GLvoid *GLVertexBufferPrivate::getIdleRange(size_t size)
// Emit a fence now
BufferFence fence;
fence.sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
Q_ASSERT(fence.sync);
fence.nextEnd = bufferSize;
fences.emplace_back(fence);
}
......@@ -2045,6 +2046,7 @@ void GLVertexBuffer::endOfFrame()
} else {
BufferFence fence;
fence.sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
Q_ASSERT(fence.sync);
fence.nextEnd = d->nextOffset + d->bufferSize;
d->fences.emplace_back(fence);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment