[Mesa-dev] gallium endianness and hw drivers

Marek Olšák maraeo at gmail.com
Mon Jan 13 15:22:15 PST 2014


I think the format conversion functions should look like:

#ifdef BIG_ENDIAN
   case PIPE_FORMAT_A8B8G8R8_UNORM:
      return hw_format_for_R8G8B8A8_UNORM;
...
#else
   case PIPE_FORMAT_R8G8B8A8_UNORM:
      return hw_format_for_R8G8B8A8_UNORM;
#endif

which can be simplified to:

   case PIPE_FORMAT_RGBA8888_UNORM:
      return hw_format_for_R8G8B8A8_UNORM;

So that the GPU can see the same formats, but they are different for the CPU.

What do you think?

Marek

On Mon, Jan 6, 2014 at 10:00 AM, Michel Dänzer <michel at daenzer.net> wrote:
> On Fre, 2013-12-27 at 19:41 +0100, Marek Olšák wrote:
>> Okay. Using Axxx for transfers only is a good idea, just please make
>> sure the formats are not advertised to the state tracker.
>
> Advertising the format to the state tracker is the whole point :), as
> it's the format that matches the X11 semantics on big endian hosts.
>
>
> --
> Earthling Michel Dänzer            |                  http://www.amd.com
> Libre software enthusiast          |                Mesa and X developer
>


More information about the mesa-dev mailing list