diff options
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/pass/Pass.cpp | 30 | ||||
-rw-r--r-- | src/render/pass/Pass.hpp | 2 |
2 files changed, 30 insertions, 2 deletions
diff --git a/src/render/pass/Pass.cpp b/src/render/pass/Pass.cpp index 31385acb..b6256c44 100644 --- a/src/render/pass/Pass.cpp +++ b/src/render/pass/Pass.cpp @@ -21,6 +21,8 @@ void CRenderPass::add(SP<IPassElement> el) { } void CRenderPass::simplify() { + static auto PDEBUGPASS = CConfigValue<Hyprlang::INT>("debug:pass"); + // TODO: use precompute blur for instances where there is nothing in between // if there is live blur, we need to NOT occlude any area where it will be influenced @@ -78,6 +80,20 @@ void CRenderPass::simplify() { } } newDamage.subtract(opaque); + if (*PDEBUGPASS) + occludedRegion.add(opaque); + } + } + + if (*PDEBUGPASS) { + for (auto& el2 : m_vPassElements) { + if (!el2->element->needsLiveBlur()) + continue; + + const auto BB = el2->element->boundingBox(); + RASSERT(BB, "No bounding box for an element with live blur is illegal"); + + totalLiveBlurRegion.add(*BB); } } } @@ -87,9 +103,13 @@ void CRenderPass::clear() { } CRegion CRenderPass::render(const CRegion& damage_) { - const auto WILLBLUR = std::ranges::any_of(m_vPassElements, [](const auto& el) { return el->element->needsLiveBlur(); }); + static auto PDEBUGPASS = CConfigValue<Hyprlang::INT>("debug:pass"); - damage = damage_.copy(); + const auto WILLBLUR = std::ranges::any_of(m_vPassElements, [](const auto& el) { return el->element->needsLiveBlur(); }); + + damage = *PDEBUGPASS ? CRegion{CBox{{}, {INT32_MAX, INT32_MAX}}} : damage_.copy(); + occludedRegion = CRegion{}; + totalLiveBlurRegion = CRegion{}; if (damage.empty()) { g_pHyprOpenGL->m_RenderData.damage = damage; @@ -145,6 +165,12 @@ CRegion CRenderPass::render(const CRegion& damage_) { el->element->draw(el->elementDamage); } + if (*PDEBUGPASS) { + CBox monbox = {{}, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize}; + g_pHyprOpenGL->renderRectWithDamage(&monbox, CHyprColor{1.F, 0.1F, 0.1F, 0.5F}, occludedRegion); + g_pHyprOpenGL->renderRectWithDamage(&monbox, CHyprColor{0.1F, 1.F, 0.1F, 0.5F}, totalLiveBlurRegion); + } + g_pHyprOpenGL->m_RenderData.damage = damage; return damage; } diff --git a/src/render/pass/Pass.hpp b/src/render/pass/Pass.hpp index 7f332c19..6fe6938f 100644 --- a/src/render/pass/Pass.hpp +++ b/src/render/pass/Pass.hpp @@ -18,6 +18,8 @@ class CRenderPass { private: CRegion damage; + CRegion occludedRegion; + CRegion totalLiveBlurRegion; struct SPassElementData { CRegion elementDamage; |