mirror of
https://github.com/hyprwm/Hyprland
synced 2025-02-17 00:02:35 +01:00
opengl: better checking for required introspection
performance woo
This commit is contained in:
parent
802ab58f8a
commit
aedcade68d
2 changed files with 47 additions and 6 deletions
|
@ -115,10 +115,50 @@ GLuint CHyprOpenGLImpl::compileShader(const GLuint& type, std::string src, bool
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHyprOpenGLImpl::begin(CMonitor* pMonitor, CRegion* pDamage, bool fake) {
|
bool CHyprOpenGLImpl::passRequiresIntrospection(CMonitor* pMonitor) {
|
||||||
m_RenderData.pMonitor = pMonitor;
|
// passes requiring introspection are the ones that need to render blur.
|
||||||
|
|
||||||
static auto* const PBLUR = &g_pConfigManager->getConfigValuePtr("decoration:blur:enabled")->intValue;
|
static auto* const PBLUR = &g_pConfigManager->getConfigValuePtr("decoration:blur:enabled")->intValue;
|
||||||
|
static auto* const PXRAY = &g_pConfigManager->getConfigValuePtr("decoration:blur:xray")->intValue;
|
||||||
|
|
||||||
|
if (*PBLUR == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (m_RenderData.pCurrentMonData->blurFBShouldRender)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (pMonitor->solitaryClient)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (auto& ls : pMonitor->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]) {
|
||||||
|
if (ls->forceBlur && !ls->xray)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*PXRAY)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (auto& w : g_pCompositor->m_vWindows) {
|
||||||
|
if (!w->m_bIsMapped || w->isHidden() || (!w->m_bIsFloating && !g_pCompositor->isWorkspaceSpecial(w->m_iWorkspaceID)))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!g_pHyprRenderer->shouldRenderWindow(w.get()))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (w->m_sAdditionalConfigData.forceNoBlur.toUnderlying() == true || w->m_sAdditionalConfigData.xray.toUnderlying() == true)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (w->opaque())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CHyprOpenGLImpl::begin(CMonitor* pMonitor, CRegion* pDamage, bool fake) {
|
||||||
|
m_RenderData.pMonitor = pMonitor;
|
||||||
|
|
||||||
TRACY_GPU_ZONE("RenderBegin");
|
TRACY_GPU_ZONE("RenderBegin");
|
||||||
|
|
||||||
|
@ -163,7 +203,7 @@ void CHyprOpenGLImpl::begin(CMonitor* pMonitor, CRegion* pDamage, bool fake) {
|
||||||
const auto PRBO = g_pHyprRenderer->getCurrentRBO();
|
const auto PRBO = g_pHyprRenderer->getCurrentRBO();
|
||||||
|
|
||||||
if (m_sFinalScreenShader.program > 0 || m_bFakeFrame || m_RenderData.mouseZoomFactor != 1.0 || pMonitor->vecPixelSize != PRBO->getFB()->m_vSize ||
|
if (m_sFinalScreenShader.program > 0 || m_bFakeFrame || m_RenderData.mouseZoomFactor != 1.0 || pMonitor->vecPixelSize != PRBO->getFB()->m_vSize ||
|
||||||
(*PBLUR != 0 && !pMonitor->solitaryClient /* TODO: revisit when possible */)) {
|
passRequiresIntrospection(pMonitor)) {
|
||||||
// we have to offload
|
// we have to offload
|
||||||
// bind the primary Hypr Framebuffer
|
// bind the primary Hypr Framebuffer
|
||||||
m_RenderData.pCurrentMonData->offloadFB.bind();
|
m_RenderData.pCurrentMonData->offloadFB.bind();
|
||||||
|
|
|
@ -30,8 +30,7 @@ inline const float fullVerts[] = {
|
||||||
};
|
};
|
||||||
inline const float fanVertsFull[] = {-1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f};
|
inline const float fanVertsFull[] = {-1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f};
|
||||||
|
|
||||||
enum eDiscardMode
|
enum eDiscardMode {
|
||||||
{
|
|
||||||
DISCARD_OPAQUE = 1,
|
DISCARD_OPAQUE = 1,
|
||||||
DISCARD_ALPHA = 1 << 1
|
DISCARD_ALPHA = 1 << 1
|
||||||
};
|
};
|
||||||
|
@ -173,7 +172,7 @@ class CHyprOpenGLImpl {
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC glEGLImageTargetRenderbufferStorageOES = nullptr;
|
PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC glEGLImageTargetRenderbufferStorageOES = nullptr;
|
||||||
PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR = nullptr;
|
PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR = nullptr;
|
||||||
} m_sProc;
|
} m_sProc;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -209,6 +208,8 @@ class CHyprOpenGLImpl {
|
||||||
|
|
||||||
bool shouldUseNewBlurOptimizations(SLayerSurface* pLayer, CWindow* pWindow);
|
bool shouldUseNewBlurOptimizations(SLayerSurface* pLayer, CWindow* pWindow);
|
||||||
|
|
||||||
|
bool passRequiresIntrospection(CMonitor* pMonitor);
|
||||||
|
|
||||||
friend class CHyprRenderer;
|
friend class CHyprRenderer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue