summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-05-10 18:31:26 +0100
committerGitHub <noreply@github.com>2025-05-10 19:31:26 +0200
commitf58bb72d3a300dc482e9dc934101790c8707667d (patch)
tree8d05540c2dfa630241e016978437bf62023a7eee /src/render/OpenGL.cpp
parent60cd5b7a48af4a23717201d70395161a3bb4ab24 (diff)
renderer: render blur on fade out (#10356)
Diffstat (limited to 'src/render/OpenGL.cpp')
-rw-r--r--src/render/OpenGL.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 9cbf091b..19d03fef 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -1813,13 +1813,16 @@ void CHyprOpenGLImpl::renderTextureMatte(SP<CTexture> tex, const CBox& box, CFra
//
// 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");
+ return blurFramebufferWithDamage(a, originalDamage, *m_renderData.currentFB);
+}
+
+CFramebuffer* CHyprOpenGLImpl::blurFramebufferWithDamage(float a, CRegion* originalDamage, CFramebuffer& source) {
+ TRACY_GPU_ZONE("RenderBlurFramebufferWithDamage");
const auto BLENDBEFORE = m_blend;
blend(false);
@@ -1859,7 +1862,7 @@ CFramebuffer* CHyprOpenGLImpl::blurMainFramebufferWithDamage(float a, CRegion* o
glActiveTexture(GL_TEXTURE0);
- auto currentTex = m_renderData.currentFB->getTexture();
+ auto currentTex = source.getTexture();
glBindTexture(currentTex->m_target, currentTex->m_texID);
@@ -2226,7 +2229,7 @@ void CHyprOpenGLImpl::renderTextureWithBlur(SP<CTexture> tex, const CBox& box, f
// amazing hack: the surface has an opaque region!
CRegion inverseOpaque;
- if (a >= 1.f && std::round(pSurface->m_current.size.x * m_renderData.pMonitor->m_scale) == box.w &&
+ if (a >= 1.f && pSurface && std::round(pSurface->m_current.size.x * m_renderData.pMonitor->m_scale) == box.w &&
std::round(pSurface->m_current.size.y * m_renderData.pMonitor->m_scale) == box.h) {
pixman_box32_t surfbox = {0, 0, pSurface->m_current.size.x * pSurface->m_current.scale, pSurface->m_current.size.y * pSurface->m_current.scale};
inverseOpaque = pSurface->m_current.opaque;
@@ -2249,7 +2252,6 @@ void CHyprOpenGLImpl::renderTextureWithBlur(SP<CTexture> tex, const CBox& box, f
inverseOpaque.translate(box.pos());
m_renderData.renderModif.applyToRegion(inverseOpaque);
inverseOpaque.intersect(texDamage);
-
POUTFB = blurMainFramebufferWithDamage(a, &inverseOpaque);
} else
POUTFB = &m_renderData.pCurrentMonData->blurFB;