GLX_EXT_include_inferiors (was Re: compiz on aiglx)

Kristian Høgsberg krh at bitplanet.net
Mon Mar 13 17:13:29 PST 2006


Ian Romanick wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
<snip>
>> The motivation for the GLX_EXT_include_inferiors extension is that when
>> rendering to the root window, even if the child windows (i.e. the
>> top-level windows) have been redirected, they still clip output to the
>> root window.  For a compositing manager to be able to use the root
>> window to draw the desktop, we need a way to specify the equivalent of
>> IncludeInferiors for GL rendering.  GLX_EXT_include_inferiors provides
>> this mechanism.
> 
> *lightbulb*
> 
> Ah.
> 
> Let me propose an alternate idea.  What you really want is to force the
> pixel ownership test to always pass, right?  This would be analogous to
> disabling depth testing or alpha testing.  It sounds like we want a
> function like glXPixelOwnershipFunc that can take parameters like
> ALWAYS, NEVER, ALL_WINDOWS, NON_CHILDREN.  If that's what we want, then
> let's implement *that*. :)
> 
> The beauty is that this would be really easy to implement for DRI drivers.

Indeed, the implementation is trivial, viz this patch I posted as one of 
the hacks to get compiz working on aiglx:

http://freedesktop.org/~krh/compiz-on-aiglx/aiglx-gl-include-inferiors.patch

The issue is how to control this.  A GlxWindow GLX_INCLUDE_INFERIORS_EXT 
attribute is a simple and non-intrusive way to set this, and if you're 
familiar with the X GC property, you'll immediately know what it does. 
I guess it as question of wether you're coming from the Xlib side of 
things or the GL side of things :)

> In fact, we could even add a query so that an app can determine whether
> or not a pixel ownership test happens (e.g., whether or not a drawable
> shares memory with other drawables).
> 
> So, here's my other question.  In this configuration, what happens if
> you draw over top of some child window, and the application owning that
> window calls glReadPixels.  Does it get garbage?

I would think it gets whatever is in the framebuffer for that window. 
Is this a trick question? :)

Kristian





More information about the xorg mailing list