[client] egl: always render desktop texture as opaque

We ask for 32-bit colour buffer when creating the EGL context. On Wayland,
this sometimes give contexts with alpha channels, resulting in unwanted
transparency. So we clear the alpha channel in the desktop shader.

We also switch to using constant alpha for blending the splash, which
avoids more alpha issues.
This commit is contained in:
Quantum
2021-01-26 21:49:22 -05:00
committed by Geoffrey McRae
parent 9f0b99dac0
commit 8559b354ae
6 changed files with 9 additions and 19 deletions

View File

@@ -45,7 +45,6 @@ struct EGL_Splash
EGL_Model * logo;
// uniforms
GLint uBGAlpha;
GLint uScale;
};
@@ -74,8 +73,6 @@ bool egl_splash_init(EGL_Splash ** splash)
return false;
}
(*splash)->uBGAlpha = egl_shader_get_uniform_location((*splash)->bgShader, "alpha");
if (!egl_model_init(&(*splash)->bg))
{
DEBUG_ERROR("Failed to intiailize the splash bg model");
@@ -166,14 +163,14 @@ void egl_splash_free(EGL_Splash ** splash)
void egl_splash_render(EGL_Splash * splash, float alpha, float scaleY)
{
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBlendColor(0, 0, 0, alpha);
glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA);
egl_shader_use(splash->bgShader);
glUniform1f(splash->uBGAlpha, alpha);
egl_model_render(splash->bg);
egl_shader_use(splash->logoShader);
glUniform2f(splash->uScale, alpha, scaleY);
glUniform1f(splash->uScale, scaleY);
egl_model_render(splash->logo);
glDisable(GL_BLEND);