summaryrefslogtreecommitdiffstats
path: root/video/out/gl_common.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-19 01:03:08 +0100
committerwm4 <wm4@nowhere>2014-12-19 01:21:19 +0100
commita0051b9da28fb67cebae1fef322603ddb8f619f8 (patch)
tree206133468f186beb262e4a35d3462f06882df465 /video/out/gl_common.c
parentfe35130ba9079c09c74a5f5334584f1ccca15e52 (diff)
downloadmpv-a0051b9da28fb67cebae1fef322603ddb8f619f8.tar.bz2
mpv-a0051b9da28fb67cebae1fef322603ddb8f619f8.tar.xz
vo_opengl: add GLES 2 support
Rather basic support. Almost nothing works, and even if it does, it's bound to be inefficient (due to texture upload). This was tested with the nVidia desktop binary drivers, which provide GLES 2 support only. However, nVidia is not known to be very strict about OpenGL, and the driver is very new too, so the vo_opengl code will have bugs too.
Diffstat (limited to 'video/out/gl_common.c')
-rw-r--r--video/out/gl_common.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/video/out/gl_common.c b/video/out/gl_common.c
index aa5cd763ae..a8d08d1c4a 100644
--- a/video/out/gl_common.c
+++ b/video/out/gl_common.c
@@ -510,11 +510,9 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n),
if (gl->es) {
gl->es = gl->version;
- if (gl->version >= 300) {
- gl->version = 300; // pretend it's desktop OpenGL 3.0
- } else {
- mp_warn(log, "At least GLESv3 required.\n");
- gl->version = 0;
+ gl->version = 0;
+ if (gl->es < 200) {
+ mp_fatal(log, "At least GLESv2 required.\n");
return;
}
}
@@ -532,7 +530,7 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n),
// and above.
bool has_legacy = false;
- if (gl->version >= MPGL_VER(3, 0)) {
+ if (gl->version >= 300) {
gl->GetStringi = get_fn(fn_ctx, "glGetStringi");
gl->GetIntegerv = get_fn(fn_ctx, "glGetIntegerv");
@@ -550,7 +548,7 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n),
// This version doesn't have GL_ARB_compatibility yet, and always
// includes legacy (except with CONTEXT_FORWARD_COMPATIBLE_BIT_ARB).
- if (gl->version == MPGL_VER(3, 0) && !gl->es)
+ if (gl->version == 300)
has_legacy = true;
} else {
const char *ext = (char*)gl->GetString(GL_EXTENSIONS);
@@ -559,6 +557,9 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n),
has_legacy = true;
}
+ if (gl->es)
+ has_legacy = false;
+
if (has_legacy)
mp_verbose(log, "OpenGL legacy compat. found.\n");
mp_dbg(log, "Combined OpenGL extensions string:\n%s\n", gl->extensions);
@@ -631,6 +632,8 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n),
gl->glsl_version = 0;
if (gl->es) {
+ if (gl->es >= 200)
+ gl->glsl_version = 100;
if (gl->es >= 300)
gl->glsl_version = 300;
} else {