PDA

View Full Version : Qt 2D performance



berliner
27th October 2019, 23:37
I made a program that makes heavy use of 2D drawing operations in QPainter. I'm talking about something in the range of 100.000 filled and unfilled polygons. My observation for a couple of years is that the rendering is by multitudes slower on Windows than Linux or OS X.

I have a computer with i5-6200U with Win10 and it is slower than on a virtual Linux or OS X on the same hardware with Windows host. Windows takes about 1 second for rendering the scene and Linux/OS X a fraction of a second..

Now I have a new computer and it is even more weird. It has an AMD Ryzen 5 pro and the rendering in OS X and Linux as expected both faster than on the aforementioned i5-6200U, but in Windows 10 native it is even slower (about 2 seconds now) than on the older i5.

What is wrong here? Does Qt on Linux and OS X support hardware acceleration while on Windows it uses CPU only? But why is it then slower on the faster Ryzen 5 than the i5? Is the AMD graphics driver so bad?

I build with Qt Creator on Linux / OS X and Visual Studio on Windows.

Do I have to compile Qt for myself with ANGLE support?

d_stranz
28th October 2019, 00:00
See this (https://doc-snapshots.qt.io/qt5-dev/windows-requirements.html) for some information on Qt's graphics drivers under Windows.

berliner
28th October 2019, 00:50
ok, so according to the article, the standard Qt installation comes with "configure -opengl dynamic" and I should be able to switch to ANGLE.

According to that (https://doc.qt.io/qt-5/windows-deployment.html) article I must provide the libEGL DLLs. So I copied
libEGL.dll
libGLESv2.dll
d3dcompiler_47.dll

to the platforms folder of my application (and also to plugins as well as the root folder as the article is not quite clear about where to place them).

I open a command prompt, change to the program root and do
set QT_OPENGL=angle
I run the program and it behaves just as before. Not sure if I did it right.

d_stranz
28th October 2019, 16:28
I run the program and it behaves just as before.

If your program is using only 2D graphics calls through QPainter it likely isn't using OpenGL at all, in any form, but I think that the graphics calls will still resolve to some underlying Windows driver, like DirectX or GDI/GDI+. I'm not sure how to prove that other than to run a debug version and look at the list of DLLs that get loaded or use Dependency Walker (depends.exe) to do a static analysis.