[Mesa-dev] [RFC] Change dri state tracker GetBuffersWithFormat format encoding

Michel Dänzer michel at daenzer.net
Tue Dec 6 02:04:49 PST 2011


On Mon, 2011-12-05 at 14:38 -0800, Eric Anholt wrote:
> On Mon, 05 Dec 2011 15:21:57 +0100, Thomas Hellstrom <thellstrom at vmware.com> wrote:
> > 
> > Currently the DRI state tracker sends the bits per pixel (bpp) value in 
> > the format member of a
> > getbufferswithformat request, and assumes it can reinterpret the format 
> > of the returned buffer to something else
> > with an identical bpp.
> > 
> > That doesn't really work for vmwgfx. We can't reinterpret a surface 
> > format (for example from ARGB to XRGB) and
> > I would therefore like to change the dri state tracker to send the depth 
> > instead of bits per pixel, so that the X server driver
> > knows exactly what format it is supposed to create:
> > 
> > Color buffer:
> > depth 32 : argb32 (bpp 32)
> > depth 24 : xrgb32 (bpp 32)
> > depth 16 : rgb16 (bpp 16)
> > 
> > Depth buffer:
> > depth 32 : z32 (bpp 32)
> > depth 24 : x8z24 (bpp 32)
> > depth 16 : z16 (bpp 16)
> > 
> > Depth_Stencil buffer:
> > depth 32 : s8z24: (bpp 32)
> 
> So how do you distinguish based on depth between a8r8g8b8 and r11f g11f
> b10f from GLX_EXT_fbconfig_packed_float?

Can you create a GLXWindow with that fbconfig?

> I would think you want enums along the lines of MESA_FORMAT_* instead
> of trying to guess formats based on a bpp/depth.

The current scheme may not be future proof, but at this point it seems
hard to anticipate what exactly the problem(s) could be and how best to
address them. (Rob Clark's DRI2 video proposal has an attempt to address
this for video clients) 


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the mesa-dev mailing list