From e536b02248f370971716b744968776f6880528be Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sun, 22 Dec 2024 17:12:09 +0100 Subject: Renderer: rewrite render scheduling (#8683) This rewrites renderer scheduling. Occlusion is now unified in a new Pass type. --- src/protocols/core/Compositor.cpp | 7 +++++-- src/protocols/core/Compositor.hpp | 2 +- src/protocols/core/DataDevice.cpp | 7 ++++++- 3 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src/protocols') diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp index 89f2a4cb..ee1e6224 100644 --- a/src/protocols/core/Compositor.cpp +++ b/src/protocols/core/Compositor.cpp @@ -522,11 +522,14 @@ void CWLSurfaceResource::updateCursorShm(CRegion damage) { } } -void CWLSurfaceResource::presentFeedback(timespec* when, PHLMONITOR pMonitor) { +void CWLSurfaceResource::presentFeedback(timespec* when, PHLMONITOR pMonitor, bool discarded) { frame(when); auto FEEDBACK = makeShared(self.lock()); FEEDBACK->attachMonitor(pMonitor); - FEEDBACK->presented(); + if (discarded) + FEEDBACK->discarded(); + else + FEEDBACK->presented(); PROTO::presentation->queueData(FEEDBACK); if (!pMonitor || !pMonitor->outTimeline || !syncobj) diff --git a/src/protocols/core/Compositor.hpp b/src/protocols/core/Compositor.hpp index c036041a..2a6f96f6 100644 --- a/src/protocols/core/Compositor.hpp +++ b/src/protocols/core/Compositor.hpp @@ -124,7 +124,7 @@ class CWLSurfaceResource { void breadthfirst(std::function, const Vector2D&, void*)> fn, void* data); CRegion accumulateCurrentBufferDamage(); - void presentFeedback(timespec* when, PHLMONITOR pMonitor); + void presentFeedback(timespec* when, PHLMONITOR pMonitor, bool discarded = false); void lockPendingState(); void unlockPendingState(); diff --git a/src/protocols/core/DataDevice.cpp b/src/protocols/core/DataDevice.cpp index b4bb8b00..9fc49a44 100644 --- a/src/protocols/core/DataDevice.cpp +++ b/src/protocols/core/DataDevice.cpp @@ -4,6 +4,7 @@ #include "../../managers/PointerManager.hpp" #include "../../managers/eventLoop/EventLoopManager.hpp" #include "../../Compositor.hpp" +#include "../../render/pass/TexPassElement.hpp" #include "Seat.hpp" #include "Compositor.hpp" #include "../../xwayland/XWayland.hpp" @@ -794,7 +795,11 @@ void CWLDataDeviceProtocol::renderDND(PHLMONITOR pMonitor, timespec* when) { const auto POS = g_pInputManager->getMouseCoordsInternal(); CBox box = CBox{POS, dnd.dndSurface->current.size}.translate(-pMonitor->vecPosition + g_pPointerManager->cursorSizeLogical() / 2.F).scale(pMonitor->scale); - g_pHyprOpenGL->renderTexture(dnd.dndSurface->current.texture, &box, 1.F); + + CTexPassElement::SRenderData data; + data.tex = dnd.dndSurface->current.texture; + data.box = box; + g_pHyprRenderer->m_sRenderPass.add(makeShared(data)); box = CBox{POS, dnd.dndSurface->current.size}.translate(g_pPointerManager->cursorSizeLogical() / 2.F).expand(5); g_pHyprRenderer->damageBox(&box); -- cgit v1.2.3