Do not resolve glx functions specified in GLX 1.3

According to the OpenGL ABI for Linux GLX 1.3 is a minimum requirement.
Therefore we do not need to resolve the symbols which are present in that
version.

KWin did always require at least 1.3, for all the resolved functions
there were checks in the Scene, but they might have been incorrect.
Instead now the GLX version is checked and OpenGL compositing is blocked
if there is not at least GLX 1.3.

REVIEW: 106704
This commit is contained in:
Martin Gräßlin 2012-10-03 10:28:43 +02:00
parent 15d714d82c
commit 476adac337
3 changed files with 4 additions and 41 deletions

View file

@ -68,12 +68,10 @@ GlxBackend::~GlxBackend()
void GlxBackend::init()
{
initGLX();
// check for FBConfig support
if (!hasGLExtension("GLX_SGIX_fbconfig") || !glXGetFBConfigAttrib || !glXGetFBConfigs ||
!glXGetVisualFromFBConfig || !glXCreatePixmap || !glXDestroyPixmap ||
!glXCreateWindow || !glXDestroyWindow) {
setFailed("GLX_SGIX_fbconfig or required GLX functions missing");
return; // error
// require at least GLX 1.3
if (!hasGLXVersion(1, 3)) {
setFailed("Requires at least GLX 1.3");
return;
}
if (!initDrawableConfigs()) {
setFailed("Could not initialize the drawable configs");

View file

@ -66,14 +66,6 @@ glXCopySubBuffer_func glXCopySubBuffer;
glXGetVideoSync_func glXGetVideoSync;
glXWaitVideoSync_func glXWaitVideoSync;
glXSwapInterval_func glXSwapInterval;
// GLX_SGIX_fbconfig
glXGetFBConfigAttrib_func glXGetFBConfigAttrib;
glXGetVisualFromFBConfig_func glXGetVisualFromFBConfig;
glXCreateWindow_func glXCreateWindow;
glXDestroyWindow_func glXDestroyWindow;
glXCreatePixmap_func glXCreatePixmap;
glXDestroyPixmap_func glXDestroyPixmap;
glXGetFBConfigs_func glXGetFBConfigs;
// glActiveTexture
glActiveTexture_func glActiveTexture;
@ -189,15 +181,6 @@ void glxResolveFunctions()
} else {
glXSwapInterval = NULL;
}
OpenGLPlatformInterface platformInterface = GlxPlatformInterface;
GL_RESOLVE_WITH_EXT(glXGetFBConfigAttrib, glXGetFBConfigAttribSGIX);
GL_RESOLVE_WITH_EXT(glXGetVisualFromFBConfig, glXGetVisualFromFBConfigSGIX);
GL_RESOLVE(glXGetFBConfigs);
GL_RESOLVE(glXCreateWindow);
GL_RESOLVE(glXDestroyWindow);
GL_RESOLVE(glXCreatePixmap);
GL_RESOLVE(glXDestroyPixmap);
}
#endif

View file

@ -203,24 +203,6 @@ typedef int (*glXSwapInterval_func)(int ratio);
extern KWIN_EXPORT glXGetVideoSync_func glXGetVideoSync;
extern KWIN_EXPORT glXWaitVideoSync_func glXWaitVideoSync;
extern KWIN_EXPORT glXSwapInterval_func glXSwapInterval;
// GLX_SGIX_fbconfig and misc GLX 1.3 stuff
typedef int (*glXGetFBConfigAttrib_func)(Display *dpy, GLXFBConfig config,
int attribute, int *value);
typedef XVisualInfo*(*glXGetVisualFromFBConfig_func)(Display *dpy, GLXFBConfig config);
extern KWIN_EXPORT glXGetFBConfigAttrib_func glXGetFBConfigAttrib;
extern KWIN_EXPORT glXGetVisualFromFBConfig_func glXGetVisualFromFBConfig;
typedef GLXWindow(*glXCreateWindow_func)(Display *dpy, GLXFBConfig config,
Window win, const int *attribList);
typedef void (*glXDestroyWindow_func)(Display *dpy, GLXWindow window);
typedef GLXPixmap(*glXCreatePixmap_func)(Display *dpy, GLXFBConfig config,
Pixmap pixmap, const int *attribList);
typedef void (*glXDestroyPixmap_func)(Display *dpy, GLXPixmap pixmap);
typedef GLXFBConfig*(*glXGetFBConfigs_func)(Display *dpy, int screen, int *nelements);
extern KWIN_EXPORT glXCreateWindow_func glXCreateWindow;
extern KWIN_EXPORT glXDestroyWindow_func glXDestroyWindow;
extern KWIN_EXPORT glXCreatePixmap_func glXCreatePixmap;
extern KWIN_EXPORT glXDestroyPixmap_func glXDestroyPixmap;
extern KWIN_EXPORT glXGetFBConfigs_func glXGetFBConfigs;
// glActiveTexture
typedef void (*glActiveTexture_func)(GLenum);