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
(cherry picked from commit 7c9340f855
)
This commit is contained in:
parent
e00e9ff41f
commit
3a730361d3
|
@ -25,6 +25,7 @@
|
||||||
#define GL_UTILS_H
|
#define GL_UTILS_H
|
||||||
|
|
||||||
#include <gal/opengl/kiglew.h> // Must be included first
|
#include <gal/opengl/kiglew.h> // Must be included first
|
||||||
|
#include <wx/glcanvas.h>
|
||||||
#include <wx/utils.h>
|
#include <wx/utils.h>
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
@ -44,11 +45,6 @@ public:
|
||||||
/// Windows would include <wglext.h> and call wglSwapIntervalEXT
|
/// Windows would include <wglext.h> and call wglSwapIntervalEXT
|
||||||
#if defined( __linux__ ) && !defined( KICAD_USE_EGL )
|
#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();
|
Display *dpy = glXGetCurrentDisplay();
|
||||||
GLXDrawable drawable = glXGetCurrentDrawable();
|
GLXDrawable drawable = glXGetCurrentDrawable();
|
||||||
|
|
||||||
|
@ -56,7 +52,7 @@ public:
|
||||||
{
|
{
|
||||||
if( aVal < 0 )
|
if( aVal < 0 )
|
||||||
{
|
{
|
||||||
if( !GLX_EXT_swap_control_tear )
|
if( !wxGLCanvas::IsExtensionSupported( "GLX_EXT_swap_control_tear" ) )
|
||||||
{
|
{
|
||||||
aVal = 0;
|
aVal = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue