renderer: Fix blur for passes set to 0. (#3181)

This commit is contained in:
Dickby 2023-09-05 16:33:40 +02:00 committed by GitHub
parent 2d100bf57e
commit fa3de9b70e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -975,13 +975,10 @@ CFramebuffer* CHyprOpenGLImpl::blurMainFramebufferWithDamage(float a, CRegion* o
// damage region will be scaled, make a temp
CRegion tempDamage{damage};
wlr_region_scale(tempDamage.pixman(), damage.pixman(), 1.f / 2.f); // when DOWNscaling, we make the region twice as small because it's the TARGET
drawPass(&m_RenderData.pCurrentMonData->m_shBLUR1, &tempDamage);
// and draw
for (int i = 1; i < *PBLURPASSES; ++i) {
wlr_region_scale(tempDamage.pixman(), damage.pixman(), 1.f / (1 << (i + 1)));
for (int i = 1; i <= *PBLURPASSES; ++i) {
wlr_region_scale(tempDamage.pixman(), damage.pixman(), 1.f / (1 << i));
drawPass(&m_RenderData.pCurrentMonData->m_shBLUR1, &tempDamage); // down
}