summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-19 18:54:21 +0100
committerwm4 <wm4@nowhere>2014-12-19 18:54:39 +0100
commitb7277d25e54757b9cb57ac4727776b7aa5fc59ec (patch)
treef02e58c677f034a916112855704ef69d9c94f43e /video
parent88982f2855590cafb1fdce916384751ae728ba0c (diff)
downloadmpv-b7277d25e54757b9cb57ac4727776b7aa5fc59ec.tar.bz2
mpv-b7277d25e54757b9cb57ac4727776b7aa5fc59ec.tar.xz
vo_opengl: fail if required functions are missing
Before this, missing additional but required functions were ignored. ("Main" functions still made it error out.) But we pretty much expect that these are present on a given version level, and only an extremely buggy OpenGL implementation would not do this.
Diffstat (limited to 'video')
-rw-r--r--video/out/gl_common.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/video/out/gl_common.c b/video/out/gl_common.c
index 73b29c4495..7d043fb9ae 100644
--- a/video/out/gl_common.c
+++ b/video/out/gl_common.c
@@ -569,9 +569,9 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n),
// NOTE: Function entrypoints can exist, even if they do not work.
// We must always check extension strings and versions.
- bool exists = false;
+ bool exists = false, must_exist = false;
if (ver_core)
- exists = version >= ver_core;
+ must_exist = version >= ver_core;
if (section->extension && strstr(gl->extensions, section->extension))
exists = true;
@@ -579,6 +579,7 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n),
if (section->partial_ok)
exists = true; // possibly
+ exists |= must_exist;
if (!exists)
continue;
@@ -597,11 +598,15 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n),
if (!ptr) {
all_loaded = false;
if (!section->partial_ok) {
- mp_msg(log, MSGL_V, "Required function '%s' not "
- "found for %s/%d.%d.\n", fn->funcnames[0],
- section->extension ? section->extension : "native",
+ mp_warn(log, "Required function '%s' not "
+ "found for %s OpenGL %d.%d.\n", fn->funcnames[0],
+ section->extension ? section->extension : "builtin",
MPGL_VER_GET_MAJOR(ver_core),
MPGL_VER_GET_MINOR(ver_core));
+ if (must_exist) {
+ gl->mpgl_caps = 0;
+ return;
+ }
break;
}
}