mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 08:05:58 +01:00
renderer: fixup damage_ring rotation
This commit is contained in:
parent
fe9c8d8745
commit
d62e7a5125
2 changed files with 20 additions and 13 deletions
|
@ -1098,14 +1098,14 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
||||||
if (UNLOCK_SC)
|
if (UNLOCK_SC)
|
||||||
wlr_output_lock_software_cursors(pMonitor->output, true);
|
wlr_output_lock_software_cursors(pMonitor->output, true);
|
||||||
|
|
||||||
if (pMonitor->forceFullFrames > 0) {
|
|
||||||
pMonitor->forceFullFrames -= 1;
|
|
||||||
if (pMonitor->forceFullFrames > 10)
|
|
||||||
pMonitor->forceFullFrames = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
pMonitor->renderingActive = true;
|
pMonitor->renderingActive = true;
|
||||||
|
|
||||||
|
// we need to cleanup fading out when rendering the appropriate context
|
||||||
|
g_pCompositor->cleanupFadingOut(pMonitor->ID);
|
||||||
|
|
||||||
|
// TODO: this is getting called with extents being 0,0,0,0 should it be?
|
||||||
|
// potentially can save on resources.
|
||||||
|
|
||||||
TRACY_GPU_ZONE("Render");
|
TRACY_GPU_ZONE("Render");
|
||||||
|
|
||||||
if (pMonitor == g_pCompositor->getMonitorFromCursor())
|
if (pMonitor == g_pCompositor->getMonitorFromCursor())
|
||||||
|
@ -1120,7 +1120,6 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
||||||
}
|
}
|
||||||
|
|
||||||
CRegion damage;
|
CRegion damage;
|
||||||
|
|
||||||
if (!beginRender(pMonitor, damage, RENDER_MODE_NORMAL)) {
|
if (!beginRender(pMonitor, damage, RENDER_MODE_NORMAL)) {
|
||||||
Debug::log(ERR, "renderer: couldn't beginRender()!");
|
Debug::log(ERR, "renderer: couldn't beginRender()!");
|
||||||
|
|
||||||
|
@ -1132,11 +1131,6 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wlr_damage_ring_rotate_buffer(&pMonitor->damage, m_pCurrentWlrBuffer, damage.pixman());
|
|
||||||
|
|
||||||
// we need to cleanup fading out when rendering the appropriate context
|
|
||||||
g_pCompositor->cleanupFadingOut(pMonitor->ID);
|
|
||||||
|
|
||||||
// if we have no tracking or full tracking, invalidate the entire monitor
|
// if we have no tracking or full tracking, invalidate the entire monitor
|
||||||
if (**PDAMAGETRACKINGMODE == DAMAGE_TRACKING_NONE || **PDAMAGETRACKINGMODE == DAMAGE_TRACKING_MONITOR || pMonitor->forceFullFrames > 0 || damageBlinkCleanup > 0 ||
|
if (**PDAMAGETRACKINGMODE == DAMAGE_TRACKING_NONE || **PDAMAGETRACKINGMODE == DAMAGE_TRACKING_MONITOR || pMonitor->forceFullFrames > 0 || damageBlinkCleanup > 0 ||
|
||||||
pMonitor->isMirror() /* why??? */) {
|
pMonitor->isMirror() /* why??? */) {
|
||||||
|
@ -1165,9 +1159,15 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// apply modified damage to render pass
|
// update damage in renderdata as we modified it
|
||||||
g_pHyprOpenGL->m_RenderData.damage.set(damage);
|
g_pHyprOpenGL->m_RenderData.damage.set(damage);
|
||||||
|
|
||||||
|
if (pMonitor->forceFullFrames > 0) {
|
||||||
|
pMonitor->forceFullFrames -= 1;
|
||||||
|
if (pMonitor->forceFullFrames > 10)
|
||||||
|
pMonitor->forceFullFrames = 0;
|
||||||
|
}
|
||||||
|
|
||||||
EMIT_HOOK_EVENT("render", RENDER_BEGIN);
|
EMIT_HOOK_EVENT("render", RENDER_BEGIN);
|
||||||
|
|
||||||
bool renderCursor = true;
|
bool renderCursor = true;
|
||||||
|
@ -1258,6 +1258,8 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
||||||
if (UNLOCK_SC)
|
if (UNLOCK_SC)
|
||||||
wlr_output_lock_software_cursors(pMonitor->output, false);
|
wlr_output_lock_software_cursors(pMonitor->output, false);
|
||||||
|
|
||||||
|
damageMonitor(pMonitor);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2484,6 +2486,9 @@ bool CHyprRenderer::beginRender(CMonitor* pMonitor, CRegion& damage, eRenderMode
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mode == RENDER_MODE_NORMAL)
|
||||||
|
wlr_damage_ring_rotate_buffer(&pMonitor->damage, m_pCurrentWlrBuffer, damage.pixman());
|
||||||
|
|
||||||
m_pCurrentRenderbuffer->bind();
|
m_pCurrentRenderbuffer->bind();
|
||||||
g_pHyprOpenGL->begin(pMonitor, &damage);
|
g_pHyprOpenGL->begin(pMonitor, &damage);
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,8 @@ class CHyprRenderer {
|
||||||
void makeEGLCurrent();
|
void makeEGLCurrent();
|
||||||
void unsetEGL();
|
void unsetEGL();
|
||||||
|
|
||||||
|
// if RENDER_MODE_NORMAL, provided damage will be written to.
|
||||||
|
// otherwise, it will be the one used.
|
||||||
bool beginRender(CMonitor* pMonitor, CRegion& damage, eRenderMode mode = RENDER_MODE_NORMAL, wlr_buffer* buffer = nullptr, CFramebuffer* fb = nullptr);
|
bool beginRender(CMonitor* pMonitor, CRegion& damage, eRenderMode mode = RENDER_MODE_NORMAL, wlr_buffer* buffer = nullptr, CFramebuffer* fb = nullptr);
|
||||||
void endRender();
|
void endRender();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue