[Mesa-dev] [PATCH 1/7] gallium: try to cleanup a bit of the format mess created with pipe-video merge

Jose Fonseca jfonseca at vmware.com
Thu Sep 1 08:42:08 PDT 2011


----- Original Message -----
> On Thu, Sep 1, 2011 at 11:08 AM, Christoph Bumiller
> <e0425955 at student.tuwien.ac.at> wrote:
> > On 01.09.2011 17:02, Younes Manton wrote:
> >> On Thu, Sep 1, 2011 at 10:56 AM, Michel Dänzer
> >> <michel at daenzer.net> wrote:
> >>> On Don, 2011-09-01 at 15:50 +0200, Christian König wrote:
> >>>> Start with correctly defining IA44 and AI44 formats.
> >>>>
> >>>> Signed-off-by: Christian König <deathsimple at vodafone.de>
> >>>> ---
> >>>>  src/gallium/auxiliary/util/u_format.csv   |    6 +++-
> >>>>  src/gallium/auxiliary/util/u_format_yuv.c |   38
> >>>>  ---------------------------
> >>>>  src/gallium/auxiliary/util/u_format_yuv.h |   40
> >>>>  -----------------------------
> >>>>  3 files changed, 4 insertions(+), 80 deletions(-)
> >>>>
> >>>> diff --git a/src/gallium/auxiliary/util/u_format.csv
> >>>> b/src/gallium/auxiliary/util/u_format.csv
> >>>> index a3d2aae..b1a85a5 100644
> >>>> --- a/src/gallium/auxiliary/util/u_format.csv
> >>>> +++ b/src/gallium/auxiliary/util/u_format.csv
> >>>> @@ -265,5 +265,7 @@ PIPE_FORMAT_YV16                  , other,
> >>>> 1, 1, x8  , x8  , x8  , x8  , xyzw, y
> >>>>  PIPE_FORMAT_IYUV                  , other, 1, 1, x8  , x8  , x8
> >>>>   , x8  , xyzw, yuv
> >>>>  PIPE_FORMAT_NV12                  , other, 1, 1, x8  , x8  , x8
> >>>>   , x8  , xyzw, yuv
> >>>>  PIPE_FORMAT_NV21                  , other, 1, 1, x8  , x8  , x8
> >>>>   , x8  , xyzw, yuv
> >>>> -PIPE_FORMAT_IA44                  , other, 1, 1, x8  , x8  , x8
> >>>>  , x8  , xyzw, yuv
> >>>> -PIPE_FORMAT_AI44                  , other, 1, 1, x8  , x8  , x8
> >>>>  , x8  , xyzw, yuv
> >>>> +
> >>>> +# Indexed with Alpha
> >>>> +PIPE_FORMAT_IA44                  , plain, 1, 1, un4 , un4 ,
> >>>>     ,     , y00x, rgb
> >>>> +PIPE_FORMAT_AI44                  , plain, 1, 1, un4 , un4 ,
> >>>>     ,     , x00y, rgb
> >>> I think the 'I' stands for 'intensity', not 'indexed'? Same issue
> >>> in
> >>> patch 4.
> >>>
> >>> I didn't notice any other issues in the patches.
> >> It's an index actually, 4 bits, into a 16-entry palette.
> > I'm curious, where is this palette ? I don't see it in the gallium
> > interface ...
> >
> > And if you have to explicitly look it up in the shader, then this
> > is
> > just R4_UINT_A4_UNORM (or even just R4A4_UNORM).
> >
> > For me, "indexed" implies that the texture unit performs the lookup
> > implicitly.
> 
> The palette is currently an explicit lookup in the shader, but it
> doesn't have to be, depending on what your hardware can do (for both
> shader decoding and HW decoders). Anyway, we used to alias some of
> these video formats to existing formats where they matched, but when
> merging pipe-video to master there was concern among some that it
> wasn't the right thing to do.

Strictly speaking, explicit vs implicit palette should be two separate formats.

This will be used by software renderes to automatically generate format conversion code, so it's important this the spec matches reality.

Is there any hardware that does implicit pallete? If not let's use the R4_UINT_A4_UNORM or R4A4_UNORM, and set the "un4" or "u4" accordingly..

Otherwise, let's use a P4_UINT_A4_UNORM or P4A4_UNORM that is _not_ an ordinary "plain" format, and should be treated specially -- i.e., no code will be generated.

If you wanna both behaviors depending on the driver, you really need two formats.


Jose


More information about the mesa-dev mailing list