mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-09 20:24:14 +00:00
[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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user