[client] egl: provide the texture scale to the desktop shader

If the texture has a post-processing filter that has scaled the texture,
the desktop fragment shader needs to know this if it's doing linear
scaling.
This commit is contained in:
Geoffrey McRae
2021-08-09 18:22:28 +10:00
parent f7f8060447
commit 6882e5c59f
4 changed files with 23 additions and 6 deletions

View File

@@ -43,6 +43,7 @@ struct DesktopShader
EGL_Shader * shader;
GLint uTransform;
GLint uDesktopSize;
GLint uTextureScale;
GLint uScaleAlgo;
GLint uNVGain;
GLint uCBMode;
@@ -95,11 +96,12 @@ static bool egl_initDesktopShader(
return false;
}
shader->uTransform = egl_shaderGetUniform(shader->shader, "transform");
shader->uDesktopSize = egl_shaderGetUniform(shader->shader, "size" );
shader->uScaleAlgo = egl_shaderGetUniform(shader->shader, "scaleAlgo");
shader->uNVGain = egl_shaderGetUniform(shader->shader, "nvGain" );
shader->uCBMode = egl_shaderGetUniform(shader->shader, "cbMode" );
shader->uTransform = egl_shaderGetUniform(shader->shader, "transform" );
shader->uDesktopSize = egl_shaderGetUniform(shader->shader, "size" );
shader->uTextureScale = egl_shaderGetUniform(shader->shader, "textureScale");
shader->uScaleAlgo = egl_shaderGetUniform(shader->shader, "scaleAlgo" );
shader->uNVGain = egl_shaderGetUniform(shader->shader, "nvGain" );
shader->uCBMode = egl_shaderGetUniform(shader->shader, "cbMode" );
return true;
}
@@ -356,6 +358,11 @@ bool egl_desktopRender(EGL_Desktop * desktop, const float x, const float y,
.location = shader->uDesktopSize,
.f = { desktop->width, desktop->height },
},
{
.type = EGL_UNIFORM_TYPE_1F,
.location = shader->uTextureScale,
.f = { egl_textureGetScale(desktop->texture) },
},
{
.type = EGL_UNIFORM_TYPE_M3x2FV,
.location = shader->uTransform,