vo_gl3: improve Mesa compatibility of context creation
commitf046e9959339525ce4a6fb5e1d6f367f12211407
authorwm4 <wm4@nowhere>
Tue, 20 Nov 2012 16:52:32 +0000 (20 17:52 +0100)
committerUoti Urpala <uau@mplayer2.org>
Wed, 21 Nov 2012 03:06:53 +0000 (21 05:06 +0200)
treee276b59df6640ec77bc1f77ffa3f78a8c919eac5
parent017fb554336e321f669981658e3fb1a9863d4823
vo_gl3: improve Mesa compatibility of 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
with 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_gl3.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 require higher
versions later, we want it to be set, so don't remove it.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=57241
libvo/gl_common.c