[vlc-commits] gl: add is_gles

Thomas Guillem git at videolan.org
Wed Aug 30 13:54:16 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Aug 29 13:41:02 2017 +0200| [c98059c713e39e0e4b275f2be4d7fb79ccde162a] | committer: Thomas Guillem

gl: add is_gles

This allows for a converter to know dynamically the current OpenGL API.

Refs #18575

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

 modules/video_output/opengl/internal.h    | 2 ++
 modules/video_output/opengl/vout_helper.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/modules/video_output/opengl/internal.h b/modules/video_output/opengl/internal.h
index 4652487a77..444f80a04a 100644
--- a/modules/video_output/opengl/internal.h
+++ b/modules/video_output/opengl/internal.h
@@ -204,6 +204,8 @@ struct opengl_tex_converter_t
     /* Available gl extensions (from GL_EXTENSIONS) */
     const char *glexts;
 
+    /* True if the current API is OpenGL ES, set by the caller */
+    bool is_gles;
     /* GLSL version, set by the caller. 100 for GLSL ES, 120 for desktop GLSL */
     unsigned glsl_version;
     /* Precision header, set by the caller. In OpenGLES, the fragment language
diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index 35934ba521..63093dbe63 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -558,9 +558,11 @@ opengl_init_program(vout_display_opengl_t *vgl, struct prgm *prgm,
         .vt = &vgl->vt,
         .glexts = glexts,
 #if defined(USE_OPENGL_ES2)
+        .is_gles = true,
         .glsl_version = 100,
         .glsl_precision_header = "precision highp float;\n",
 #else
+        .is_gles = false,
         .glsl_version = 120,
         .glsl_precision_header = "",
 #endif



More information about the vlc-commits mailing list