renderer: add wrapping options to renderTextureWithBlur method (#10807)
This commit is contained in:
parent
2388874738
commit
8b1d5560cf
2 changed files with 8 additions and 6 deletions
|
|
@ -2133,7 +2133,7 @@ bool CHyprOpenGLImpl::shouldUseNewBlurOptimizations(PHLLS pLayer, PHLWINDOW pWin
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHyprOpenGLImpl::renderTextureWithBlur(SP<CTexture> tex, const CBox& box, float a, SP<CWLSurfaceResource> pSurface, int round, float roundingPower, bool blockBlurOptimization,
|
void CHyprOpenGLImpl::renderTextureWithBlur(SP<CTexture> tex, const CBox& box, float a, SP<CWLSurfaceResource> pSurface, int round, float roundingPower, bool blockBlurOptimization,
|
||||||
float blurA, float overallA) {
|
float blurA, float overallA, GLenum wrapX, GLenum wrapY) {
|
||||||
RASSERT(m_renderData.pMonitor, "Tried to render texture with blur without begin()!");
|
RASSERT(m_renderData.pMonitor, "Tried to render texture with blur without begin()!");
|
||||||
|
|
||||||
TRACY_GPU_ZONE("RenderTextureWithBlur");
|
TRACY_GPU_ZONE("RenderTextureWithBlur");
|
||||||
|
|
@ -2161,7 +2161,7 @@ void CHyprOpenGLImpl::renderTextureWithBlur(SP<CTexture> tex, const CBox& box, f
|
||||||
inverseOpaque.invert(&surfbox).intersect(0, 0, pSurface->m_current.size.x * pSurface->m_current.scale, pSurface->m_current.size.y * pSurface->m_current.scale);
|
inverseOpaque.invert(&surfbox).intersect(0, 0, pSurface->m_current.size.x * pSurface->m_current.scale, pSurface->m_current.size.y * pSurface->m_current.scale);
|
||||||
|
|
||||||
if (inverseOpaque.empty()) {
|
if (inverseOpaque.empty()) {
|
||||||
renderTexture(tex, box, a, round, roundingPower, false, true);
|
renderTexture(tex, box, a, round, roundingPower, false, true, wrapX, wrapY);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
|
@ -2197,7 +2197,7 @@ void CHyprOpenGLImpl::renderTextureWithBlur(SP<CTexture> tex, const CBox& box, f
|
||||||
if (USENEWOPTIMIZE && !(m_renderData.discardMode & DISCARD_ALPHA))
|
if (USENEWOPTIMIZE && !(m_renderData.discardMode & DISCARD_ALPHA))
|
||||||
renderRect(box, CHyprColor(0, 0, 0, 0), round, roundingPower);
|
renderRect(box, CHyprColor(0, 0, 0, 0), round, roundingPower);
|
||||||
else
|
else
|
||||||
renderTexture(tex, box, a, round, roundingPower, true, true); // discard opaque
|
renderTexture(tex, box, a, round, roundingPower, true, true, wrapX, wrapY); // discard opaque
|
||||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||||
|
|
||||||
glStencilFunc(GL_EQUAL, 1, 0xFF);
|
glStencilFunc(GL_EQUAL, 1, 0xFF);
|
||||||
|
|
@ -2223,7 +2223,8 @@ void CHyprOpenGLImpl::renderTextureWithBlur(SP<CTexture> tex, const CBox& box, f
|
||||||
pushMonitorTransformEnabled(true);
|
pushMonitorTransformEnabled(true);
|
||||||
if (!USENEWOPTIMIZE)
|
if (!USENEWOPTIMIZE)
|
||||||
setRenderModifEnabled(false);
|
setRenderModifEnabled(false);
|
||||||
renderTextureInternalWithDamage(POUTFB->getTexture(), box, (*PBLURIGNOREOPACITY ? blurA : a * blurA) * overallA, texDamage, round, roundingPower, false, false, true);
|
renderTextureInternalWithDamage(POUTFB->getTexture(), box, (*PBLURIGNOREOPACITY ? blurA : a * blurA) * overallA, texDamage, round, roundingPower, false, false, true, wrapX,
|
||||||
|
wrapY);
|
||||||
if (!USENEWOPTIMIZE)
|
if (!USENEWOPTIMIZE)
|
||||||
setRenderModifEnabled(true);
|
setRenderModifEnabled(true);
|
||||||
popMonitorTransformEnabled();
|
popMonitorTransformEnabled();
|
||||||
|
|
@ -2237,7 +2238,7 @@ void CHyprOpenGLImpl::renderTextureWithBlur(SP<CTexture> tex, const CBox& box, f
|
||||||
|
|
||||||
// draw window
|
// draw window
|
||||||
glDisable(GL_STENCIL_TEST);
|
glDisable(GL_STENCIL_TEST);
|
||||||
renderTextureInternalWithDamage(tex, box, a * overallA, texDamage, round, roundingPower, false, false, true, true);
|
renderTextureInternalWithDamage(tex, box, a * overallA, texDamage, round, roundingPower, false, false, true, true, wrapX, wrapY);
|
||||||
|
|
||||||
glStencilMask(0xFF);
|
glStencilMask(0xFF);
|
||||||
glStencilFunc(GL_ALWAYS, 1, 0xFF);
|
glStencilFunc(GL_ALWAYS, 1, 0xFF);
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
#include "../helpers/math/Math.hpp"
|
#include "../helpers/math/Math.hpp"
|
||||||
#include "../helpers/Format.hpp"
|
#include "../helpers/Format.hpp"
|
||||||
#include "../helpers/sync/SyncTimeline.hpp"
|
#include "../helpers/sync/SyncTimeline.hpp"
|
||||||
|
#include <GLES3/gl32.h>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
@ -189,7 +190,7 @@ class CHyprOpenGLImpl {
|
||||||
void renderTextureWithDamage(SP<CTexture>, const CBox&, const CRegion& damage, float a, int round = 0, float roundingPower = 2.0f, bool discardActive = false,
|
void renderTextureWithDamage(SP<CTexture>, const CBox&, const CRegion& damage, float a, int round = 0, float roundingPower = 2.0f, bool discardActive = false,
|
||||||
bool allowCustomUV = false);
|
bool allowCustomUV = false);
|
||||||
void renderTextureWithBlur(SP<CTexture>, const CBox&, float a, SP<CWLSurfaceResource> pSurface, int round = 0, float roundingPower = 2.0f, bool blockBlurOptimization = false,
|
void renderTextureWithBlur(SP<CTexture>, const CBox&, float a, SP<CWLSurfaceResource> pSurface, int round = 0, float roundingPower = 2.0f, bool blockBlurOptimization = false,
|
||||||
float blurA = 1.f, float overallA = 1.f);
|
float blurA = 1.f, float overallA = 1.f, GLenum wrapX = GL_CLAMP_TO_EDGE, GLenum wrapY = GL_CLAMP_TO_EDGE);
|
||||||
void renderRoundedShadow(const CBox&, int round, float roundingPower, int range, const CHyprColor& color, float a = 1.0);
|
void renderRoundedShadow(const CBox&, int round, float roundingPower, int range, const CHyprColor& color, float a = 1.0);
|
||||||
void renderBorder(const CBox&, const CGradientValueData&, int round, float roundingPower, int borderSize, float a = 1.0, int outerRound = -1 /* use round */);
|
void renderBorder(const CBox&, const CGradientValueData&, int round, float roundingPower, int borderSize, float a = 1.0, int outerRound = -1 /* use round */);
|
||||||
void renderBorder(const CBox&, const CGradientValueData&, const CGradientValueData&, float lerp, int round, float roundingPower, int borderSize, float a = 1.0,
|
void renderBorder(const CBox&, const CGradientValueData&, const CGradientValueData&, float lerp, int round, float roundingPower, int borderSize, float a = 1.0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue