mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[client] egl: fixes to shader post-process pipeline
This commit is contained in:
parent
cd5ecf3e5a
commit
f78154d282
@ -338,7 +338,7 @@ void egl_desktopConfigUI(EGL_Desktop * desktop)
|
||||
egl_textureEnableFilter(desktop->ffxFSR1Handle[1],
|
||||
fsr1 && desktop->upscale);
|
||||
}
|
||||
desktop->ffxFSR1Uniform.f[0] = fsr1Sharpness;
|
||||
desktop->ffxFSR1Uniform.f[0] = 2.0f - fsr1Sharpness * 2.0f;
|
||||
egl_shaderSetUniforms(desktop->ffxFSR1[1], &desktop->ffxFSR1Uniform, 1);
|
||||
invalidateTex = true;
|
||||
}
|
||||
@ -492,6 +492,12 @@ bool egl_desktopRender(EGL_Desktop * desktop, const float x, const float y,
|
||||
|
||||
int scaleAlgo = EGL_SCALE_NEAREST;
|
||||
|
||||
struct Rect finalSize;
|
||||
egl_textureBind(desktop->texture);
|
||||
egl_textureGetFinalSize(desktop->texture, &finalSize);
|
||||
if (finalSize.x > desktop->width || finalSize.y > desktop->height)
|
||||
scaleType = EGL_DESKTOP_DOWNSCALE;
|
||||
|
||||
switch (desktop->scaleAlgo)
|
||||
{
|
||||
case EGL_SCALE_AUTO:
|
||||
@ -512,10 +518,6 @@ bool egl_desktopRender(EGL_Desktop * desktop, const float x, const float y,
|
||||
scaleAlgo = desktop->scaleAlgo;
|
||||
}
|
||||
|
||||
struct Rect finalSize;
|
||||
egl_textureBind(desktop->texture);
|
||||
egl_textureGetFinalSize(desktop->texture, &finalSize);
|
||||
|
||||
egl_desktopRectsMatrix((float *)desktop->matrix->data,
|
||||
desktop->width, desktop->height, x, y, scaleX, scaleY, rotate);
|
||||
egl_desktopRectsUpdate(desktop->mesh, rects, desktop->width, desktop->height);
|
||||
|
@ -26,10 +26,10 @@ void FsrRcasInputF(inout AF1 r, inout AF1 g, inout AF1 b) {}
|
||||
void main()
|
||||
{
|
||||
vec2 inRes = vec2(uInRes[0]);
|
||||
uvec2 point = uvec2(iFragCoord * inRes);
|
||||
uvec2 point = uvec2(iFragCoord * (inRes + 0.5f));
|
||||
|
||||
uvec4 const0;
|
||||
FsrRcasCon(const0, 1.0f - uSharpness);
|
||||
FsrRcasCon(const0, uSharpness);
|
||||
|
||||
FsrRcasF(fragColor.r, fragColor.g, fragColor.b, point, const0);
|
||||
fragColor.a = 1.0f;
|
||||
|
@ -265,7 +265,7 @@ static bool rbBindTexture(int index, void * value, void * udata)
|
||||
|
||||
glActiveTexture(GL_TEXTURE0 + index);
|
||||
glBindTexture(GL_TEXTURE_2D, bi->tex);
|
||||
glBindSampler(0, bd->sampler);
|
||||
glBindSampler(index, bd->sampler);
|
||||
bd->dimensions[index * 2 + 0] = bi->width;
|
||||
bd->dimensions[index * 2 + 1] = bi->height;
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user