mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 18:23:15 +02:00
Force Mesa to use its own call
Mesa does not support adaptive swapping but will sometimes report that it does. This prevents Mesa drivers from testing (and segfaulting) the limits of their call Fixes https://gitlab.com/kicad/code/kicad/issues/10069 (cherry picked from commit 100cf757fe19d031308726c4cec263f3e960d74f)
This commit is contained in:
parent
974a66ddec
commit
f4d12fb19c
@ -47,12 +47,16 @@ public:
|
||||
|
||||
Display *dpy = glXGetCurrentDisplay();
|
||||
GLXDrawable drawable = glXGetCurrentDrawable();
|
||||
std::string vendor( reinterpret_cast<const char*>( glGetString( GL_VENDOR ) ) );
|
||||
bool is_mesa = ( vendor.find( "Mesa" ) != std::string::npos );
|
||||
|
||||
if( glXSwapIntervalEXT && glXQueryDrawable && dpy && drawable )
|
||||
if( !is_mesa && glXSwapIntervalEXT && glXQueryDrawable && dpy && drawable )
|
||||
{
|
||||
std::string exts( glXQueryExtensionsString( dpy, DefaultScreen( dpy ) ) );
|
||||
|
||||
if( aVal < 0 )
|
||||
{
|
||||
if( !wxGLCanvas::IsExtensionSupported( "GLX_EXT_swap_control_tear" ) )
|
||||
if( exts.find( "GLX_EXT_swap_control_tear" ) == std::string::npos )
|
||||
{
|
||||
aVal = 0;
|
||||
}
|
||||
@ -62,7 +66,7 @@ public:
|
||||
// we need to be sure that late/adaptive swaps are
|
||||
// enabled on the drawable.
|
||||
|
||||
unsigned lateSwapsEnabled;
|
||||
unsigned lateSwapsEnabled = 0;
|
||||
glXQueryDrawable( dpy, drawable, GLX_LATE_SWAPS_TEAR_EXT, &lateSwapsEnabled );
|
||||
|
||||
if( !lateSwapsEnabled )
|
||||
|
Loading…
x
Reference in New Issue
Block a user