toplevel-export: commence render pass before reading

fixes #4070
This commit is contained in:
Vaxry 2023-12-07 17:58:13 +00:00
parent d9175a0181
commit aa020a2a1a

View file

@ -394,14 +394,16 @@ bool CToplevelExportProtocolManager::copyFrameShm(SScreencopyFrame* frame, times
return false; return false;
} }
g_pHyprOpenGL->m_RenderData.mainFB->bind(); g_pHyprRenderer->endRender();
g_pHyprRenderer->makeEGLCurrent();
outFB.bind();
glPixelStorei(GL_PACK_ALIGNMENT, 1); glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0, 0, frame->box.width, frame->box.height, PFORMAT->glFormat, PFORMAT->glType, data); glReadPixels(0, 0, frame->box.width, frame->box.height, PFORMAT->glFormat, PFORMAT->glType, data);
g_pHyprRenderer->endRender();
wlr_buffer_end_data_ptr_access(frame->buffer); wlr_buffer_end_data_ptr_access(frame->buffer);
if (frame->overlayCursor) if (frame->overlayCursor)