mirror of
https://github.com/mpv-player/mpv
synced 2025-01-18 04:51:52 +00:00
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.)
This commit is contained in:
parent
9f65629bd0
commit
bdc60daffa
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user