aboutsummaryrefslogtreecommitdiff
path: root/system/shaders/GL
diff options
context:
space:
mode:
authorRainer Hochecker <fernetmenta@online.de>2017-10-01 20:18:24 +0200
committerRainer Hochecker <fernetmenta@online.de>2017-10-05 18:06:34 +0200
commitfb001182895d50ccf0270fc374c0beda5fb8a306 (patch)
treee0a266c7b223fee16748c587c368220314170fe4 /system/shaders/GL
parent21d2ed4099ea11cbc94879db2e8f8492c3cf8bd4 (diff)
OpenGL: migrate to 3.2 - next
Diffstat (limited to 'system/shaders/GL')
-rw-r--r--system/shaders/GL/1.2/gl_shader_frag_fonts.glsl2
-rw-r--r--system/shaders/GL/1.2/gl_streatch.glsl4
-rw-r--r--system/shaders/GL/1.2/gl_yuv2rgb_basic.glsl18
-rw-r--r--system/shaders/GL/1.5/gl_convolution-4x4.glsl44
-rw-r--r--system/shaders/GL/1.5/gl_convolution-6x6.glsl43
-rw-r--r--system/shaders/GL/1.5/gl_output.glsl33
-rw-r--r--system/shaders/GL/1.5/gl_shader_frag_default.glsl22
-rw-r--r--system/shaders/GL/1.5/gl_shader_frag_fonts.glsl30
-rw-r--r--system/shaders/GL/1.5/gl_shader_frag_multi.glsl24
-rw-r--r--system/shaders/GL/1.5/gl_shader_frag_multi_blendcolor.glsl24
-rw-r--r--system/shaders/GL/1.5/gl_shader_frag_texture.glsl24
-rw-r--r--system/shaders/GL/1.5/gl_shader_frag_texture_noblend.glsl24
-rw-r--r--system/shaders/GL/1.5/gl_shader_vert.glsl22
-rw-r--r--system/shaders/GL/1.5/gl_shader_vert_default.glsl22
-rw-r--r--system/shaders/GL/1.5/gl_streatch.glsl31
-rw-r--r--system/shaders/GL/1.5/gl_videofilter_frag.glsl28
-rw-r--r--system/shaders/GL/1.5/gl_videofilter_vertex.glsl28
-rw-r--r--system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl54
-rw-r--r--system/shaders/GL/1.5/gl_yuv2rgb_vertex.glsl42
19 files changed, 100 insertions, 419 deletions
diff --git a/system/shaders/GL/1.2/gl_shader_frag_fonts.glsl b/system/shaders/GL/1.2/gl_shader_frag_fonts.glsl
index fdc50c1130..eed605ffeb 100644
--- a/system/shaders/GL/1.2/gl_shader_frag_fonts.glsl
+++ b/system/shaders/GL/1.2/gl_shader_frag_fonts.glsl
@@ -30,5 +30,5 @@ void main ()
gl_FragColor.r = m_colour.r;
gl_FragColor.g = m_colour.g;
gl_FragColor.b = m_colour.b;
- gl_FragColor.a = m_colour.a * texture2D(m_samp0, m_cord0.xy).a;
+ gl_FragColor.a = m_colour.a * texture2D(m_samp0, m_cord0.xy).r;
}
diff --git a/system/shaders/GL/1.2/gl_streatch.glsl b/system/shaders/GL/1.2/gl_streatch.glsl
index dc42318d50..f27204fe8c 100644
--- a/system/shaders/GL/1.2/gl_streatch.glsl
+++ b/system/shaders/GL/1.2/gl_streatch.glsl
@@ -21,8 +21,8 @@
#version 120
uniform sampler2D img;
-uniform float m_stretch;
-varying vec2 m_cord;
+uniform float m_stretch;
+varying vec2 m_cord;
vec2 stretch(vec2 pos)
{
diff --git a/system/shaders/GL/1.2/gl_yuv2rgb_basic.glsl b/system/shaders/GL/1.2/gl_yuv2rgb_basic.glsl
index 268d8c6682..11738cf3cc 100644
--- a/system/shaders/GL/1.2/gl_yuv2rgb_basic.glsl
+++ b/system/shaders/GL/1.2/gl_yuv2rgb_basic.glsl
@@ -59,8 +59,8 @@ vec4 process()
vec4 yuv;
yuv.rgba = vec4( texture2D(m_sampY, stretch(m_cordY)).r
- , texture2D(m_sampU, stretch(m_cordU)).g
- , texture2D(m_sampV, stretch(m_cordV)).a
+ , texture2D(m_sampU, stretch(m_cordU)).r
+ , texture2D(m_sampV, stretch(m_cordV)).r
, 1.0 );
rgb = m_yuvmat * yuv;
@@ -68,14 +68,14 @@ vec4 process()
#elif defined(XBMC_NV12_RRG)
- vec4 yuv;
- yuv.rgba = vec4( texture2D(m_sampY, stretch(m_cordY)).r
- , texture2D(m_sampU, stretch(m_cordU)).r
- , texture2D(m_sampV, stretch(m_cordV)).g
- , 1.0 );
+ vec4 yuv;
+ yuv.rgba = vec4( texture2D(m_sampY, stretch(m_cordY)).r
+ , texture2D(m_sampU, stretch(m_cordU)).r
+ , texture2D(m_sampV, stretch(m_cordV)).g
+ , 1.0 );
- rgb = m_yuvmat * yuv;
- rgb.a = gl_Color.a;
+ rgb = m_yuvmat * yuv;
+ rgb.a = gl_Color.a;
#elif defined(XBMC_YUY2) || defined(XBMC_UYVY)
diff --git a/system/shaders/GL/1.5/gl_convolution-4x4.glsl b/system/shaders/GL/1.5/gl_convolution-4x4.glsl
index cf2a0f5378..02ff96d6f0 100644
--- a/system/shaders/GL/1.5/gl_convolution-4x4.glsl
+++ b/system/shaders/GL/1.5/gl_convolution-4x4.glsl
@@ -1,27 +1,10 @@
-/*
- * Copyright (C) 2010-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
+#version 150
uniform sampler2D img;
-uniform vec2 stepxy;
-uniform float m_stretch;
-varying vec2 m_cord;
+uniform vec2 stepxy;
+uniform float m_stretch;
+in vec2 m_cord;
+out vec4 fragColor;
#if (USE1DTEXTURE)
uniform sampler1D kernelTex;
@@ -41,15 +24,15 @@ half4 weight(float pos)
{
#if (HAS_FLOAT_TEXTURE)
#if (USE1DTEXTURE)
- return texture1D(kernelTex, pos);
+ return texture(kernelTex, pos);
#else
- return texture2D(kernelTex, vec2(pos, 0.5));
+ return texture(kernelTex, vec2(pos, 0.5));
#endif
#else
#if (USE1DTEXTURE)
- return texture1D(kernelTex, pos) * 2.0 - 1.0;
+ return texture(kernelTex, pos) * 2.0 - 1.0;
#else
- return texture2D(kernelTex, vec2(pos, 0.5)) * 2.0 - 1.0;
+ return texture(kernelTex, vec2(pos, 0.5)) * 2.0 - 1.0;
#endif
#endif
}
@@ -69,7 +52,7 @@ vec2 stretch(vec2 pos)
half3 pixel(float xpos, float ypos)
{
- return texture2D(img, vec2(xpos, ypos)).rgb;
+ return texture(img, vec2(xpos, ypos)).rgb;
}
half3 line (float ypos, vec4 xpos, half4 linetaps)
@@ -103,11 +86,6 @@ 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
-
+ rgb.a = fragColor.a;
return rgb;
}
diff --git a/system/shaders/GL/1.5/gl_convolution-6x6.glsl b/system/shaders/GL/1.5/gl_convolution-6x6.glsl
index c4f51fd431..814f536b30 100644
--- a/system/shaders/GL/1.5/gl_convolution-6x6.glsl
+++ b/system/shaders/GL/1.5/gl_convolution-6x6.glsl
@@ -1,27 +1,10 @@
-/*
- * Copyright (C) 2010-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
+#version 150
uniform sampler2D img;
-uniform vec2 stepxy;
-uniform float m_stretch;
-varying vec2 m_cord;
+uniform vec2 stepxy;
+uniform float m_stretch;
+in vec2 m_cord;
+out vec4 fragColor;
#if (USE1DTEXTURE)
uniform sampler1D kernelTex;
@@ -41,15 +24,15 @@ half3 weight(float pos)
{
#if (HAS_FLOAT_TEXTURE)
#if (USE1DTEXTURE)
- return texture1D(kernelTex, pos).rgb;
+ return texture(kernelTex, pos).rgb;
#else
- return texture2D(kernelTex, vec2(pos, 0.5)).rgb;
+ return texture(kernelTex, vec2(pos, 0.5)).rgb;
#endif
#else
#if (USE1DTEXTURE)
- return texture1D(kernelTex, pos).rgb * 2.0 - 1.0;
+ return texture(kernelTex, pos).rgb * 2.0 - 1.0;
#else
- return texture2D(kernelTex, vec2(pos, 0.5)).rgb * 2.0 - 1.0;
+ return texture(kernelTex, vec2(pos, 0.5)).rgb * 2.0 - 1.0;
#endif
#endif
}
@@ -69,7 +52,7 @@ vec2 stretch(vec2 pos)
half3 pixel(float xpos, float ypos)
{
- return texture2D(img, vec2(xpos, ypos)).rgb;
+ return texture(img, vec2(xpos, ypos)).rgb;
}
half3 line (float ypos, vec3 xpos1, vec3 xpos2, half3 linetaps1, half3 linetaps2)
@@ -114,11 +97,7 @@ 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
+ rgb.a = fragColor.a;
return rgb;
}
diff --git a/system/shaders/GL/1.5/gl_output.glsl b/system/shaders/GL/1.5/gl_output.glsl
index d3294a8bb5..98231026c3 100644
--- a/system/shaders/GL/1.5/gl_output.glsl
+++ b/system/shaders/GL/1.5/gl_output.glsl
@@ -1,24 +1,3 @@
-/*
- * Copyright (C) 2010-2017 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-
#if defined(XBMC_DITHER)
uniform sampler2D m_dither;
uniform float m_ditherquant;
@@ -31,18 +10,18 @@ uniform sampler3D m_CLUT;
void main()
{
- vec4 rgb = process();
+ vec4 rgb = process();
#if defined(KODI_3DLUT)
// FIXME: can this be optimized?
- rgb = texture3D(m_CLUT, (rgb.rgb*(m_CLUTsize-1.0) + 0.5) / m_CLUTsize);
+ rgb = texture(m_CLUT, (rgb.rgb*(m_CLUTsize-1.0) + 0.5) / m_CLUTsize);
#endif
#if defined(XBMC_FULLRANGE)
#if __VERSION__ <= 120
rgb = (rgb-(16.0/255.0)) * 255.0/219.0;
#else
- rgb = clamp((rgb-(16.0/255.0)) * 255.0/219.0, 0, 1);
+ rgb = clamp((rgb-(16.0/255.0)) * 255.0/219.0, 0, 1);
#endif
#endif
@@ -50,9 +29,9 @@ void main()
vec2 ditherpos = gl_FragCoord.xy / m_dithersize;
// ditherval is multiplied by 65536/(dither_size^2) to make it [0,1[
// FIXME: scale dither values before uploading?
- float ditherval = texture2D(m_dither, ditherpos).r * 16.0;
- rgb = floor(rgb * m_ditherquant + ditherval) / m_ditherquant;
+ float ditherval = texture(m_dither, ditherpos).r * 16.0;
+ rgb = floor(rgb * m_ditherquant + ditherval) / m_ditherquant;
#endif
- gl_FragColor = rgb;
+ fragColor = rgb;
}
diff --git a/system/shaders/GL/1.5/gl_shader_frag_default.glsl b/system/shaders/GL/1.5/gl_shader_frag_default.glsl
index b5abea273e..c6f1b8adcb 100644
--- a/system/shaders/GL/1.5/gl_shader_frag_default.glsl
+++ b/system/shaders/GL/1.5/gl_shader_frag_default.glsl
@@ -1,24 +1,4 @@
-/*
- * Copyright (C) 2010-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#version 130
+#version 150
uniform vec4 m_unicol;
out vec4 fragColor;
diff --git a/system/shaders/GL/1.5/gl_shader_frag_fonts.glsl b/system/shaders/GL/1.5/gl_shader_frag_fonts.glsl
index c1b977030a..4d017a432b 100644
--- a/system/shaders/GL/1.5/gl_shader_frag_fonts.glsl
+++ b/system/shaders/GL/1.5/gl_shader_frag_fonts.glsl
@@ -1,24 +1,4 @@
-/*
- * Copyright (C) 2010-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#version 130
+#version 150
uniform sampler2D m_samp0;
in vec4 m_cord0;
@@ -28,8 +8,8 @@ out vec4 fragColor;
// SM_FONTS shader
void main ()
{
- fragColor.r = m_colour.r;
- fragColor.g = m_colour.g;
- fragColor.b = m_colour.b;
- fragColor.a = m_colour.a * texture2D(m_samp0, m_cord0.xy).a;
+ fragColor.r = m_colour.r;
+ fragColor.g = m_colour.g;
+ fragColor.b = m_colour.b;
+ fragColor.a = m_colour.a * texture(m_samp0, m_cord0.xy).r;
}
diff --git a/system/shaders/GL/1.5/gl_shader_frag_multi.glsl b/system/shaders/GL/1.5/gl_shader_frag_multi.glsl
index fddffebf9d..c3a287a7de 100644
--- a/system/shaders/GL/1.5/gl_shader_frag_multi.glsl
+++ b/system/shaders/GL/1.5/gl_shader_frag_multi.glsl
@@ -1,24 +1,4 @@
-/*
- * Copyright (C) 2010-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#version 130
+#version 150
uniform sampler2D m_samp0;
uniform sampler2D m_samp1;
@@ -29,5 +9,5 @@ out vec4 fragColor;
// SM_MULTI shader
void main ()
{
- fragColor.rgba = (texture2D(m_samp0, m_cord0.xy) * texture2D(m_samp1, m_cord1.xy)).rgba;
+ fragColor.rgba = (texture(m_samp0, m_cord0.xy) * texture(m_samp1, m_cord1.xy)).rgba;
}
diff --git a/system/shaders/GL/1.5/gl_shader_frag_multi_blendcolor.glsl b/system/shaders/GL/1.5/gl_shader_frag_multi_blendcolor.glsl
index 5fc7c0f328..d4d352e81b 100644
--- a/system/shaders/GL/1.5/gl_shader_frag_multi_blendcolor.glsl
+++ b/system/shaders/GL/1.5/gl_shader_frag_multi_blendcolor.glsl
@@ -1,24 +1,4 @@
-/*
- * Copyright (C) 2010-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#version 130
+#version 150
uniform sampler2D m_samp0;
uniform sampler2D m_samp1;
@@ -30,5 +10,5 @@ out vec4 fragColor;
// SM_MULTI shader
void main ()
{
- fragColor.rgba = m_unicol * texture2D(m_samp0, m_cord0.xy) * texture2D(m_samp1, m_cord1.xy);
+ fragColor.rgba = m_unicol * texture(m_samp0, m_cord0.xy) * texture(m_samp1, m_cord1.xy);
}
diff --git a/system/shaders/GL/1.5/gl_shader_frag_texture.glsl b/system/shaders/GL/1.5/gl_shader_frag_texture.glsl
index 249beeff07..951018f5e1 100644
--- a/system/shaders/GL/1.5/gl_shader_frag_texture.glsl
+++ b/system/shaders/GL/1.5/gl_shader_frag_texture.glsl
@@ -1,24 +1,4 @@
-/*
- * Copyright (C) 2010-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#version 130
+#version 150
uniform sampler2D m_samp0;
uniform vec4 m_unicol;
@@ -28,5 +8,5 @@ out vec4 fragColor;
// SM_TEXTURE shader
void main ()
{
- fragColor.rgba = vec4(texture2D(m_samp0, m_cord0.xy).rgba * m_unicol);
+ fragColor.rgba = vec4(texture(m_samp0, m_cord0.xy).rgba * m_unicol);
}
diff --git a/system/shaders/GL/1.5/gl_shader_frag_texture_noblend.glsl b/system/shaders/GL/1.5/gl_shader_frag_texture_noblend.glsl
index 2a716843e4..321bff0ec3 100644
--- a/system/shaders/GL/1.5/gl_shader_frag_texture_noblend.glsl
+++ b/system/shaders/GL/1.5/gl_shader_frag_texture_noblend.glsl
@@ -1,24 +1,4 @@
-/*
- * Copyright (C) 2010-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#version 130
+#version 150
uniform sampler2D m_samp0;
in vec4 m_cord0;
@@ -27,5 +7,5 @@ out vec4 fragColor;
// SM_TEXTURE_NOBLEND shader
void main ()
{
- fragColor.rgba = vec4(texture2D(m_samp0, m_cord0.xy).rgba);
+ fragColor.rgba = vec4(texture(m_samp0, m_cord0.xy).rgba);
}
diff --git a/system/shaders/GL/1.5/gl_shader_vert.glsl b/system/shaders/GL/1.5/gl_shader_vert.glsl
index 8bd7fc228f..a8568310c2 100644
--- a/system/shaders/GL/1.5/gl_shader_vert.glsl
+++ b/system/shaders/GL/1.5/gl_shader_vert.glsl
@@ -1,24 +1,4 @@
-/*
- * Copyright (C) 2010-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#version 130
+#version 150
in vec4 m_attrpos;
in vec4 m_attrcol;
diff --git a/system/shaders/GL/1.5/gl_shader_vert_default.glsl b/system/shaders/GL/1.5/gl_shader_vert_default.glsl
index aaf01b75e1..e4f2d7c9ee 100644
--- a/system/shaders/GL/1.5/gl_shader_vert_default.glsl
+++ b/system/shaders/GL/1.5/gl_shader_vert_default.glsl
@@ -1,24 +1,4 @@
-/*
- * Copyright (C) 2010-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#version 130
+#version 150
in vec4 m_attrpos;
uniform mat4 m_proj;
diff --git a/system/shaders/GL/1.5/gl_streatch.glsl b/system/shaders/GL/1.5/gl_streatch.glsl
index dc42318d50..9972a7ce3b 100644
--- a/system/shaders/GL/1.5/gl_streatch.glsl
+++ b/system/shaders/GL/1.5/gl_streatch.glsl
@@ -1,28 +1,9 @@
-/*
- * Copyright (C) 2010-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#version 120
+#version 150
uniform sampler2D img;
-uniform float m_stretch;
-varying vec2 m_cord;
+uniform float m_stretch;
+in vec2 m_cord;
+out fragColor;
vec2 stretch(vec2 pos)
{
@@ -35,6 +16,6 @@ vec2 stretch(vec2 pos)
void main()
{
- gl_FragColor.rgb = texture2D(img, stretch(m_cord)).rgb;
- gl_FragColor.a = gl_Color.a;
+ fragColor.rgb = texture(img, stretch(m_cord)).rgb;
+ fragColor.a = gl_Color.a;
}
diff --git a/system/shaders/GL/1.5/gl_videofilter_frag.glsl b/system/shaders/GL/1.5/gl_videofilter_frag.glsl
index ff7af3b678..2d7ba2288c 100644
--- a/system/shaders/GL/1.5/gl_videofilter_frag.glsl
+++ b/system/shaders/GL/1.5/gl_videofilter_frag.glsl
@@ -1,30 +1,10 @@
-/*
- * Copyright (C) 2010-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#version 120
+#version 150
uniform sampler2D img;
-varying vec2 m_cord;
+in vec2 m_cord;
+out vec4 fragColor;
void main()
{
- gl_FragColor.rgb = texture2D(img, m_cord).rgb;
- gl_FragColor.a = gl_Color.a;
+ fragColor = texture(img, m_cord);
}
diff --git a/system/shaders/GL/1.5/gl_videofilter_vertex.glsl b/system/shaders/GL/1.5/gl_videofilter_vertex.glsl
index aa124b5350..edb8847a8f 100644
--- a/system/shaders/GL/1.5/gl_videofilter_vertex.glsl
+++ b/system/shaders/GL/1.5/gl_videofilter_vertex.glsl
@@ -1,28 +1,8 @@
-/*
- * Copyright (C) 2010-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
+#version 150
-#version 120
-
-attribute vec4 m_attrpos;
-attribute vec2 m_attrcord;
-varying vec2 m_cord;
+in vec4 m_attrpos;
+in vec2 m_attrcord;
+out vec2 m_cord;
uniform mat4 m_proj;
uniform mat4 m_model;
diff --git a/system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl b/system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl
index 268d8c6682..6b9f9b4161 100644
--- a/system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl
+++ b/system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl
@@ -1,22 +1,4 @@
-/*
- * Copyright (C) 2010-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
+#version 150
#if(XBMC_texture_rectangle)
# extension GL_ARB_texture_rectangle : enable
@@ -27,12 +9,13 @@
uniform sampler2D m_sampY;
uniform sampler2D m_sampU;
uniform sampler2D m_sampV;
-varying vec2 m_cordY;
-varying vec2 m_cordU;
-varying vec2 m_cordV;
-uniform vec2 m_step;
-uniform mat4 m_yuvmat;
-uniform float m_stretch;
+uniform vec2 m_step;
+uniform mat4 m_yuvmat;
+uniform float m_stretch;
+in vec2 m_cordY;
+in vec2 m_cordU;
+in vec2 m_cordV;
+out vec4 fragColor;
vec2 stretch(vec2 pos)
{
@@ -58,22 +41,21 @@ vec4 process()
#if defined(XBMC_YV12) || defined(XBMC_NV12)
vec4 yuv;
- yuv.rgba = vec4( texture2D(m_sampY, stretch(m_cordY)).r
- , texture2D(m_sampU, stretch(m_cordU)).g
- , texture2D(m_sampV, stretch(m_cordV)).a
+ yuv.rgba = vec4( texture(m_sampY, stretch(m_cordY)).r
+ , texture(m_sampU, stretch(m_cordU)).r
+ , texture(m_sampV, stretch(m_cordV)).r
, 1.0 );
rgb = m_yuvmat * yuv;
- rgb.a = gl_Color.a;
+ rgb.a = fragColor.a;
#elif defined(XBMC_NV12_RRG)
vec4 yuv;
- yuv.rgba = vec4( texture2D(m_sampY, stretch(m_cordY)).r
- , texture2D(m_sampU, stretch(m_cordU)).r
- , texture2D(m_sampV, stretch(m_cordV)).g
+ yuv.rgba = vec4( texture(m_sampY, stretch(m_cordY)).r
+ , texture(m_sampU, stretch(m_cordU)).r
+ , texture(m_sampV, stretch(m_cordV)).g
, 1.0 );
-
rgb = m_yuvmat * yuv;
rgb.a = gl_Color.a;
@@ -93,8 +75,8 @@ vec4 process()
//y axis will be correctly interpolated by opengl
//x axis will not, so we grab two pixels at the center of two columns and interpolate ourselves
- vec4 c1 = texture2D(m_sampY, vec2(pos.x + (0.5 - f.x) * stepxy.x, pos.y));
- vec4 c2 = texture2D(m_sampY, vec2(pos.x + (1.5 - f.x) * stepxy.x, pos.y));
+ vec4 c1 = texture(m_sampY, vec2(pos.x + (0.5 - f.x) * stepxy.x, pos.y));
+ vec4 c2 = texture(m_sampY, vec2(pos.x + (1.5 - f.x) * stepxy.x, pos.y));
/* each pixel has two Y subpixels and one UV subpixel
YUV Y YUV
@@ -114,7 +96,7 @@ vec4 process()
vec4 yuv = vec4(outY, outUV, 1.0);
rgb = m_yuvmat * yuv;
- rgb.a = gl_Color.a;
+ rgb.a = fragColor.a;
#endif
diff --git a/system/shaders/GL/1.5/gl_yuv2rgb_vertex.glsl b/system/shaders/GL/1.5/gl_yuv2rgb_vertex.glsl
index cdf3c56a71..4772bd4172 100644
--- a/system/shaders/GL/1.5/gl_yuv2rgb_vertex.glsl
+++ b/system/shaders/GL/1.5/gl_yuv2rgb_vertex.glsl
@@ -1,38 +1,20 @@
-/*
- * Copyright (C) 2010-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
+#version 150
-attribute vec4 m_attrpos;
-attribute vec2 m_attrcordY;
-attribute vec2 m_attrcordU;
-attribute vec2 m_attrcordV;
-varying vec2 m_cordY;
-varying vec2 m_cordU;
-varying vec2 m_cordV;
uniform mat4 m_proj;
uniform mat4 m_model;
+in vec4 m_attrpos;
+in vec2 m_attrcordY;
+in vec2 m_attrcordU;
+in vec2 m_attrcordV;
+out vec2 m_cordY;
+out vec2 m_cordU;
+out vec2 m_cordV;
void main ()
{
- mat4 mvp = m_proj * m_model;
+ mat4 mvp = m_proj * m_model;
gl_Position = mvp * m_attrpos;
- m_cordY = m_attrcordY;
- m_cordU = m_attrcordU;
- m_cordV = m_attrcordV;
+ m_cordY = m_attrcordY;
+ m_cordU = m_attrcordU;
+ m_cordV = m_attrcordV;
}