LIBGL_ALWAYS_INDIRECT=1 – What Does It Actually Do?

kdeopenglxorg

KDE SC 4.5.0 has some problems with some video cards including mine. Upon Release Arch recommended several workarounds. One of which was

export "LIBGL_ALWAYS_INDIRECT=1" before starting KDE

I decided that it was the easiest, best method. But I don't know what it does or how it impacts my system. Is it slower than the default? should I remember to keep an eye on the problem and disable it later once it's fixed?

Best Answer

Indirect rendering means that the GLX protocol will be used to transmit OpenGL commands and the X.org will do the real drawing.

Direct rendering means that application can access hardware directly without communication with X.org first via mesa.

The direct rendering is faster as it does not require change of context into X.org process.

Clarification: In both cases the rendering is done by GPU (or technically - may be done by GPU). However in indirect rendering the process looks like:

  1. Program calls a command(s)
  2. Command(s) is/are sent to X.org by GLX protocol
  3. X.org calls hardware (i.e. GPU) to draw

In direct rendering

  1. Program calls a command(s)
  2. Command(s) is/are sent to GPU

Please note that because OpenGL was designed in such way that may operate over network the indirect rendering is faster then would be naive implementation of architecture i.e. allows to send a buch of commands in one go. However there is some overhead in terms of CPU time spent for context switches and handling protocol.

Related Question