From 3a7bd8fea2ca9711da5523dc185c05ea30ec0f35 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sat, 4 Apr 2026 23:20:44 +0100 Subject: renderer: add a cm settings cache --- src/render/Renderer.hpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/render/Renderer.hpp') diff --git a/src/render/Renderer.hpp b/src/render/Renderer.hpp index ba044567..d61333c7 100644 --- a/src/render/Renderer.hpp +++ b/src/render/Renderer.hpp @@ -191,6 +191,7 @@ namespace Render { SCMSettings getCMSettings(const NColorManagement::PImageDescription imageDescription, const NColorManagement::PImageDescription targetImageDescription, SP surface = nullptr, bool modifySDR = false, float sdrMinLuminance = -1.0f, int sdrMaxLuminance = -1); + void clearCMSettingsCache(); virtual bool reloadShaders(const std::string& path = "") = 0; protected: @@ -216,11 +217,22 @@ namespace Render { SP getBackground(PHLMONITOR pMonitor); virtual SP getBlurTexture(PHLMONITORREF pMonitor); - SP m_lockDeadTexture; - SP m_lockDead2Texture; - SP m_lockTtyTextTexture; - bool m_monitorTransformEnabled = false; // do not modify directly - std::stack m_monitorTransformStack; + + struct SCMSettingsCacheEntry { + uint64_t srcDescId = 0, dstDescId = 0; + void* surfacePtr = nullptr; // read-only!! + bool modifySDR = false; + float sdrMinLuminance = -1.F; + int sdrMaxLuminance = -1; + SCMSettings settings; + }; + std::vector m_cmSettingsCache; + + SP m_lockDeadTexture; + SP m_lockDead2Texture; + SP m_lockTtyTextTexture; + bool m_monitorTransformEnabled = false; // do not modify directly + std::stack m_monitorTransformStack; // old private: void arrangeLayerArray(PHLMONITOR, const std::vector&, bool, CBox*); -- cgit v1.2.3