diff --git a/source/blender/src/glutil.c b/source/blender/src/glutil.c index 69a44aff1e4..bb9b1be08b6 100644 --- a/source/blender/src/glutil.c +++ b/source/blender/src/glutil.c @@ -775,6 +775,20 @@ int is_a_really_crappy_nvidia_card(void) 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 @@ void bglFlush(void) 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 }