From b7277d25e54757b9cb57ac4727776b7aa5fc59ec Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 19 Dec 2014 18:54:21 +0100 Subject: 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. --- video/out/gl_common.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'video') 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; } } -- cgit v1.2.3