From cdef97ca2c12475517935b2da2f5b313211a98b6 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Mon, 18 Mar 2024 23:27:22 +0000 Subject: [PATCH] eee --- src/render/Renderbuffer.cpp | 9 +++++++-- src/render/Renderbuffer.hpp | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/render/Renderbuffer.cpp b/src/render/Renderbuffer.cpp index efb6015e..8935d83e 100644 --- a/src/render/Renderbuffer.cpp +++ b/src/render/Renderbuffer.cpp @@ -28,7 +28,8 @@ static int fdHandleWrite(int fd, uint32_t mask, void* data) { const auto RB = (CRenderbuffer*)data; - g_pFrameSchedulingManager->gpuDone(RB->m_pWlrBuffer); + if (RB->hasFence()) + g_pFrameSchedulingManager->gpuDone(RB->m_pWlrBuffer); RB->removeFence(); @@ -119,4 +120,8 @@ void CRenderbuffer::removeFence() { if (m_pFDWrite) wl_event_source_remove(m_pFDWrite); m_pFDWrite = nullptr; -} \ No newline at end of file +} + +bool CRenderbuffer::hasFence() { + return m_pFDWrite; +} diff --git a/src/render/Renderbuffer.hpp b/src/render/Renderbuffer.hpp index 5af85b7b..668a89a5 100644 --- a/src/render/Renderbuffer.hpp +++ b/src/render/Renderbuffer.hpp @@ -15,6 +15,7 @@ class CRenderbuffer { CFramebuffer* getFB(); void plantFence(); void removeFence(); + bool hasFence(); wlr_buffer* m_pWlrBuffer = nullptr;