summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-03-18 16:35:22 +0000
committerVaxry <vaxry@vaxry.net>2024-03-18 16:35:22 +0000
commit5eb33ff4d866ab64e5db33725473dc020fe355c1 (patch)
treee777d721bc71c1fd668f64a31a8485aecb941b7e /src/render/OpenGL.cpp
parent7587cadd0a4e94c9ba42c00307854052798cf9b2 (diff)
screenshader: add screen_size uniform
fixes #5059
Diffstat (limited to 'src/render/OpenGL.cpp')
-rw-r--r--src/render/OpenGL.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index f79a10d1..c06c81dc 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -558,6 +558,7 @@ void CHyprOpenGLImpl::applyScreenShader(const std::string& path) {
m_sFinalScreenShader.tex = glGetUniformLocation(m_sFinalScreenShader.program, "tex");
m_sFinalScreenShader.time = glGetUniformLocation(m_sFinalScreenShader.program, "time");
m_sFinalScreenShader.wl_output = glGetUniformLocation(m_sFinalScreenShader.program, "wl_output");
+ m_sFinalScreenShader.fullSize = glGetUniformLocation(m_sFinalScreenShader.program, "screen_size");
if (m_sFinalScreenShader.time != -1 && *PDT != 0 && !g_pHyprRenderer->m_bCrashingInProgress) {
// The screen shader uses the "time" uniform
// Since the screen shader could change every frame, damage tracking *needs* to be disabled
@@ -852,6 +853,8 @@ void CHyprOpenGLImpl::renderTextureInternalWithDamage(const CTexture& tex, CBox*
if (usingFinalShader && shader->wl_output != -1)
glUniform1i(shader->wl_output, m_RenderData.pMonitor->ID);
+ if (usingFinalShader && shader->fullSize != -1)
+ glUniform2f(shader->fullSize, m_RenderData.pMonitor->vecPixelSize.x, m_RenderData.pMonitor->vecPixelSize.y);
if (CRASHING) {
glUniform1f(shader->distort, g_pHyprRenderer->m_fCrashingDistort);