Renderer: rewrite render scheduling (#8683)

This rewrites renderer scheduling. Occlusion is now unified in a new Pass type.
This commit is contained in:
Vaxry 2024-12-22 17:12:09 +01:00 committed by GitHub
parent 1cc1a46c2e
commit e536b02248
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 1576 additions and 775 deletions

View file

@ -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<CQueuedPresentationData>(self.lock());
FEEDBACK->attachMonitor(pMonitor);
FEEDBACK->presented();
if (discarded)
FEEDBACK->discarded();
else
FEEDBACK->presented();
PROTO::presentation->queueData(FEEDBACK);
if (!pMonitor || !pMonitor->outTimeline || !syncobj)

View file

@ -124,7 +124,7 @@ class CWLSurfaceResource {
void breadthfirst(std::function<void(SP<CWLSurfaceResource>, 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();

View file

@ -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<CTexPassElement>(data));
box = CBox{POS, dnd.dndSurface->current.size}.translate(g_pPointerManager->cursorSizeLogical() / 2.F).expand(5);
g_pHyprRenderer->damageBox(&box);