Renderer: rewrite render scheduling (#8683)

This rewrites renderer scheduling. Occlusion is now unified in a new Pass type.
This commit is contained in:
Vaxry 2024-12-22 17:12:09 +01:00 committed by GitHub
parent 1cc1a46c2e
commit e536b02248
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 1576 additions and 775 deletions

View file

@ -0,0 +1,29 @@
#include "RectPassElement.hpp"
#include "../OpenGL.hpp"
CRectPassElement::CRectPassElement(const CRectPassElement::SRectData& data_) : data(data_) {
;
}
void CRectPassElement::draw(const CRegion& damage) {
if (data.color.a == 1.F || !data.blur)
g_pHyprOpenGL->renderRectWithDamage(&data.box, data.color, damage, data.round);
else
g_pHyprOpenGL->renderRectWithBlur(&data.box, data.color, data.round, data.blurA, data.xray);
}
bool CRectPassElement::needsLiveBlur() {
return data.color.a < 1.F && !data.xray && data.blur;
}
bool CRectPassElement::needsPrecomputeBlur() {
return data.color.a < 1.F && data.xray && data.blur;
}
std::optional<CBox> CRectPassElement::boundingBox() {
return data.box.expand(-data.round);
}
CRegion CRectPassElement::opaqueRegion() {
return data.color.a >= 1.F ? *boundingBox() : CRegion{};
}