summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-11-20 17:52:32 +0100
committerwm4 <wm4@nowhere>2012-11-20 18:00:16 +0100
commit670a4a85a9bb305f6757cafcfe0f88c89c1f5bc2 (patch)
tree29cf78e7361e6bb4f4ec30b6bb7c0e9d5c60c6c2 /video
parentef75d0ff260fff688c23e72f86d437d8d1e59a58 (diff)
downloadmpv-670a4a85a9bb305f6757cafcfe0f88c89c1f5bc2.tar.bz2
mpv-670a4a85a9bb305f6757cafcfe0f88c89c1f5bc2.tar.xz
gl_common: improve Mesa compatibility for GL3 context creation
Don't request CONTEXT_FORWARD_COMPATIBLE when creating a GL3 context on X11. This improves compatibility with some Mesa drivers. Setting this bit was originally intended to make the code compatible to newer (future, possibly not yet existing) OpenGL implementations. These implementations wouldn't have to support deprecated legacy GL features, which we know that we don't use, and could return a context with a higher OpenGL version than requested. In practice, this didn't work out. CONTEXT_FORWARD_COMPATIBLE requires the driver to explicitly disable deprecated functionality. If it doesn't do that, it has to reject context creation with that flag set. And it turns out there are Mesa drivers which suffer from this caveat. See [1]. This probably also means that a GL application with a fixed set of required GL features (such as a subset of GL 3.2 core, like vo_opengl.c) may need to probe several GL versions if drivers really start dropping legacy GL. On Windows, CONTEXT_FORWARD_COMPATIBLE is still set. It is not known if this is ideal, but fortunately there is no Mesa on Windows. CONTEXT_CORE_PROFILE is still always set. For requested GL versions lower than 3.2, this flag is ignored. Should we requires higher versions later, we want it to be set, so don't remove it. [1] https://bugs.freedesktop.org/show_bug.cgi?id=57241
Diffstat (limited to 'video')
-rw-r--r--video/out/gl_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/gl_common.c b/video/out/gl_common.c
index 8f4ef3525a..06c208f36e 100644
--- a/video/out/gl_common.c
+++ b/video/out/gl_common.c
@@ -2402,8 +2402,8 @@ static bool create_window_x11_gl3(struct MPGLContext *ctx, uint32_t d_width,
GLX_CONTEXT_MAJOR_VERSION_ARB, MPGL_VER_GET_MAJOR(gl_version),
GLX_CONTEXT_MINOR_VERSION_ARB, MPGL_VER_GET_MINOR(gl_version),
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
- GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
- | (flags & VOFLAG_GL_DEBUG ? GLX_CONTEXT_DEBUG_BIT_ARB : 0),
+ GLX_CONTEXT_FLAGS_ARB,
+ flags & VOFLAG_GL_DEBUG ? GLX_CONTEXT_DEBUG_BIT_ARB : 0,
None
};
GLXContext context = glXCreateContextAttribsARB(vo->x11->display,