QT X11 and OpenGL

2.1k views Asked by At
  1. 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).

  1. How can I ensure that the Qt is really use the gpu acceleration to paint qt/qml widgets on the screen?
1

There are 1 answers

4
datenwolf On

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 some software 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.