summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-07-24 23:34:43 +0200
committerwm4 <wm4@nowhere>2015-07-24 23:34:43 +0200
commitbdc60daffaaa71034684307606d0ec320649829c (patch)
tree5dfea6dcba8af44b489f49c80c46ad198c1bdb22
parent9f65629bd07b21a2fc1cdf2bb64122f5a8370327 (diff)
downloadmpv-bdc60daffaaa71034684307606d0ec320649829c.tar.bz2
mpv-bdc60daffaaa71034684307606d0ec320649829c.tar.xz
vo_opengl: remove legacy GL detection
This detected whether an OpenGL context still provided legacy OpenGL if the OpenGL version is modern (>= 3.0). This was actually only needed for vo_opengl_old, because it relied on legacy functions. Since it's gone, this code isn't needed either. (Also, the removed comment about OpenGL 3.0 was wrong: you could just query GL_CONTEXT_FLAGS and see if the forward compatible bit was set.)
-rw-r--r--video/out/gl_common.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/video/out/gl_common.c b/video/out/gl_common.c
index d497cd2613..5f898b3c46 100644
--- a/video/out/gl_common.c
+++ b/video/out/gl_common.c
@@ -356,12 +356,6 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n),
if (shader)
mp_verbose(log, "GL_SHADING_LANGUAGE_VERSION='%s'\n", shader);
- // Note: This code doesn't handle CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
- // on OpenGL 3.0 correctly. Apparently there's no way to detect this
- // situation, because GL_ARB_compatibility is specified only for 3.1
- // and above.
-
- bool has_legacy = false;
if (gl->version >= 300) {
gl->GetStringi = get_fn(fn_ctx, "glGetStringi");
gl->GetIntegerv = get_fn(fn_ctx, "glGetIntegerv");
@@ -374,26 +368,13 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n),
for (int n = 0; n < exts; n++) {
const char *ext = gl->GetStringi(GL_EXTENSIONS, n);
gl->extensions = talloc_asprintf_append(gl->extensions, " %s", ext);
- if (strcmp(ext, "GL_ARB_compatibility") == 0)
- has_legacy = true;
}
- // This version doesn't have GL_ARB_compatibility yet, and always
- // includes legacy (except with CONTEXT_FORWARD_COMPATIBLE_BIT_ARB).
- if (gl->version == 300)
- has_legacy = true;
} else {
const char *ext = (char*)gl->GetString(GL_EXTENSIONS);
gl->extensions = talloc_asprintf_append(gl->extensions, " %s", ext);
-
- 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);
for (int n = 0; n < sizeof(gl_functions) / sizeof(gl_functions[0]); n++) {
@@ -402,10 +383,7 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n),
int ver_core = gl->es ? section->ver_es_core : section->ver_core;
int ver_removed = gl->es ? section->ver_es_removed : section->ver_removed;
- // With has_legacy, the legacy functions are still available, and
- // functions are never actually removed. (E.g. the context could be at
- // version >= 3.0, but functions like glBegin still exist and work.)
- if (!has_legacy && ver_removed && version >= ver_removed)
+ if (ver_removed && version >= ver_removed)
continue;
// NOTE: Function entrypoints can exist, even if they do not work.