- How can I build Qt for X11 with OpenGL support? I have Hardware acceleration on my device(GPU), but when I config the qt(qml) application to work with opengl I can’t see any improvment with the performance… it become more slower performance.
I use the command:
QApplication::setGraphicsSystem("opengl");
I use Qt lighthouse(not qt embedded-linux).
- How can I ensure that the Qt is really use the gpu acceleration to paint qt/qml widgets on the screen?
Make sure Qt gets linked dynamically against /usr/lib[64]/libGL.so (or just libGL.so in the library path). Linkage against any other libGL.so, static linkage, or maybe even libMesaGL.{so, a} means, you'll very likely get a software rasterizer implementation of OpenGL into your program, not using the HW acceleration on your system. Also make sure your system actually supports HW accelerated OpenGL.
If running
glxinfo | grep renderer
reports you somesoftware
rasterizer, you're not HW accelerated. Note that being direct vs indirect has nothing to say about HW acceleration, depite that being stated sometimes. Indirect just means that OpenGL commands are encapsulated into X11 requests and sent over the X11 server instead of being delivered directly to the OpenGL implementation, bypassing the server.