From e536b02248f370971716b744968776f6880528be Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sun, 22 Dec 2024 17:12:09 +0100 Subject: Renderer: rewrite render scheduling (#8683) This rewrites renderer scheduling. Occlusion is now unified in a new Pass type. --- src/render/pass/TexPassElement.cpp | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/render/pass/TexPassElement.cpp (limited to 'src/render/pass/TexPassElement.cpp') diff --git a/src/render/pass/TexPassElement.cpp b/src/render/pass/TexPassElement.cpp new file mode 100644 index 00000000..05f756dc --- /dev/null +++ b/src/render/pass/TexPassElement.cpp @@ -0,0 +1,44 @@ +#include "TexPassElement.hpp" +#include "../OpenGL.hpp" + +#include +using namespace Hyprutils::Utils; + +CTexPassElement::CTexPassElement(const CTexPassElement::SRenderData& data_) : data(data_) { + ; +} + +void CTexPassElement::draw(const CRegion& damage) { + g_pHyprOpenGL->m_bEndFrame = data.flipEndFrame; + + CScopeGuard x = {[]() { + // + g_pHyprOpenGL->m_bEndFrame = false; + }}; + + if (data.replaceProjection) + g_pHyprOpenGL->m_RenderData.monitorProjection = *data.replaceProjection; + g_pHyprOpenGL->renderTextureInternalWithDamage(data.tex, &data.box, data.a, data.damage.empty() ? damage : data.damage, data.round, data.syncTimeline, data.syncPoint); + if (data.replaceProjection) + g_pHyprOpenGL->m_RenderData.monitorProjection = g_pHyprOpenGL->m_RenderData.pMonitor->projMatrix; +} + +bool CTexPassElement::needsLiveBlur() { + return false; // TODO? +} + +bool CTexPassElement::needsPrecomputeBlur() { + return false; // TODO? +} + +std::optional CTexPassElement::boundingBox() { + return data.box.copy().scale(1.F / g_pHyprOpenGL->m_RenderData.pMonitor->scale).round(); +} + +CRegion CTexPassElement::opaqueRegion() { + return {}; // TODO: +} + +void CTexPassElement::discard() { + ; +} -- cgit v1.2.3