AIGLX and direct rendering

Dan Nicholson dbn.lists at gmail.com
Wed Sep 10 13:45:01 PDT 2008


On Wed, Sep 10, 2008 at 1:33 PM, Adam Jackson <ajax at nwnk.net> wrote:
> On Wed, 2008-09-10 at 17:49 +0000, Lars Oliver Hansen wrote:
>> Hi,
>>
>> thanks to your list members I have direct rendering working now. I
>> "wanted" this as it "sounds" faster than indirect rendering for 3D
>> games and as I read that it is required for Compiz. However AIGLX is
>> supposedly needed for Compiz too. Now AIGLX is "Accelerated Indirect
>> GLX" and I again supposedly needed the setting
>> LIBGL_ALWAYS_INDIRECT=true. For a 3D game I have a script which
>> unloads Compiz and replaces it by MetaCity. If direct rendering is
>> faster, is it possible to unload AIGLX or disable it for the game?
>
> An OpenGL context can be either direct, or indirect.  Direct contexts
> load a driver into the client and submit commands directly to the
> hardware.  Indirect contexts send GLX protocol to the X server, which
> then renders it "somehow".
>
> Historically, indirect GLX was rendered with a software rasterizer.  It
> worked but it's slow.  All AIGLX is, is the ability for the server to
> load an accelerated 3d driver and handle indirect contexts that way.  It
> happens to be the same driver as is used in direct contexts.
>
> The reason you need AIGLX for compiz is because, with the open source
> drivers, the GLX_EXT_texture_from_pixmap extension only works in
> indirect contexts, because it only works when the pixmap and the texture
> are in the same address space, and the only process with access to both
> is the X server.
>
> But, in the context of games, none of this matters, because you can have
> as many GL contexts as you like.  Your game is just going to use a
> direct context, so it doesn't matter whether the server accelerates
> indirect contexts or not.  So it doesn't make sense to talk about
> "unloading AIGLX".

In other words, you only want to set the LIBGL_ALWAYS_INDIRECT
environment variable when starting compiz. Everyone else will use
direct rendering as long as it's available and the variable isn't set.
You can see this in the "Direct rendering:" line if you run glxinfo
with LIBGL_ALWAYS_INDIRECT set and unset.

--
Dan



More information about the xorg mailing list