From 43fc7662ccb8178f2984156d45c2406e302250fd Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 2 May 2022 16:54:40 +0200 Subject: Major blur rework: optimization & fixes Blur should be considerably faster now and work on full damage tracking --- src/render/OpenGL.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/render/OpenGL.hpp') diff --git a/src/render/OpenGL.hpp b/src/render/OpenGL.hpp index 75d8e9c7..984180fb 100644 --- a/src/render/OpenGL.hpp +++ b/src/render/OpenGL.hpp @@ -23,6 +23,12 @@ inline const float fullVerts[] = { 1, 1, // bottom right 0, 1, // bottom left }; +inline const float fanVertsFull[] = { + -1.0f, -1.0f, + 1.0f, -1.0f, + 1.0f, 1.0f, + -1.0f, 1.0f +}; struct SCurrentRenderData { SMonitor* pMonitor = nullptr; @@ -34,6 +40,7 @@ struct SCurrentRenderData { struct SMonitorRenderData { CFramebuffer primaryFB; CFramebuffer mirrorFB; + CFramebuffer mirrorSwapFB; CTexture stencilTex; }; @@ -59,6 +66,7 @@ public: void clearWithTex(); void scissor(const wlr_box*); void scissor(const pixman_box32*); + void scissor(const int x, const int y, const int w, const int h); void destroyMonitorResources(SMonitor*); @@ -91,6 +99,9 @@ private: GLuint compileShader(const GLuint&, std::string); void createBGTextureForMonitor(SMonitor*); + // returns the out FB, can be either Mirror or MirrorSwap + CFramebuffer* blurMainFramebufferWithDamage(float a, wlr_box* pBox); + void renderTextureInternal(const CTexture&, wlr_box* pBox, float a, int round = 0, bool discardOpaque = false); void renderTextureWithBlurInternal(const CTexture&, wlr_box*, float a, int round = 0); -- cgit v1.2.3