summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/context.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-03-19 19:29:41 +0100
committerwm4 <wm4@nowhere>2016-03-19 19:31:17 +0100
commit3353923f2906368fb4d0b1fc0927f9f8fce30cf8 (patch)
tree296bd0f2399b7c686ea36fa71757f7892e074310 /video/out/opengl/context.c
parent769f79bd39ceacdb34cd011271addf48d79cee5a (diff)
downloadmpv-3353923f2906368fb4d0b1fc0927f9f8fce30cf8.tar.bz2
mpv-3353923f2906368fb4d0b1fc0927f9f8fce30cf8.tar.xz
vo_opengl: GLX: try to create 3.3 core profile context
Until now, we have tried to create a GL 3.0 context. The main reason for this is that many Mesa-based drivers did not support anything better. But some drivers (Mesa AMD) will not report a higher OpenGL version, because their compatibility mode is restricted. While later GL features are reported as extensions just fine, there doesn't seem to be a way to determine or enable higher GLSL versions. Add some more shitty hacks to try to deal with this messed up situation, and try to probe each interesting GL version separately (starting with 3.3, then 3.2 etc.). Other backends might suffer from similar problems, but these will have to deal with it on their own. Probably fixes #2938, or maybe not.
Diffstat (limited to 'video/out/opengl/context.c')
-rw-r--r--video/out/opengl/context.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/video/out/opengl/context.c b/video/out/opengl/context.c
index aada9df973..77e9709426 100644
--- a/video/out/opengl/context.c
+++ b/video/out/opengl/context.c
@@ -78,6 +78,17 @@ static const struct mpgl_driver *const backends[] = {
#endif
};
+// 0-terminated list of desktop GL versions a backend should try to
+// initialize. The first entry is the most preferred version.
+const int mpgl_preferred_gl_versions[] = {
+ 330,
+ 320,
+ 310,
+ 300,
+ 210,
+ 0
+};
+
int mpgl_find_backend(const char *name)
{
if (name == NULL || strcmp(name, "auto") == 0)