[vlc-commits] [Git][videolan/vlc][master] 2 commits: opengl: renderer: fix input variable qualifier

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Fri Sep 8 08:28:21 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
e67f66ca by Francois Cartegnie at 2023-09-08T08:02:16+00:00
opengl: renderer: fix input variable qualifier

- - - - -
106a0246 by Francois Cartegnie at 2023-09-08T08:02:16+00:00
opengl: renderer: fix OpenGL ES 3.0 syntax

- - - - -


1 changed file:

- modules/video_output/opengl/renderer.c


Changes:

=====================================
modules/video_output/opengl/renderer.c
=====================================
@@ -180,9 +180,15 @@ opengl_link_program(struct vlc_gl_filter *filter)
     const opengl_vtable_t *vt = renderer->vt;
 
     static const char *const VERTEX_SHADER_BODY =
-        "attribute vec2 PicCoordsIn;\n"
-        "varying vec2 PicCoords;\n"
-        "attribute vec3 VertexPosition;\n"
+        "#if __VERSION__ < 300\n"
+          "attribute vec2 PicCoordsIn;\n"
+          "varying vec2 PicCoords;\n"
+          "attribute vec3 VertexPosition;\n"
+        "#else\n"
+          "in vec2 PicCoordsIn;\n"
+          "out vec2 PicCoords;\n"
+          "in vec3 VertexPosition;\n"
+        "#endif\n"
         "uniform mat3 StereoMatrix;\n"
         "uniform mat4 ProjectionMatrix;\n"
         "uniform mat4 ZoomMatrix;\n"
@@ -195,9 +201,15 @@ opengl_link_program(struct vlc_gl_filter *filter)
         "}\n";
 
     static const char *const FRAGMENT_SHADER_BODY =
-        "varying vec2 PicCoords;\n"
+        "#if __VERSION__ < 300\n"
+          "#define FragColor gl_FragColor\n"
+          "attribute vec2 PicCoords;\n"
+        "#else\n"
+          "in vec2 PicCoords;\n"
+          "out vec4 FragColor;\n"
+        "#endif\n"
         "void main() {\n"
-        " gl_FragColor = vlc_texture(PicCoords);\n"
+        " FragColor = vlc_texture(PicCoords);\n"
         "}\n";
 
     const char *extensions = sampler->shader.extensions



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d746c31d69157a11690d89592e7042a03d01f44c...106a0246e3d4036cbbd16d98002a3d9a80b9917a

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d746c31d69157a11690d89592e7042a03d01f44c...106a0246e3d4036cbbd16d98002a3d9a80b9917a
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list