Fix swap interval checking
Checking for the existence of the call only validated that our header defined the value, not that the video card/driver supported the call. We query the extensions string directly to check for support. This should fix both the X11 and virtualization issues (potentially other crashes with older video cards as well) Fixes https://gitlab.com/kicad/code/kicad/issues/8944
This commit is contained in:
parent
3069b198b1
commit
7c9340f855
|
@ -25,6 +25,7 @@
|
|||
#define GL_UTILS_H
|
||||
|
||||
#include <gal/opengl/kiglew.h> // Must be included first
|
||||
#include <wx/glcanvas.h>
|
||||
#include <wx/utils.h>
|
||||
|
||||
#include <limits>
|
||||
|
@ -44,11 +45,6 @@ public:
|
|||
/// Windows would include <wglext.h> and call wglSwapIntervalEXT
|
||||
#if defined( __linux__ ) && !defined( KICAD_USE_EGL )
|
||||
|
||||
/// Do not try to set the swapping over remote connections
|
||||
/// Video drivers lie and then crash when they can't handle the adaptive swapping
|
||||
if( wxGetEnv( wxT( "SSH_CONNECTION"), nullptr ) )
|
||||
return 0;
|
||||
|
||||
Display *dpy = glXGetCurrentDisplay();
|
||||
GLXDrawable drawable = glXGetCurrentDrawable();
|
||||
|
||||
|
@ -56,7 +52,7 @@ public:
|
|||
{
|
||||
if( aVal < 0 )
|
||||
{
|
||||
if( !GLX_EXT_swap_control_tear )
|
||||
if( !wxGLCanvas::IsExtensionSupported( "GLX_EXT_swap_control_tear" ) )
|
||||
{
|
||||
aVal = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue