renderer: don't occlude when pre-blur is queued

This commit is contained in:
vaxerski 2023-07-20 18:03:47 +02:00
parent e5dd133808
commit ff598b0827
3 changed files with 11 additions and 5 deletions

View file

@ -945,16 +945,20 @@ void CHyprOpenGLImpl::preBlurForCurrentMonitor() {
} }
void CHyprOpenGLImpl::preWindowPass() { void CHyprOpenGLImpl::preWindowPass() {
static auto* const PBLURNEWOPTIMIZE = &g_pConfigManager->getConfigValuePtr("decoration:blur_new_optimizations")->intValue; if (!preBlurQueued())
static auto* const PBLUR = &g_pConfigManager->getConfigValuePtr("decoration:blur")->intValue;
if (!m_RenderData.pCurrentMonData->blurFBDirty || !*PBLURNEWOPTIMIZE || !*PBLUR || !m_RenderData.pCurrentMonData->blurFBShouldRender)
return; return;
// blur the main FB, it will be rendered onto the mirror // blur the main FB, it will be rendered onto the mirror
preBlurForCurrentMonitor(); preBlurForCurrentMonitor();
} }
bool CHyprOpenGLImpl::preBlurQueued() {
static auto* const PBLURNEWOPTIMIZE = &g_pConfigManager->getConfigValuePtr("decoration:blur_new_optimizations")->intValue;
static auto* const PBLUR = &g_pConfigManager->getConfigValuePtr("decoration:blur")->intValue;
return !(!m_RenderData.pCurrentMonData->blurFBDirty || !*PBLURNEWOPTIMIZE || !*PBLUR || !m_RenderData.pCurrentMonData->blurFBShouldRender);
}
void CHyprOpenGLImpl::renderTextureWithBlur(const CTexture& tex, wlr_box* pBox, float a, wlr_surface* pSurface, int round, bool blockBlurOptimization) { void CHyprOpenGLImpl::renderTextureWithBlur(const CTexture& tex, wlr_box* pBox, float a, wlr_surface* pSurface, int round, bool blockBlurOptimization) {
RASSERT(m_RenderData.pMonitor, "Tried to render texture with blur without begin()!"); RASSERT(m_RenderData.pMonitor, "Tried to render texture with blur without begin()!");

View file

@ -132,6 +132,7 @@ class CHyprOpenGLImpl {
void markBlurDirtyForMonitor(CMonitor*); void markBlurDirtyForMonitor(CMonitor*);
void preWindowPass(); void preWindowPass();
bool preBlurQueued();
void preRender(CMonitor*); void preRender(CMonitor*);
void saveBufferForMirror(); void saveBufferForMirror();

View file

@ -480,6 +480,7 @@ void CHyprRenderer::renderAllClientsForWorkspace(CMonitor* pMonitor, CWorkspace*
if (!pWorkspace->m_bHasFullscreenWindow || pWorkspace->m_efFullscreenMode != FULLSCREEN_FULL || !PFULLWINDOW || PFULLWINDOW->m_vRealSize.isBeingAnimated() || if (!pWorkspace->m_bHasFullscreenWindow || pWorkspace->m_efFullscreenMode != FULLSCREEN_FULL || !PFULLWINDOW || PFULLWINDOW->m_vRealSize.isBeingAnimated() ||
!PFULLWINDOW->opaque() || pWorkspace->m_vRenderOffset.vec() != Vector2D{}) { !PFULLWINDOW->opaque() || pWorkspace->m_vRenderOffset.vec() != Vector2D{}) {
if (!g_pHyprOpenGL->preBlurQueued())
setOccludedForBackLayers(g_pHyprOpenGL->m_RenderData.damage, pWorkspace); setOccludedForBackLayers(g_pHyprOpenGL->m_RenderData.damage, pWorkspace);
for (auto& ls : pMonitor->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]) { for (auto& ls : pMonitor->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]) {