Skip to content

Commit

Permalink
opengl: fix crash on null fb stencil op
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Jan 8, 2025
1 parent b320bc2 commit 983bc06
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/render/OpenGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,6 @@ void CHyprOpenGLImpl::begin(PHLMONITOR pMonitor, const CRegion& damage_, CFrameb
m_RenderData.pCurrentMonData->offloadFB.addStencil(m_RenderData.pCurrentMonData->stencilTex);
m_RenderData.pCurrentMonData->mirrorFB.addStencil(m_RenderData.pCurrentMonData->stencilTex);
m_RenderData.pCurrentMonData->mirrorSwapFB.addStencil(m_RenderData.pCurrentMonData->stencilTex);
m_RenderData.pCurrentMonData->offMainFB.addStencil(m_RenderData.pCurrentMonData->stencilTex);
}

if (m_RenderData.pCurrentMonData->monitorMirrorFB.isAllocated() && m_RenderData.pMonitor->mirrors.empty())
Expand Down Expand Up @@ -2886,9 +2885,13 @@ void CHyprOpenGLImpl::restoreMatrix() {
}

void CHyprOpenGLImpl::bindOffMain() {
if (!m_RenderData.pCurrentMonData->offMainFB.isAllocated())
if (!m_RenderData.pCurrentMonData->offMainFB.isAllocated()) {
m_RenderData.pCurrentMonData->offMainFB.alloc(m_RenderData.pMonitor->vecPixelSize.x, m_RenderData.pMonitor->vecPixelSize.y,
m_RenderData.pMonitor->output->state->state().drmFormat);

m_RenderData.pCurrentMonData->offMainFB.addStencil(m_RenderData.pCurrentMonData->stencilTex);
}

m_RenderData.pCurrentMonData->offMainFB.bind();
clear(CHyprColor(0, 0, 0, 0));
m_RenderData.currentFB = &m_RenderData.pCurrentMonData->offMainFB;
Expand Down

0 comments on commit 983bc06

Please sign in to comment.