[Mesa-dev] [PATCH 5/9] gallium: add R8G8_R8B8 and G8R8_B8R8 format

Jose Fonseca jfonseca at vmware.com
Mon Mar 12 07:00:03 PDT 2012


----- Original Message -----
> On 12.03.2012 13:26, Roland Scheidegger wrote:
> > Hmm actually I think these new pipe formats are a mistake.
> > Why do you need them and don't just use the existing R8G8_B8G8 and
> > G8R8_G8B8?
> > Do you really care if Y ends up in G channel instead of R? And if
> > you do
> > why don't you just use a sampler swizzle?
> > The R8G8_B8G8 and G8R8_G8B8 formats are there because these
> > correspond
> > to the subsampled DX10 formats. I just see absolutely no point in
> > introducing similar formats which just have different channel
> > mapping -
> > we generally don't have arbitrary swizzled formats, with the
> > exception
> > of "old" ones which can be used for legacy purposes. But no such
> > case
> > can be made for these new formats.
> Well, we definitely already have separate formats for different
> channel
> mappings. otherwise we should handle the difference between RGBA and
> BGRA with sampler swizzle’s also.
> 
> > (I just checked the i965 docs which doesn't support sampler
> > swizzling,
> > and in fact these new formats wouldn't help you there neither,
> > since all
> > 4 subsampled ycbcr format map Y to the green channel. So with hw
> > supporting sampler swizzling, these formats don't buy you anything,
> > and
> > with hw not supporting it they don't help neither as no hardware
> > out
> > there supports them anyway.)
> > Or is there another reason why you need these formats I'm missing?
> Nope, not really I just added them for consistency with the existing
> format handling, and it actually makes the implementation of YUV ->
> RGB
> conversion a bit easier.

I think it's fine to have additional formats if they help in anyway. I certainly rather have more formats than, e.g., jamming multiple semantics on an existing format.

If formats eventually become unused we can always remove them.

Jose


More information about the mesa-dev mailing list