diff options
author | Lukas Rusak <lorusak@gmail.com> | 2017-09-12 12:14:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-12 12:14:27 -0700 |
commit | aa6c18ecca47ce9ab3393f5f9259358924505e3f (patch) | |
tree | 6d167ca6b42f3e070da07e1a4a68e6d9218f468f /system | |
parent | fee5e9eb94c6b129c514b3fac7b71db71de4009a (diff) | |
parent | dc4cfa186cb4c687155a560d52693d702ef614b6 (diff) |
Merge pull request #12474 from lrusak/gles-hq-scalers
LinuxRendererGLES: implement hq scalers
Diffstat (limited to 'system')
-rw-r--r-- | system/shaders/convolution-4x4.glsl | 13 | ||||
-rw-r--r-- | system/shaders/convolution-6x6.glsl | 15 |
2 files changed, 27 insertions, 1 deletions
diff --git a/system/shaders/convolution-4x4.glsl b/system/shaders/convolution-4x4.glsl index d41b127294..6413cd6819 100644 --- a/system/shaders/convolution-4x4.glsl +++ b/system/shaders/convolution-4x4.glsl @@ -18,11 +18,19 @@ * */ +#ifdef GL_ES + precision highp float; +#endif + uniform sampler2D img; uniform vec2 stepxy; uniform float m_stretch; varying vec2 cord; +#ifdef GL_ES + uniform float m_alpha; +#endif + #if (USE1DTEXTURE) uniform sampler1D kernelTex; #else @@ -103,7 +111,12 @@ vec4 process() line(xystart.y + stepxy.y * 2.0, xpos, linetaps) * columntaps.b + line(xystart.y + stepxy.y * 3.0, xpos, linetaps) * columntaps.a; +#ifdef GL_ES + rgb.a = m_alpha; +#else rgb.a = gl_Color.a; +#endif + return rgb; } diff --git a/system/shaders/convolution-6x6.glsl b/system/shaders/convolution-6x6.glsl index 7c568c16ec..fed2332801 100644 --- a/system/shaders/convolution-6x6.glsl +++ b/system/shaders/convolution-6x6.glsl @@ -18,11 +18,19 @@ * */ +#ifdef GL_ES + precision highp float; +#endif + uniform sampler2D img; uniform vec2 stepxy; uniform float m_stretch; varying vec2 cord; +#ifdef GL_ES + uniform float m_alpha; +#endif + #if (USE1DTEXTURE) uniform sampler1D kernelTex; #else @@ -80,7 +88,7 @@ half3 line (float ypos, vec3 xpos1, vec3 xpos2, half3 linetaps1, half3 linetaps2 pixel(xpos1.b, ypos) * linetaps1.g + pixel(xpos2.r, ypos) * linetaps2.g + pixel(xpos2.g, ypos) * linetaps1.b + - pixel(xpos2.b, ypos) * linetaps2.b; + pixel(xpos2.b, ypos) * linetaps2.b; } vec4 process() @@ -114,7 +122,12 @@ vec4 process() line(xystart.y + stepxy.y * 4.0, xpos1, xpos2, linetaps1, linetaps2) * columntaps1.b + line(xystart.y + stepxy.y * 5.0, xpos1, xpos2, linetaps1, linetaps2) * columntaps2.b; +#ifdef GL_ES + rgb.a = m_alpha; +#else rgb.a = gl_Color.a; +#endif + return rgb; } |