[Interest] QOpenGLWidget's performance drop

sivan nanthiran nanthiran2005 at gmail.com
Wed Feb 16 11:53:24 CET 2022


Hi,

Recently I have upgraded from Qt-5.4.1 to Qt-5.15.2. The following is my
system configuration:
- MacOS
- External display connected to External GPU, and made as the primary
screen, connected to a macbook

In my simple testApp, I have 2 QOpenGLWidget and 1 QWidget. I just simply
render a triangle in those QOpenGLWidgets which changes color every 16ms.

The rendering performance in my app used to be 60fps as it was rendering on
the external GPU. However, after Qt-5.15 upgrade, I noticed the performance
is about 45fps and there are load in my macbook's Intel GPU.

Upon investigating, I found out that its due to QOffscreenSurface's change
to be not window-backed anymore. Since QOpenGLWidget internally uses
QOffscreenSurface, I believe this is causing the rendering to not happen on
the screen's GPU. When I hack the code to make the QOffscreenSurface to
window-backed, I'm able to get the same performance as before.

So is there any clean way to achieve the same performance I used to
achieve? If not, are there any effects if I force the QOffscreenSurface to
be window backed for MacOS?

Thanks in advance.

Regards,
Sivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20220216/300d5a0e/attachment.htm>


More information about the Interest mailing list