[Mesa-dev] [PATCH 03/13] gallium: Introduce 32-bit bytewise format names

Michel Dänzer michel at daenzer.net
Mon May 27 09:00:47 PDT 2013


On Fre, 2013-05-24 at 09:11 -0700, Jose Fonseca wrote:
> 
> I agree that with non-array formats, like B5G6R5 and R5G6B5, replacing
> them with endian-variant BGR565 and RGB565 makes a lot of sense (as
> the swapped version will probably never be needed). 
> 
> But I'm not sure about RGBA8 variants...
> 
>  - On one hand, it is often more efficient to read/write them as 32bit
> integers than as an array of bytes.
>  
>  - On the other hand it is easier to think of then as an array of
> bytes than an integer quantity.
> 
> One thing is clear -- a given format can't be both -- either it is
> endianess-variant packed color or a endianness-invariant array color.

Actually, I think it should be possible to make the RGBA8 variants
usable as either an array of bytes or a packed integer, given the right
setup of definitions and aliases (which would differ between little and
big endian hosts). But I'm not sure offhand what would be the best way
to achieve that for the util_format stuff.


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


More information about the mesa-dev mailing list