From 1a0b2c4ade0b221a1fee013702fd01b8a794951b Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 26 Jun 2022 19:39:56 +0200 Subject: rewritten borders, fixed msaa --- src/render/OpenGL.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/render/OpenGL.hpp') diff --git a/src/render/OpenGL.hpp b/src/render/OpenGL.hpp index 9d6e098d..a70e382b 100644 --- a/src/render/OpenGL.hpp +++ b/src/render/OpenGL.hpp @@ -59,9 +59,10 @@ public: void renderRect(wlr_box*, const CColor&, int round = 0); void renderRectWithDamage(wlr_box*, const CColor&, pixman_region32_t* damage, int round = 0); void renderTexture(wlr_texture*, wlr_box*, float a, int round = 0); - void renderTexture(const CTexture&, wlr_box*, float a, int round = 0, bool discardOpaque = false, bool border = false, bool allowPrimary = false); - void renderTextureWithBlur(const CTexture&, wlr_box*, float a, wlr_surface* pSurface, int round = 0, bool border = false); + void renderTexture(const CTexture&, wlr_box*, float a, int round = 0, bool discardOpaque = false, bool allowPrimary = false); + void renderTextureWithBlur(const CTexture&, wlr_box*, float a, wlr_surface* pSurface, int round = 0); void renderRoundedShadow(wlr_box*, int round, int range, float a = 1.0); + void renderBorder(wlr_box*, const CColor&, int round); void makeWindowSnapshot(CWindow*); void makeLayerSnapshot(SLayerSurface*); @@ -108,6 +109,7 @@ private: CShader m_shBLUR1; CShader m_shBLUR2; CShader m_shSHADOW; + CShader m_shBORDER1; // GLuint createProgram(const std::string&, const std::string&); @@ -117,8 +119,7 @@ private: // returns the out FB, can be either Mirror or MirrorSwap CFramebuffer* blurMainFramebufferWithDamage(float a, wlr_box* pBox, pixman_region32_t* damage); - void renderTextureInternalWithDamage(const CTexture&, wlr_box* pBox, float a, pixman_region32_t* damage, int round = 0, bool discardOpaque = false, bool border = false, bool noAA = false, bool allowPrimary = false); - void renderBorder(wlr_box*, const CColor&, int thick = 1, int round = 0); + void renderTextureInternalWithDamage(const CTexture&, wlr_box* pBox, float a, pixman_region32_t* damage, int round = 0, bool discardOpaque = false, bool noAA = false, bool allowPrimary = false); }; inline std::unique_ptr g_pHyprOpenGL; \ No newline at end of file -- cgit v1.2.3 From 8820f7f210b1183c97dd58028093c27355a992e7 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 29 Jun 2022 12:54:53 +0200 Subject: optimization + revert one oopsie --- src/render/OpenGL.hpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/render/OpenGL.hpp') diff --git a/src/render/OpenGL.hpp b/src/render/OpenGL.hpp index a70e382b..79708fac 100644 --- a/src/render/OpenGL.hpp +++ b/src/render/OpenGL.hpp @@ -29,10 +29,20 @@ inline const float fanVertsFull[] = { -1.0f, 1.0f }; +struct SMonitorRenderData { + CFramebuffer primaryFB; + CFramebuffer mirrorFB; + CFramebuffer mirrorSwapFB; + + CTexture stencilTex; +}; + struct SCurrentRenderData { SMonitor* pMonitor = nullptr; float projection[9]; + SMonitorRenderData* pCurrentMonData = nullptr; + pixman_region32_t* pDamage = nullptr; bool renderingPrimarySurface = false; @@ -40,14 +50,6 @@ struct SCurrentRenderData { Vector2D primarySurfaceUVBottomRight = Vector2D(-1, -1); }; -struct SMonitorRenderData { - CFramebuffer primaryFB; - CFramebuffer mirrorFB; - CFramebuffer mirrorSwapFB; - - CTexture stencilTex; -}; - class CHyprOpenGLImpl { public: -- cgit v1.2.3 From a7ebf0ddc346756a89c0ea104e41d75ee752cb72 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 30 Jun 2022 12:39:10 +0200 Subject: added CPU uniform location lookup optimization --- src/render/OpenGL.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/render/OpenGL.hpp') diff --git a/src/render/OpenGL.hpp b/src/render/OpenGL.hpp index 79708fac..292eba36 100644 --- a/src/render/OpenGL.hpp +++ b/src/render/OpenGL.hpp @@ -104,7 +104,7 @@ private: bool m_bEndFrame = false; // Shaders - SQuad m_shQUAD; + CShader m_shQUAD; CShader m_shRGBA; CShader m_shRGBX; CShader m_shEXT; -- cgit v1.2.3