summaryrefslogtreecommitdiff
path: root/src/render/Renderer.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2023-11-26 15:06:42 +0000
committerVaxry <vaxry@vaxry.net>2023-11-26 15:06:42 +0000
commit408d96668d57fdd1a713e56f1d40a9befd51bd4a (patch)
tree5df08ca2a3506afa44bca786b31f80b7a4d13741 /src/render/Renderer.cpp
parent75e579931088671fb333efd2a3923ff96b868fe9 (diff)
renderer: use occlusion checks for buffer clear
Diffstat (limited to 'src/render/Renderer.cpp')
-rw-r--r--src/render/Renderer.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index bdf683e9..770ca16a 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -650,9 +650,11 @@ void CHyprRenderer::renderSessionLockSurface(SSessionLockSurface* pSurface, CMon
}
void CHyprRenderer::renderAllClientsForWorkspace(CMonitor* pMonitor, CWorkspace* pWorkspace, timespec* time, const Vector2D& translate, const float& scale) {
- static auto* const PDIMSPECIAL = &g_pConfigManager->getConfigValuePtr("decoration:dim_special")->floatValue;
- static auto* const PBLURSPECIAL = &g_pConfigManager->getConfigValuePtr("decoration:blur:special")->intValue;
- static auto* const PBLUR = &g_pConfigManager->getConfigValuePtr("decoration:blur:enabled")->intValue;
+ static auto* const PDIMSPECIAL = &g_pConfigManager->getConfigValuePtr("decoration:dim_special")->floatValue;
+ static auto* const PBLURSPECIAL = &g_pConfigManager->getConfigValuePtr("decoration:blur:special")->intValue;
+ static auto* const PBLUR = &g_pConfigManager->getConfigValuePtr("decoration:blur:enabled")->intValue;
+ static auto* const PRENDERTEX = &g_pConfigManager->getConfigValuePtr("misc:disable_hyprland_logo")->intValue;
+ static auto* const PBACKGROUNDCOLOR = &g_pConfigManager->getConfigValuePtr("misc:background_color")->intValue;
const SRenderModifData RENDERMODIFDATA = {translate, scale};
@@ -684,6 +686,15 @@ void CHyprRenderer::renderAllClientsForWorkspace(CMonitor* pMonitor, CWorkspace*
if (!g_pHyprOpenGL->m_RenderData.pCurrentMonData->blurFBShouldRender)
setOccludedForBackLayers(g_pHyprOpenGL->m_RenderData.damage, pWorkspace);
+ g_pHyprOpenGL->blend(false);
+ if (!canSkipBackBufferClear(pMonitor)) {
+ if (*PRENDERTEX /* inverted cfg flag */)
+ g_pHyprOpenGL->clear(CColor(*PBACKGROUNDCOLOR));
+ else
+ g_pHyprOpenGL->clearWithTex(); // will apply the hypr "wallpaper"
+ }
+ g_pHyprOpenGL->blend(true);
+
for (auto& ls : pMonitor->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]) {
renderLayer(ls.get(), pMonitor, time);
}
@@ -914,8 +925,6 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
static auto* const PNODIRECTSCANOUT = &g_pConfigManager->getConfigValuePtr("misc:no_direct_scanout")->intValue;
static auto* const PVFR = &g_pConfigManager->getConfigValuePtr("misc:vfr")->intValue;
static auto* const PZOOMFACTOR = &g_pConfigManager->getConfigValuePtr("misc:cursor_zoom_factor")->floatValue;
- static auto* const PRENDERTEX = &g_pConfigManager->getConfigValuePtr("misc:disable_hyprland_logo")->intValue;
- static auto* const PBACKGROUNDCOLOR = &g_pConfigManager->getConfigValuePtr("misc:background_color")->intValue;
static auto* const PANIMENABLED = &g_pConfigManager->getConfigValuePtr("animations:enabled")->intValue;
static auto* const PFIRSTLAUNCHANIM = &g_pConfigManager->getConfigValuePtr("animations:first_launch_animation")->intValue;
static auto* const PTEARINGENABLED = &g_pConfigManager->getConfigValuePtr("general:allow_tearing")->intValue;
@@ -1144,15 +1153,6 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
EMIT_HOOK_EVENT("render", RENDER_POST_MIRROR);
renderCursor = false;
} else {
- g_pHyprOpenGL->blend(false);
- if (!canSkipBackBufferClear(pMonitor)) {
- if (*PRENDERTEX /* inverted cfg flag */)
- g_pHyprOpenGL->clear(CColor(*PBACKGROUNDCOLOR));
- else
- g_pHyprOpenGL->clearWithTex(); // will apply the hypr "wallpaper"
- }
- g_pHyprOpenGL->blend(true);
-
CBox renderBox = {0, 0, (int)pMonitor->vecPixelSize.x, (int)pMonitor->vecPixelSize.y};
renderWorkspace(pMonitor, g_pCompositor->getWorkspaceByID(pMonitor->activeWorkspace), &now, renderBox);