QOpenGLContext fail to run versionFunctions<QOpenGLFunctions_3_3_Core>()
-
I'm trying to port my code from windows to MacOS. After a few corrections , the code did compile. But what puzzles me now is that, when I run:
QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_3_3_Core>()->glCreateShader...
it crashes because QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_3_3_Core>() is nullptr,
which isn't any like description in Qt-official cite https://doc.qt.io/qt-5/qopenglcontext.html#versionFunctions-1 at all. It tells me it should work.
Here is my environment :
MacOS big sur public beta 6
Qt 5.15.1 through homebrew
Macbook pro 13 retina 2018 with touchbar.
The problem frustrates me. Is it because of macOS big sur. Can anyone get non-null pointer from macOS Catalina?
Appreciate your help! -
It's not my code problem, I've tested another worked example code using versionFunctions<QOpenGLFunctions_3_3_Core>(), it also crashes as EXC_BAD_ACCESS (SIGSEGV).
So I suppose it's big sur's problem, can anyone test this function using the same code in Catalina and big sur?
By the way, big sur always crashes on some specific applications. If versionFunctions fails on big sur and success in Catalina. We may feedback Apple this OpenGL issueBTW,
QSurfaceFormat format;
format.setVersion(3,3);
format.setProfile(QSurfaceFormat::CoreProfile);
QOpenGLContext::currentContext()->setFormat(format);
will fail.
QOpenGLContext::currentContext()->format().version is 2 1 which is astonishing -
Hi and welcome to devnet,
macOS has a long reputation of being behind in terms of implementing the OpenGL standards.
Big Sure being still unreleased, you may have unexpected issues. You might want to try the new Qt RHI.
-
@SGaist I think so. BTW, so many programs crash in big sur. Big sur sounds like bug sur.
And One of Qt cmake component will fail on big sur. Because the directories '/System/Library/Frameworks/OpenGL.framework/Header' '/System/Library/Frameworks/AGL.framework/Header'both disappear in big sur, meaning that
Qt cmake component couldn't find gl.h in both non-existed directories. I manually change it to '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/'
'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AGL.framework/Headers/', now at least it appears to work, of course /Library/Developer/CommandLineTools is my xcode-select path.