[Mesa-dev] gallium endianness and hw drivers

Marek Olšák maraeo at gmail.com
Wed Jan 15 05:27:22 PST 2014


On Wed, Jan 15, 2014 at 7:07 AM, Michel Dänzer <michel at daenzer.net> wrote:
> On Die, 2014-01-14 at 00:22 +0100, Marek Olšák wrote:
>> 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?
>
> That might be an option, but PIPE_FORMAT_R8G8B8A8_UNORM is useful on big
> endian hosts as well, e.g. it matches GL_RGBA / GL_UNSIGNED_BYTE
> exactly.

I wouldn't worry about such optimizations when we don't even have
proper big endian support. I'd rather stick to the simplest solution
for the old hardware.

Marek


More information about the mesa-dev mailing list