[vlc-commits] opengl: Fix sub renderer shaders for non OpenGL ES

Marvin Scholz git at videolan.org
Mon Feb 17 11:32:28 CET 2020


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Sat Feb 15 01:59:02 2020 +0100| [b1cc5951b72f0f427b149fff1dafd61ba07512c2] | committer: Thomas Guillem

opengl: Fix sub renderer shaders for non OpenGL ES

Fixes a regression causing failure to compile these shaders on macOS,
introduced in 7b37967062de2a23dd6bca82ec5d7574e3783a05

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b1cc5951b72f0f427b149fff1dafd61ba07512c2
---

 modules/video_output/opengl/sub_renderer.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/video_output/opengl/sub_renderer.c b/modules/video_output/opengl/sub_renderer.c
index f91e663eec..f25900fd1c 100644
--- a/modules/video_output/opengl/sub_renderer.c
+++ b/modules/video_output/opengl/sub_renderer.c
@@ -147,7 +147,11 @@ static GLuint
 CreateProgram(vlc_object_t *obj, const opengl_vtable_t *vt)
 {
     static const char *const VERTEX_SHADER_SRC =
+#if defined(USE_OPENGL_ES2)
         "#version 100\n"
+#else
+        "#version 120\n"
+#endif
         "attribute vec2 vertex_pos;\n"
         "attribute vec2 tex_coords_in;\n"
         "varying vec2 tex_coords;\n"
@@ -157,8 +161,12 @@ CreateProgram(vlc_object_t *obj, const opengl_vtable_t *vt)
         "}\n";
 
     static const char *const FRAGMENT_SHADER_SRC =
+#if defined(USE_OPENGL_ES2)
         "#version 100\n"
         "precision mediump float;\n"
+#else
+        "#version 120\n"
+#endif
         "uniform sampler2D sampler;\n"
         "uniform float alpha;\n"
         "varying vec2 tex_coords;\n"



More information about the vlc-commits mailing list