Details
-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
4.8.7
-
None
Description
In QGL2PaintEngineEx::begin (src\opengl\gl2paintengineex\qpaintengineex_opengl2.cpp line 2099 and following) a QGLExtensionMatcher is created each time. This in turn causes a call to glGetString(GL_EXTENSIONS) which is relatively computationally expensive, because it returns the string of all GL extension enabled for the render context.
#if !defined(QT_OPENGL_ES_2) QGLExtensionMatcher extensions; d->hasCompatibilityExtension = extensions.match("GL_ARB_compatibility"); bool success = qt_resolve_version_2_0_functions(d->ctx) && qt_resolve_buffer_extensions(d->ctx) && (!QGLFramebufferObject::hasOpenGLFramebufferObjects() || qt_resolve_framebufferobject_extensions(d->ctx)); Q_ASSERT(success); Q_UNUSED(success); #endif
In QT 5, the same is treated by a call to the context
d->initializeOpenGLFunctions();
This bug was introduced by fix for QTBUG-28284, see:
https://github.com/qt/qt/commit/11aed7c927d7ad8130d2b18a110a3f557c41e9a1
I would suggest a revert, because the QTBUG-28284 involves only rare cases, rather than affecting the performance of all QT 4.8 OpenGL programs.
A proper fix would move the boolean hasCompatibilityExtension into the QGLContext and initialize it with the other extensions.