summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2025-01-23 22:41:46 +0000
committerVaxry <vaxry@vaxry.net>2025-01-23 22:41:46 +0000
commitdadb2e0949e61d43ace69c5ae65358c6c38e32b4 (patch)
tree27e274ab950de0d33bd6568e7446791634290c90 /src/render/OpenGL.cpp
parenta8c2d5a616b2ac9c0cf66a0bc999ae57338b60d9 (diff)
opengl: use uv to avoid rendering the entire blurbox
additionally can use smoothing for rounding fixes #9086
Diffstat (limited to 'src/render/OpenGL.cpp')
-rw-r--r--src/render/OpenGL.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 8ae667d2..0fe9565f 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -1547,11 +1547,10 @@ void CHyprOpenGLImpl::renderTextureInternalWithDamage(SP<CTexture> tex, CBox* pB
glVertexAttribPointer(shader->posAttrib, 2, GL_FLOAT, GL_FALSE, 0, fullVerts);
- if (allowCustomUV && m_RenderData.primarySurfaceUVTopLeft != Vector2D(-1, -1)) {
+ if (allowCustomUV && m_RenderData.primarySurfaceUVTopLeft != Vector2D(-1, -1))
glVertexAttribPointer(shader->texAttrib, 2, GL_FLOAT, GL_FALSE, 0, verts);
- } else {
+ else
glVertexAttribPointer(shader->texAttrib, 2, GL_FLOAT, GL_FALSE, 0, fullVerts);
- }
glEnableVertexAttribArray(shader->posAttrib);
glEnableVertexAttribArray(shader->texAttrib);
@@ -2156,15 +2155,25 @@ void CHyprOpenGLImpl::renderTextureWithBlur(SP<CTexture> tex, CBox* pBox, float
// stencil done. Render everything.
CBox MONITORBOX = {0, 0, m_RenderData.pMonitor->vecTransformedSize.x, m_RenderData.pMonitor->vecTransformedSize.y};
// render our great blurred FB
+ // calculate the uv for it
+ const auto LASTTL = m_RenderData.primarySurfaceUVTopLeft;
+ const auto LASTBR = m_RenderData.primarySurfaceUVBottomRight;
+
+ m_RenderData.primarySurfaceUVTopLeft = pBox->pos() / MONITORBOX.size();
+ m_RenderData.primarySurfaceUVBottomRight = (pBox->pos() + pBox->size()) / MONITORBOX.size();
+
static auto PBLURIGNOREOPACITY = CConfigValue<Hyprlang::INT>("decoration:blur:ignore_opacity");
setMonitorTransformEnabled(true);
if (!USENEWOPTIMIZE)
setRenderModifEnabled(false);
- renderTextureInternalWithDamage(POUTFB->getTexture(), &MONITORBOX, (*PBLURIGNOREOPACITY ? blurA : a * blurA) * overallA, texDamage, 0, 2.0f, false, false, false);
+ renderTextureInternalWithDamage(POUTFB->getTexture(), pBox, (*PBLURIGNOREOPACITY ? blurA : a * blurA) * overallA, texDamage, round, roundingPower, false, false, true);
if (!USENEWOPTIMIZE)
setRenderModifEnabled(true);
setMonitorTransformEnabled(false);
+ m_RenderData.primarySurfaceUVTopLeft = LASTTL;
+ m_RenderData.primarySurfaceUVBottomRight = LASTBR;
+
// render the window, but clear stencil
glClearStencil(0);
glClear(GL_STENCIL_BUFFER_BIT);