summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-09-12 06:30:10 +0200
committerNiklas Haas <git@haasn.xyz>2017-09-13 20:53:17 +0200
commit293c696ddb2a3799ca055d548df8f9f2521e4a27 (patch)
treeba10540699aa2cbbc7ea3b60aa1a03da59fe42ff
parent67d1ec8fada18896e4ea14912bde1d21542e119a (diff)
downloadmpv-293c696ddb2a3799ca055d548df8f9f2521e4a27.tar.bz2
mpv-293c696ddb2a3799ca055d548df8f9f2521e4a27.tar.xz
vo_opengl: use GLX_MESA_swap_control where available
This overrides the use of GLX_SGI_swap_control, because apparently GLX_SGI_swap_control doesn't support SwapInterval(0), but the GLX_MESA_swap_interval does. Of course, everybody except mesa just accepts SwapInterval(0) even for GLX_SGI_swap_control, but mesa needs to be the special snowflake here and reject it, forcing us to load their stupid named extension instead. Meanwhile khronos has done nothing except spit out GLX_EXT_swap_control (not to be confused with GL_EXT_swap_control, which is exported by WGL_EXT_swap_control), that doesn't fix the problem because mesa doesn't implement it anyway. What a fucking mess.
-rw-r--r--video/out/opengl/common.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c
index 3d03c478b9..db317ee843 100644
--- a/video/out/opengl/common.c
+++ b/video/out/opengl/common.c
@@ -383,6 +383,15 @@ static const struct gl_functions gl_functions[] = {
{0},
},
},
+ // This one overrides GLX_SGI_swap_control on platforms using mesa. The
+ // only difference is that it supports glXSwapInterval(0).
+ {
+ .extension = "GLX_MESA_swap_control",
+ .functions = (const struct gl_function[]) {
+ DEF_FN_NAME(SwapInterval, "glXSwapIntervalMESA"),
+ {0},
+ },
+ },
{
.extension = "WGL_EXT_swap_control",
.functions = (const struct gl_function[]) {