Mesa OpenGL core vs. compatibility profile and Qt5
Anthony Mallet <[email protected]> Mon, 10 Mar 2025 13:52:41 +0100
| Newsgroups | gmane.os.netbsd.devel.x11 |
|---|---|
| Organization | LAAS/CNRS - Toulouse - France |
| Message-ID | <[email protected]> |
Hi, I'm seeking for a bit of clarification regarding the so called OpengL "core" vs. "compatibility" profile, as I have quite zero knowledge on these topics. I've got a Qt5 application that needs an OpenGL 3.3+ rendering context, running on NetBSD amd64/intel -current, mesa from xsrc-current. Out of the box, the code fails to get the correct OpenGL context and reports an insufficient "OpenGL version 3.0". According to glxinfo this is the version from the "compatibility profile" on my hardware. If I patch the application like so, adding right after the QApplication creation these bits: + QSurfaceFormat format; + format.setProfile(QSurfaceFormat::CoreProfile); + format.setVersion(3, 3); + QSurfaceFormat::setDefaultFormat(format); then the application works fine, reporting "OpenGL version 4.5". This corresponds to the glxinfo "core profile" version). I found this trick online, I'm sure of the implications of this patch, if any. My dumb questions are: - Is it expected (i.e. on purpose, by design choice) that we have such a "3.0 compatibility profile"? For instance, I noticed that on some other Linux machine glxinfo reports the same "4.6" version for both compat/core profiles (and thus the above application works out of the box). - Is my understanding correct that Qt5 requests by default an OpenGL compatibility profile? - All in all, does my patch seems like "a correct fix"? Is there any advantage to use a compat profile like what Qt seems to do by default? Thanks for any clue, or interesting readings on the topic! Best, Anthony