Skip to content

Commit

Permalink
renderer: safeguard against non-sampleable currentFB in blurMainFb
Browse files Browse the repository at this point in the history
fixes #8325
  • Loading branch information
vaxerski committed Nov 3, 2024
1 parent 5833abb commit 180c26a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/render/Framebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,18 @@ void CFramebuffer::bind() {
}

void CFramebuffer::release() {
if (!m_iFbAllocated && !m_cTex)
return;

Debug::log(TRACE, "fb {} released", m_iFb);

if (m_iFbAllocated)
glDeleteFramebuffers(1, &m_iFb);

m_cTex.reset();
m_iFbAllocated = false;
m_vSize = Vector2D();
m_iFb = 0;
}

CFramebuffer::~CFramebuffer() {
Expand Down
5 changes: 5 additions & 0 deletions src/render/OpenGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,11 @@ void CHyprOpenGLImpl::renderTextureMatte(SP<CTexture> tex, CBox* pBox, CFramebuf
// Dual (or more) kawase blur
CFramebuffer* CHyprOpenGLImpl::blurMainFramebufferWithDamage(float a, CRegion* originalDamage) {

if (!m_RenderData.currentFB->getTexture()) {
Debug::log(ERR, "BUG THIS: null fb texture while attempting to blur main fb?! (introspection off?!)");
return &m_RenderData.pCurrentMonData->mirrorFB; // return something to sample from at least
}

TRACY_GPU_ZONE("RenderBlurMainFramebufferWithDamage");

const auto BLENDBEFORE = m_bBlend;
Expand Down

0 comments on commit 180c26a

Please sign in to comment.