fix dt issues

This commit is contained in:
Vaxry 2024-06-25 18:23:27 +02:00
parent 24d8e2cfe3
commit c49ab9e9f3

View file

@ -2601,7 +2601,9 @@ bool CHyprRenderer::beginRender(CMonitor* pMonitor, CRegion& damage, eRenderMode
return true; return true;
} }
int bufferAge = 0; /* This is a constant expression, as we always use double-buffering in our swapchain
TODO: Rewrite the CDamageRing to take advantage of that maybe? It's made to support longer swapchains atm because we used to do wlroots */
static constexpr const int HL_BUFFER_AGE = 2;
if (!buffer) { if (!buffer) {
Aquamarine::SSwapchainOptions opts = pMonitor->output->swapchain->currentOptions(); Aquamarine::SSwapchainOptions opts = pMonitor->output->swapchain->currentOptions();
@ -2613,7 +2615,7 @@ bool CHyprRenderer::beginRender(CMonitor* pMonitor, CRegion& damage, eRenderMode
return false; return false;
} }
m_pCurrentBuffer = pMonitor->output->swapchain->next(&bufferAge); m_pCurrentBuffer = pMonitor->output->swapchain->next(nullptr);
if (!m_pCurrentBuffer) { if (!m_pCurrentBuffer) {
Debug::log(ERR, "Failed to acquire swapchain buffer for {}", pMonitor->szName); Debug::log(ERR, "Failed to acquire swapchain buffer for {}", pMonitor->szName);
return false; return false;
@ -2629,7 +2631,7 @@ bool CHyprRenderer::beginRender(CMonitor* pMonitor, CRegion& damage, eRenderMode
} }
if (mode == RENDER_MODE_NORMAL) { if (mode == RENDER_MODE_NORMAL) {
damage = pMonitor->damage.getBufferDamage(bufferAge); damage = pMonitor->damage.getBufferDamage(HL_BUFFER_AGE);
pMonitor->damage.rotate(); pMonitor->damage.rotate();
} }