[client] egl: make use of glsl's textureSize function

This commit is contained in:
Geoffrey McRae 2021-11-12 07:41:59 +11:00
parent a21eee26ab
commit 8167ef2c4a
2 changed files with 2 additions and 9 deletions

View File

@ -46,7 +46,6 @@ struct DesktopShader
EGL_Shader * shader; EGL_Shader * shader;
GLint uTransform; GLint uTransform;
GLint uDesktopSize; GLint uDesktopSize;
GLint uTextureSize;
GLint uScaleAlgo; GLint uScaleAlgo;
GLint uNVGain; GLint uNVGain;
GLint uCBMode; GLint uCBMode;
@ -105,7 +104,6 @@ static bool egl_initDesktopShader(
shader->uTransform = egl_shaderGetUniform(shader->shader, "transform" ); shader->uTransform = egl_shaderGetUniform(shader->shader, "transform" );
shader->uDesktopSize = egl_shaderGetUniform(shader->shader, "desktopSize"); shader->uDesktopSize = egl_shaderGetUniform(shader->shader, "desktopSize");
shader->uTextureSize = egl_shaderGetUniform(shader->shader, "textureSize");
shader->uScaleAlgo = egl_shaderGetUniform(shader->shader, "scaleAlgo" ); shader->uScaleAlgo = egl_shaderGetUniform(shader->shader, "scaleAlgo" );
shader->uNVGain = egl_shaderGetUniform(shader->shader, "nvGain" ); shader->uNVGain = egl_shaderGetUniform(shader->shader, "nvGain" );
shader->uCBMode = egl_shaderGetUniform(shader->shader, "cbMode" ); shader->uCBMode = egl_shaderGetUniform(shader->shader, "cbMode" );
@ -428,11 +426,6 @@ bool egl_desktopRender(EGL_Desktop * desktop, unsigned int outputWidth,
.location = shader->uDesktopSize, .location = shader->uDesktopSize,
.f = { desktop->width, desktop->height }, .f = { desktop->width, desktop->height },
}, },
{
.type = EGL_UNIFORM_TYPE_2I,
.location = shader->uTextureSize,
.i = { finalSizeX, finalSizeY },
},
{ {
.type = EGL_UNIFORM_TYPE_M3x2FV, .type = EGL_UNIFORM_TYPE_M3x2FV,
.location = shader->uTransform, .location = shader->uTransform,

View File

@ -14,7 +14,6 @@ out vec4 color;
uniform sampler2D sampler1; uniform sampler2D sampler1;
uniform int scaleAlgo; uniform int scaleAlgo;
uniform ivec2 textureSize;
uniform float nvGain; uniform float nvGain;
uniform int cbMode; uniform int cbMode;
@ -24,7 +23,8 @@ void main()
switch (scaleAlgo) switch (scaleAlgo)
{ {
case EGL_SCALE_NEAREST: case EGL_SCALE_NEAREST:
color = texelFetch(sampler1, ivec2(uv * vec2(textureSize)), 0); vec2 ts = vec2(textureSize(sampler1, 0));
color = texelFetch(sampler1, ivec2(uv * ts), 0);
break; break;
case EGL_SCALE_LINEAR: case EGL_SCALE_LINEAR: