mirror of
https://github.com/hyprwm/Hyprland
synced 2025-01-10 09:29:48 +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() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool CFramebufferElement::undiscardable() {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ class CFramebufferElement : public IPassElement {
|
|||
virtual void draw(const CRegion& damage);
|
||||
virtual bool needsLiveBlur();
|
||||
virtual bool needsPrecomputeBlur();
|
||||
virtual bool undiscardable();
|
||||
|
||||
virtual const char* passName() {
|
||||
return "CFramebufferElement";
|
||||
|
|
|
@ -35,14 +35,14 @@ void CRenderPass::simplify() {
|
|||
CRegion newDamage = damage.copy().intersect(CBox{{}, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize});
|
||||
for (auto& el : m_vPassElements | std::views::reverse) {
|
||||
|
||||
if (newDamage.empty()) {
|
||||
if (newDamage.empty() && !el->element->undiscardable()) {
|
||||
el->discard = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
el->elementDamage = newDamage;
|
||||
auto bb1 = el->element->boundingBox();
|
||||
if (!bb1)
|
||||
if (!bb1 || newDamage.empty())
|
||||
continue;
|
||||
|
||||
auto bb = bb1->scale(g_pHyprOpenGL->m_RenderData.pMonitor->scale);
|
||||
|
|
|
@ -15,3 +15,7 @@ bool IPassElement::disableSimplification() {
|
|||
void IPassElement::discard() {
|
||||
;
|
||||
}
|
||||
|
||||
bool IPassElement::undiscardable() {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ class IPassElement {
|
|||
virtual bool needsPrecomputeBlur() = 0;
|
||||
virtual const char* passName() = 0;
|
||||
virtual void discard();
|
||||
virtual bool undiscardable();
|
||||
virtual std::optional<CBox> boundingBox();
|
||||
virtual CRegion opaqueRegion();
|
||||
virtual bool disableSimplification();
|
||||
|
|
|
@ -18,3 +18,7 @@ bool CPreBlurElement::needsPrecomputeBlur() {
|
|||
bool CPreBlurElement::disableSimplification() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CPreBlurElement::undiscardable() {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ class CPreBlurElement : public IPassElement {
|
|||
virtual bool needsLiveBlur();
|
||||
virtual bool needsPrecomputeBlur();
|
||||
virtual bool disableSimplification();
|
||||
virtual bool undiscardable();
|
||||
|
||||
virtual const char* passName() {
|
||||
return "CPreBlurElement";
|
||||
|
|
|
@ -17,3 +17,7 @@ bool CRendererHintsPassElement::needsLiveBlur() {
|
|||
bool CRendererHintsPassElement::needsPrecomputeBlur() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CRendererHintsPassElement::undiscardable() {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ class CRendererHintsPassElement : public IPassElement {
|
|||
virtual void draw(const CRegion& damage);
|
||||
virtual bool needsLiveBlur();
|
||||
virtual bool needsPrecomputeBlur();
|
||||
virtual bool undiscardable();
|
||||
|
||||
virtual const char* passName() {
|
||||
return "CRendererHintsPassElement";
|
||||
|
|
Loading…
Reference in a new issue