[client] add a MPV glsl style effect loader
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled

This commit is contained in:
Geoffrey McRae
2026-07-18 08:41:38 +10:00
parent d206e788af
commit 6a9957650c
22 changed files with 1494 additions and 45 deletions

View File

@@ -205,6 +205,35 @@ bool egl_effectPassSetup(EGL_EffectPass * pass, enum EGL_PixelFormat pixFmt,
return true;
}
EGL_Texture * egl_effectPassGetTexture(EGL_EffectPass * pass)
{
return pass->configured ? egl_framebufferGetTexture(pass->framebuffer) : NULL;
}
EGL_Texture * egl_effectPassRun(EGL_EffectPass * pass, EGL_FilterRects * rects,
EGL_Texture * const * textures, unsigned int textureCount)
{
if (!pass->configured || !pass->shader || !textureCount)
{
DEBUG_ERROR("Attempted to run an unconfigured EGL effect pass");
return NULL;
}
egl_framebufferBind(pass->framebuffer);
for (unsigned int i = 0; i < textureCount; ++i)
if (egl_textureBindUnitWithSampler(textures[i], i, pass->sampler) !=
EGL_TEX_STATUS_OK)
return NULL;
egl_uniformMatrix3x2fv(pass->uTransform, 1, GL_FALSE, rects->matrix);
egl_uniform2f(pass->uDesktopSize, rects->width, rects->height);
egl_shaderUse(pass->shader);
egl_desktopRectsRender(rects->rects);
return egl_framebufferGetTexture(pass->framebuffer);
}
EGL_Texture * egl_effectRun(EGL_Effect * effect, EGL_FilterRects * rects,
EGL_Texture * texture)
{
@@ -213,22 +242,9 @@ EGL_Texture * egl_effectRun(EGL_Effect * effect, EGL_FilterRects * rects,
if (!pass->enabled)
continue;
if (!pass->configured || !pass->shader)
{
DEBUG_ERROR("Attempted to run an unconfigured EGL effect pass");
texture = egl_effectPassRun(pass, rects, &texture, 1);
if (!texture)
return NULL;
}
egl_framebufferBind(pass->framebuffer);
egl_textureBindWithSampler(texture, pass->sampler);
egl_uniformMatrix3x2fv(pass->uTransform, 1, GL_FALSE, rects->matrix);
egl_uniform2f(pass->uDesktopSize, rects->width, rects->height);
egl_shaderUse(pass->shader);
egl_desktopRectsRender(rects->rects);
texture = egl_framebufferGetTexture(pass->framebuffer);
}
return texture;