backend-glx: only check for GLX_SGI_video_sync for direct contexts
authorRobert Bragg <robert@linux.intel.com>
Thu, 3 Jun 2010 22:12:08 +0000 (23:12 +0100)
committerRobert Bragg <robert@linux.intel.com>
Wed, 9 Jun 2010 01:10:08 +0000 (02:10 +0100)
The GLX_SGI_video_sync spec explicitly says that it's only supported for
direct contexts so we don't setup up the function pointers if
glXIsDirect () returns GL_FALSE.

clutter/glx/clutter-backend-glx.c

index 0183177..eaadd0b 100644 (file)
@@ -250,7 +250,11 @@ clutter_backend_glx_get_features (ClutterBackend *backend)
    * so we need to resort to manually synchronizing with the vblank so we
    * always check for the video_sync extension...
    */
-  if (_cogl_check_extension ("GLX_SGI_video_sync", glx_extensions))
+  if (_cogl_check_extension ("GLX_SGI_video_sync", glx_extensions) &&
+      /* Note: the GLX_SGI_video_sync spec explicitly states this extension
+       * only works for direct contexts. */
+      glXIsDirect (clutter_x11_get_default_display (),
+                   backend_glx->gl_context))
     {
       backend_glx->get_video_sync =
         (GetVideoSyncProc) cogl_get_proc_address ("glXGetVideoSyncSGI");