mirror of
https://github.com/hyprwm/Hyprland
synced 2025-01-25 12:09:50 +01:00
pass: mark crucial elements as undiscardable
This commit is contained in:
parent
7f177fa1cf
commit
9f3c9ac01a
9 changed files with 23 additions and 3 deletions
|
@ -45,4 +45,8 @@ bool CFramebufferElement::needsLiveBlur() {
|
||||||
|
|
||||||
bool CFramebufferElement::needsPrecomputeBlur() {
|
bool CFramebufferElement::needsPrecomputeBlur() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CFramebufferElement::undiscardable() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ class CFramebufferElement : public IPassElement {
|
||||||
virtual void draw(const CRegion& damage);
|
virtual void draw(const CRegion& damage);
|
||||||
virtual bool needsLiveBlur();
|
virtual bool needsLiveBlur();
|
||||||
virtual bool needsPrecomputeBlur();
|
virtual bool needsPrecomputeBlur();
|
||||||
|
virtual bool undiscardable();
|
||||||
|
|
||||||
virtual const char* passName() {
|
virtual const char* passName() {
|
||||||
return "CFramebufferElement";
|
return "CFramebufferElement";
|
||||||
|
|
|
@ -35,14 +35,14 @@ void CRenderPass::simplify() {
|
||||||
CRegion newDamage = damage.copy().intersect(CBox{{}, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize});
|
CRegion newDamage = damage.copy().intersect(CBox{{}, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize});
|
||||||
for (auto& el : m_vPassElements | std::views::reverse) {
|
for (auto& el : m_vPassElements | std::views::reverse) {
|
||||||
|
|
||||||
if (newDamage.empty()) {
|
if (newDamage.empty() && !el->element->undiscardable()) {
|
||||||
el->discard = true;
|
el->discard = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
el->elementDamage = newDamage;
|
el->elementDamage = newDamage;
|
||||||
auto bb1 = el->element->boundingBox();
|
auto bb1 = el->element->boundingBox();
|
||||||
if (!bb1)
|
if (!bb1 || newDamage.empty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
auto bb = bb1->scale(g_pHyprOpenGL->m_RenderData.pMonitor->scale);
|
auto bb = bb1->scale(g_pHyprOpenGL->m_RenderData.pMonitor->scale);
|
||||||
|
|
|
@ -15,3 +15,7 @@ bool IPassElement::disableSimplification() {
|
||||||
void IPassElement::discard() {
|
void IPassElement::discard() {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IPassElement::undiscardable() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ class IPassElement {
|
||||||
virtual bool needsPrecomputeBlur() = 0;
|
virtual bool needsPrecomputeBlur() = 0;
|
||||||
virtual const char* passName() = 0;
|
virtual const char* passName() = 0;
|
||||||
virtual void discard();
|
virtual void discard();
|
||||||
|
virtual bool undiscardable();
|
||||||
virtual std::optional<CBox> boundingBox();
|
virtual std::optional<CBox> boundingBox();
|
||||||
virtual CRegion opaqueRegion();
|
virtual CRegion opaqueRegion();
|
||||||
virtual bool disableSimplification();
|
virtual bool disableSimplification();
|
||||||
|
|
|
@ -18,3 +18,7 @@ bool CPreBlurElement::needsPrecomputeBlur() {
|
||||||
bool CPreBlurElement::disableSimplification() {
|
bool CPreBlurElement::disableSimplification() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CPreBlurElement::undiscardable() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ class CPreBlurElement : public IPassElement {
|
||||||
virtual bool needsLiveBlur();
|
virtual bool needsLiveBlur();
|
||||||
virtual bool needsPrecomputeBlur();
|
virtual bool needsPrecomputeBlur();
|
||||||
virtual bool disableSimplification();
|
virtual bool disableSimplification();
|
||||||
|
virtual bool undiscardable();
|
||||||
|
|
||||||
virtual const char* passName() {
|
virtual const char* passName() {
|
||||||
return "CPreBlurElement";
|
return "CPreBlurElement";
|
||||||
|
|
|
@ -17,3 +17,7 @@ bool CRendererHintsPassElement::needsLiveBlur() {
|
||||||
bool CRendererHintsPassElement::needsPrecomputeBlur() {
|
bool CRendererHintsPassElement::needsPrecomputeBlur() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CRendererHintsPassElement::undiscardable() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ class CRendererHintsPassElement : public IPassElement {
|
||||||
virtual void draw(const CRegion& damage);
|
virtual void draw(const CRegion& damage);
|
||||||
virtual bool needsLiveBlur();
|
virtual bool needsLiveBlur();
|
||||||
virtual bool needsPrecomputeBlur();
|
virtual bool needsPrecomputeBlur();
|
||||||
|
virtual bool undiscardable();
|
||||||
|
|
||||||
virtual const char* passName() {
|
virtual const char* passName() {
|
||||||
return "CRendererHintsPassElement";
|
return "CRendererHintsPassElement";
|
||||||
|
|
Loading…
Reference in a new issue