From 5ba33f846129f3e6c0505b19f94634b24505e828 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sun, 26 Apr 2026 15:16:36 +0100 Subject: config/lua: init lua config manager, use lua if available (#13817) Adds a new lua config manager, which will automatically be used if there is a lua config present. --- src/render/OpenGL.cpp | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'src/render/OpenGL.cpp') diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index bf914e31..a87ec2ee 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -315,7 +315,7 @@ CHyprOpenGLImpl::CHyprOpenGLImpl() : m_drmFD(g_pCompositor->m_drmRenderNode.fd > loadGLProc(&m_proc.eglQueryDisplayAttribEXT, "eglQueryDisplayAttribEXT"); } - static const auto GLDEBUG = CConfigValue("debug:gl_debugging"); + static const auto GLDEBUG = CConfigValue("debug:gl_debugging"); if (EGLEXTENSIONS.contains("EGL_KHR_debug") && *GLDEBUG) { loadGLProc(&m_proc.eglDebugMessageControlKHR, "eglDebugMessageControlKHR"); static const EGLAttrib debugAttrs[] = { @@ -781,8 +781,8 @@ void CHyprOpenGLImpl::begin(PHLMONITOR pMonitor, const CRegion& damage_, SP("cursor:zoom_disable_aa"); - static auto PFPINVALIDATE = CConfigValue("debug:invalidate_fp16"); + static auto PZOOMDISABLEAA = CConfigValue("cursor:zoom_disable_aa"); + static auto PFPINVALIDATE = CConfigValue("debug:invalidate_fp16"); auto& m_renderData = g_pHyprRenderer->m_renderData; const auto PMONITOR = m_renderData.pMonitor; TRACY_GPU_ZONE("RenderEnd"); @@ -851,7 +851,7 @@ void CHyprOpenGLImpl::end() { m_renderData.pMonitor.reset(); - static const auto GLDEBUG = CConfigValue("debug:gl_debugging"); + static const auto GLDEBUG = CConfigValue("debug:gl_debugging"); if (*GLDEBUG) { // check for gl errors @@ -875,7 +875,7 @@ const std::array FRAG_SHADERS = { bool CHyprOpenGLImpl::initShaders(const std::string& path) { auto shaders = makeShared(); - static const auto PCM = CConfigValue("render:cm_enabled"); + static const auto PCM = CConfigValue("render:cm_enabled"); try { auto shaderLoader = makeUnique(SHADER_INCLUDES, FRAG_SHADERS, path); @@ -904,7 +904,7 @@ bool CHyprOpenGLImpl::initShaders(const std::string& path) { void CHyprOpenGLImpl::applyScreenShader(const std::string& path) { - static auto PDT = CConfigValue("debug:damage_tracking"); + static auto PDT = CConfigValue("debug:damage_tracking"); m_finalScreenShader->destroy(); @@ -1201,8 +1201,8 @@ void CHyprOpenGLImpl::passCMUniforms(WP shader, const PImageDescription } WP CHyprOpenGLImpl::renderToOutputInternal() { - static const auto PDT = CConfigValue("debug:damage_tracking"); - static const auto PCURSORTIMEOUT = CConfigValue("cursor:inactive_timeout"); + static const auto PDT = CConfigValue("debug:damage_tracking"); + static const auto PCURSORTIMEOUT = CConfigValue("cursor:inactive_timeout"); auto& m_renderData = g_pHyprRenderer->m_renderData; @@ -1274,8 +1274,8 @@ WP CHyprOpenGLImpl::renderToOutputInternal() { } WP CHyprOpenGLImpl::renderToFBInternal(SP tex, const STextureRenderData& data, eTextureType texType, const CBox& newBox) { - static const auto PENABLECM = CConfigValue("render:cm_enabled"); - static auto PBLEND = CConfigValue("render:use_shader_blur_blend"); + static const auto PENABLECM = CConfigValue("render:cm_enabled"); + static auto PBLEND = CConfigValue("render:use_shader_blur_blend"); auto& m_renderData = g_pHyprRenderer->m_renderData; @@ -1632,10 +1632,10 @@ SP CHyprOpenGLImpl::blurFramebufferWithDamage(float a, CRegion* or const auto& glMatrix = g_pHyprRenderer->projectBoxToTarget(MONITORBOX, TRANSFORM); // get the config settings - static auto PBLURSIZE = CConfigValue("decoration:blur:size"); - static auto PBLURPASSES = CConfigValue("decoration:blur:passes"); - static auto PBLURVIBRANCY = CConfigValue("decoration:blur:vibrancy"); - static auto PBLURVIBRANCYDARKNESS = CConfigValue("decoration:blur:vibrancy_darkness"); + static auto PBLURSIZE = CConfigValue("decoration:blur:size"); + static auto PBLURPASSES = CConfigValue("decoration:blur:passes"); + static auto PBLURVIBRANCY = CConfigValue("decoration:blur:vibrancy"); + static auto PBLURVIBRANCYDARKNESS = CConfigValue("decoration:blur:vibrancy_darkness"); const auto BLUR_PASSES = std::clamp(*PBLURPASSES, sc(1), sc(8)); @@ -1654,9 +1654,9 @@ SP CHyprOpenGLImpl::blurFramebufferWithDamage(float a, CRegion* or // Begin with base color adjustments - global brightness and contrast // TODO: make this a part of the first pass maybe to save on a drawcall? { - static auto PBLURCONTRAST = CConfigValue("decoration:blur:contrast"); - static auto PBLURBRIGHTNESS = CConfigValue("decoration:blur:brightness"); - static auto PBLEND = CConfigValue("render:use_shader_blur_blend"); + static auto PBLURCONTRAST = CConfigValue("decoration:blur:contrast"); + static auto PBLURBRIGHTNESS = CConfigValue("decoration:blur:brightness"); + static auto PBLEND = CConfigValue("render:use_shader_blur_blend"); PMIRRORSWAPFB->bind(); @@ -1773,8 +1773,8 @@ SP CHyprOpenGLImpl::blurFramebufferWithDamage(float a, CRegion* or // finalize the image { - static auto PBLURNOISE = CConfigValue("decoration:blur:noise"); - static auto PBLURBRIGHTNESS = CConfigValue("decoration:blur:brightness"); + static auto PBLURNOISE = CConfigValue("decoration:blur:noise"); + static auto PBLURBRIGHTNESS = CConfigValue("decoration:blur:brightness"); if (currentRenderToFB == PMIRRORFB) PMIRRORSWAPFB->bind(); @@ -1839,9 +1839,9 @@ SP CHyprOpenGLImpl::blurFramebufferWithDamage(float a, CRegion* or } void CHyprOpenGLImpl::preRender(PHLMONITOR pMonitor) { - static auto PBLURNEWOPTIMIZE = CConfigValue("decoration:blur:new_optimizations"); - static auto PBLURXRAY = CConfigValue("decoration:blur:xray"); - static auto PBLUR = CConfigValue("decoration:blur:enabled"); + static auto PBLURNEWOPTIMIZE = CConfigValue("decoration:blur:new_optimizations"); + static auto PBLURXRAY = CConfigValue("decoration:blur:xray"); + static auto PBLUR = CConfigValue("decoration:blur:enabled"); if (!*PBLURNEWOPTIMIZE || !pMonitor->m_blurFBDirty || !*PBLUR) return; @@ -1927,7 +1927,7 @@ void CHyprOpenGLImpl::renderTextureWithBlurInternal(SP tex, const CBox TRACY_GPU_ZONE("RenderTextureWithBlur"); - static auto PBLEND = CConfigValue("render:use_shader_blur_blend"); + static auto PBLEND = CConfigValue("render:use_shader_blur_blend"); const auto NEEDS_STENCIL = data.discardMode != 0 && (!data.blockBlurOptimization || (data.discardMode & DISCARD_ALPHA)); if (!*PBLEND) { @@ -1979,7 +1979,7 @@ void CHyprOpenGLImpl::renderTextureWithBlurInternal(SP tex, const CBox transformedBox.width / m_renderData.pMonitor->m_pixelSize.x * m_renderData.pMonitor->m_transformedSize.x, transformedBox.height / m_renderData.pMonitor->m_pixelSize.y * m_renderData.pMonitor->m_transformedSize.y}; - static auto PBLURIGNOREOPACITY = CConfigValue("decoration:blur:ignore_opacity"); + static auto PBLURIGNOREOPACITY = CConfigValue("decoration:blur:ignore_opacity"); g_pHyprRenderer->pushMonitorTransformEnabled(true); bool renderModif = g_pHyprRenderer->m_renderData.renderModif.enabled; @@ -2228,7 +2228,7 @@ void CHyprOpenGLImpl::renderRoundedShadow(const CBox& box, int round, float roun CBox newBox = box; g_pHyprRenderer->m_renderData.renderModif.applyToBox(newBox); - static auto PSHADOWPOWER = CConfigValue("decoration:shadow:render_power"); + static auto PSHADOWPOWER = CConfigValue("decoration:shadow:render_power"); const auto SHADOWPOWER = std::clamp(sc(*PSHADOWPOWER), 1, 4); -- cgit v1.2.3