mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-21 15:03:50 -07:00
screencopy: attempt binding framebuffer before gathering format
This commit is contained in:
@@ -211,6 +211,18 @@ void CScreencopyProtocolManager::captureOutput(wl_client* client, wl_resource* r
|
||||
PCLIENT->ref++;
|
||||
|
||||
g_pHyprRenderer->makeEGLCurrent();
|
||||
|
||||
if (g_pHyprOpenGL->m_mMonitorRenderResources.contains(PFRAME->pMonitor)) {
|
||||
const auto RDATA = g_pHyprOpenGL->m_mMonitorRenderResources.at(PFRAME->pMonitor);
|
||||
// bind the fb for its format. Suppress gl errors.
|
||||
#ifndef GLES2
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, RDATA.offloadFB.m_iFb);
|
||||
#else
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, RDATA.offloadFB.m_iFb);
|
||||
#endif
|
||||
} else
|
||||
Debug::log(ERR, "No RDATA in screencopy???");
|
||||
|
||||
PFRAME->shmFormat = g_pHyprOpenGL->getPreferredReadFormat(PFRAME->pMonitor);
|
||||
if (PFRAME->shmFormat == DRM_FORMAT_INVALID) {
|
||||
Debug::log(ERR, "No format supported by renderer in capture output");
|
||||
|
Reference in New Issue
Block a user