On 12/05/2011 11:38 PM, Eric Anholt wrote:
On Mon, 05 Dec 2011 15:21:57 +0100, Thomas Hellstrom<thellst...@vmware.com>
wrote:
Hi!
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? I would think you want enums
along the lines of MESA_FORMAT_* instead of trying to guess formats
based on a bpp/depth.
We can't distinguish that with this proposal.
The dri state tracker's visual currently supports a very limited number
of formats and
we cover all of these with this change, which is not very intrusive.
However, I agree with you that it would be desirable to be able to
better support a wider range of formats, and
that leaves two possibilities:
1) Follow your suggestion. All DDX drivers that want to support the dri
state trackers would need to implement the server side and
we would need a common definition somewhere. Probably in the dri2
protocol headers.
2) Keep it driver-private and have the dri state tracker call into a
driver-private configuration function that translates between gallium
formats and dri2 format codes.
Meanwhile I'm posting a patch along the lines of the original proposal
so that we at least can distinguish between the formats that are
currently supported by the dri state tracker.
/Thomas
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev