-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Peter Clifton wrote: > On Thu, 2009-01-29 at 15:08 -0800, Eric Anholt wrote: >> We can support any combination of (a8r8g8b8, x8r8g8b8, r5g6b5) x >> (z0,z24,z24s8) >> on either class of chipsets. The only restriction is no mixing bpp when also >> mixing tiling. This shouldn't be occurring currently. > > Since this change (and the Xorg patch to fix matching GLXVisuals and > FBconfigs), I noticed my GL code which would ask for a double-buffered > visual with with ALPHA channel, now fails. > > > OLD (Admittedly not from my machine): > > 3 GLX Visuals > visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav > id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat > ---------------------------------------------------------------------- > 0x21 24 tc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 0 0 None > 0x22 24 dc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 0 0 None > 0x6f 32 tc 0 32 0 r . . 8 8 8 8 0 0 0 0 0 0 0 0 0 None > > NEW (mine): > > 3 GLX Visuals > visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav > id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat > ---------------------------------------------------------------------- > 0x21 24 tc 0 24 0 r y . 8 8 8 0 0 24 8 0 0 0 0 0 0 None > 0x22 24 dc 0 24 0 r y . 8 8 8 0 0 24 8 0 0 0 0 0 0 None > 0x7b 32 tc 0 32 0 r . . 8 8 8 8 0 0 0 0 0 0 0 0 0 None > > > I'm guessing my code would pick up visual 0x21 in the previous case, as > having alpha bits defined, and it is double-buffered. > > Turns out I don't _need_ a visual with alpha bits in order to draw > primitives with alpha.. presumably the visual with ALPHA is just > required if you wanted the alpha channel to make it back into the X > server as part of the composited result?
There are some bugs in this area, see http://bugs.freedesktop.org/show_bug.cgi?id=19970 If the visual does not have alpha, then the destination alpha (e.g., GL_DST_ALPHA for glBlendFunc) is always 1.0. The source alpha (e.g., GL_SRC_ALPHA) comes from the fragment alpha. Traditionally, the only thing that used the alpha from a visual was the GL rendering. Now we have alpha being used by the compositor. We have four cases, and we need to figure out how to express each correctly: 1. No alpha at all. 2. Destination alpha for GL rendering 3. No destination for GL rendering, but "hidden" alpha exists for the compositor 4. Destination for GL rendering that is also used by the compositor Case #1 is easy...visual depth = 24, alpha size = 0. I believe that case #2 is visual depth = 24, alpha size = 8. I believe that case #3 is visual depth = 32, alpha size = 0. I believe that case #4 is visual depth = 32, alpha size = 8. The more I think about it, the more I think the originally exposed set of visuals was correct. The texture-from-pixmap format needs to take the visual depth into consideration when picking RGB vs. RGBA. > Does anyone know of any apps which might legitimately need a > double-buffered visual with alpha channel? Many games that do multipass rendering. > Are there likely to be others (like mine) broken by this change which > asked for one anyway.. and failed ungracefully when they can't get it? There are two cases that will break now. The first case is the one you encountered. The other case, assuming we apply the rules I outline above, is the case where the application requests visual depth = 32 either with or without alpha size = 8 when it *just* wants GL renderable destination alpha. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkmMqqUACgkQX1gOwKyEAw/TxgCfctXId9r8J8ZH3iV1cBtW6wEN 634AoIyXtLg8vGz7xSXmlXwBQJTcDsEI =CIRf -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ Mesa3d-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
