Revision: 22125
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22125
Author:   gsrb3d
Date:     2009-08-02 00:23:57 +0200 (Sun, 02 Aug 2009)

Log Message:
-----------
Allow users enabling workaround for menus with some Mesa3D drivers.
Define the env var BLENDER_FORCE_SWAPBUFFERS to enable (1, yes, oui, the
value does not matter, code just checks for existence).

The issue seems to happen with Intel and Radeon, but enabling myswapbuffers()
hack solves it (or reduces to just flicker) for now.
https://bugs.freedesktop.org/show_bug.cgi?id=21774

Reported by Philippe Van Hecke.

Modified Paths:
--------------
    trunk/blender/source/blender/src/glutil.c

Modified: trunk/blender/source/blender/src/glutil.c
===================================================================
--- trunk/blender/source/blender/src/glutil.c   2009-08-01 19:54:22 UTC (rev 
22124)
+++ trunk/blender/source/blender/src/glutil.c   2009-08-01 22:23:57 UTC (rev 
22125)
@@ -775,6 +775,20 @@
        return well_is_it;
 }
 
+int troublesome_mesa_buffers(void)
+{
+       static int check = -1;
+
+       /* Driver bug is reported upstream, it should be fixed at some point, 
so do not hardcode */
+       /* It has been reported to happen with intel and radeon drivers, must 
be something more general (DRI?) */
+       /* https://bugs.freedesktop.org/show_bug.cgi?id=21774 */
+       if (check == -1) {
+               check = (getenv("BLENDER_FORCE_SWAPBUFFERS") != NULL);
+       }
+
+       return check;
+}
+
 void bglFlush(void) 
 {
        glFlush();
@@ -782,6 +796,10 @@
        if(is_a_really_crappy_intel_card())
                myswapbuffers(); //hack to get mac intel graphics to show 
frontbuffer
 #endif
+#ifdef __linux__
+       if(troublesome_mesa_buffers())
+               myswapbuffers();
+#endif
 }
 
 


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to