=== modified file 'src/composite-canvas-glx.cc'
@@ -34,6 +34,7 @@
PFNGLXBINDTEXIMAGEEXTPROC glXBindTexImageEXT_;
PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT_;
+PFNGLXSWAPINTERVALMESAPROC glXSwapIntervalMESA_;
bool
CompositeCanvasGLX::check_glx_version()
@@ -77,15 +78,25 @@
Log::info("** GLX does not support GLX_EXT_texture_from_pixmap!\n");
}
- /* GLX_EXT_swap_control */
+ /*
+ * GLX_EXT_swap_control or GL_MESA_swap_control. Note that
+ * GLX_SGI_swap_control is not enough because it doesn't allow 0 as a valid
+ * value (i.e. you can't turn off VSync).
+ */
if (extString.find("GLX_EXT_swap_control") != std::string::npos) {
glXSwapIntervalEXT_ =
reinterpret_cast<PFNGLXSWAPINTERVALEXTPROC>(
glXGetProcAddress((const GLubyte *)"glXSwapIntervalEXT"));
}
-
- if (!glXSwapIntervalEXT_) {
- Log::info("** GLX does not support GLX_EXT_swap_control!\n");
+ else if (extString.find("GLX_MESA_swap_control") != std::string::npos) {
+ glXSwapIntervalMESA_ =
+ reinterpret_cast<PFNGLXSWAPINTERVALMESAPROC>(
+ glXGetProcAddress((const GLubyte *)"glXSwapIntervalMESA"));
+ }
+
+
+ if (!glXSwapIntervalEXT_ && !glXSwapIntervalMESA_) {
+ Log::info("** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!\n");
}
Log::debug("=======================\n");
@@ -172,8 +183,11 @@
return false;
}
- if (!glXSwapIntervalEXT_ || glXSwapIntervalEXT_(xdpy_, canvas_, 0))
+ if ((!glXSwapIntervalEXT_ || glXSwapIntervalEXT_(xdpy_, canvas_, 0)) &&
+ (!glXSwapIntervalMESA_ || glXSwapIntervalMESA_(0)))
+ {
Log::info("** Failed to set swap interval. Results may be bounded above by refresh rate.\n");
+ }
use_accel_tfp_ = Options::use_accel_tfp;