From 09d75c6d8e83b3d0682e296357577988abae1b3f Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 29 Nov 2016 10:42:56 +0100 Subject: Fix crashing in non-core GLES functions on some systems The 5.7 refactoring for QOpenGLFunctions introduced new requirements for the QPlatformGLContext::getProcAddress implementations. Implementations outside of qtbase were unfortunately forgotten. QtWayland's implementation does not derive from the common EGL version so it needs its own patch. Task-number: QTBUG-57326 Change-Id: Ie2ad22bf5986870aac74adc1e4c654c616091034 Reviewed-by: Risto Avila Reviewed-by: Lars Knoll --- src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index f70c75a33..2a9e39ed6 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp @@ -59,6 +59,8 @@ #include +#include + // Constants from EGL_KHR_create_context #ifndef EGL_CONTEXT_MINOR_VERSION_KHR #define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB @@ -575,9 +577,12 @@ bool QWaylandGLContext::isValid() const return m_context != EGL_NO_CONTEXT; } -void (*QWaylandGLContext::getProcAddress(const char *procName)) () +QFunctionPointer QWaylandGLContext::getProcAddress(const char *procName) { - return eglGetProcAddress(procName); + QFunctionPointer proc = (QFunctionPointer) eglGetProcAddress(procName); + if (!proc) + proc = (QFunctionPointer) dlsym(RTLD_DEFAULT, procName); + return proc; } EGLConfig QWaylandGLContext::eglConfig() const -- cgit v1.2.3