From 7e4a73c8e4ed771b914f49a2de14b830469a470a Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 20 Mar 2017 04:57:51 +0100 Subject: vo_opengl: add a --opengl-es=force2 option Useful for testing. Unfortunately, the nVidia EGL driver ignores this, and returns a GLES 3.2 context anyway (which it is allowed to do). Might still be useable with ANGLE, which will really give you a GLES 2 context if you ask for it. --- video/out/opengl/context.h | 3 ++- video/out/opengl/egl_helpers.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'video/out/opengl') diff --git a/video/out/opengl/context.h b/video/out/opengl/context.h index ecb9d9c033..92b9da0432 100644 --- a/video/out/opengl/context.h +++ b/video/out/opengl/context.h @@ -27,12 +27,13 @@ #include "common.h" enum { - VOFLAG_GLES = 1 << 0, // Hint to create a GLES2 context + VOFLAG_GLES = 1 << 0, // Hint to create a GLES context VOFLAG_NO_GLES = 1 << 1, // Hint to create a desktop GL context VOFLAG_GL_DEBUG = 1 << 2, // Hint to request debug OpenGL context VOFLAG_ALPHA = 1 << 3, // Hint to request alpha framebuffer VOFLAG_SW = 1 << 4, // Hint to accept a software GL renderer VOFLAG_PROBING = 1 << 6, // The backend is being auto-probed. + VOFLAG_GLES2 = 1 << 7, // Hint for GLESv2 (needs VOFLAG_GLES) }; extern const int mpgl_preferred_gl_versions[]; diff --git a/video/out/opengl/egl_helpers.c b/video/out/opengl/egl_helpers.c index 2ed1fd44d6..d1ebd9aeca 100644 --- a/video/out/opengl/egl_helpers.c +++ b/video/out/opengl/egl_helpers.c @@ -181,12 +181,14 @@ bool mpegl_create_context_opts(EGLDisplay display, struct mp_log *log, return true; } - if (try_gles) { + if (try_gles && !(opts->vo_flags & VOFLAG_GLES2)) { // ES 3.x if (create_context(display, log, true, 3, opts, out_context, out_config)) return true; + } + if (try_gles) { // ES 2.0 if (create_context(display, log, probing, 2, opts, out_context, out_config)) -- cgit v1.2.3