[Mesa-dev] [PATCH] mesa: Fix texture compression on big-endian systems

Dave Airlie airlied at gmail.com
Thu Sep 17 04:24:56 PDT 2015


On 16 September 2015 at 21:14, Oded Gabbay <oded.gabbay at gmail.com> wrote:
> On Tue, Sep 15, 2015 at 4:23 PM, Ulrich Weigand <uweigand at de.ibm.com> wrote:
>>
>> Various pieces of code to create compressed textures will first
>> generate an uncompressed RGBA texture into a temporary buffer,
>> and then read from that buffer while creating the final compressed
>> texture in the requested format.
>>
>> The code reading from the temporary buffer assumes the buffer is
>> formatted as an array of bytes in RGBA order.  However, the buffer
>> is filled using a _mesa_texstore call with MESA_FORMAT_R8G8B8A8_UNORM
>> format -- this is defined as an array of *integers* holding the
>> RGBA values in packed format (least-significant to most-significant).
>> This means incorrect bytes are accessed on big-endian systems.
>>
>> This patch fixes this by using the MESA_FORMAT_A8B8G8R8_UNORM format
>> instead on big-endian systems when filling the buffer.  This fixes
>> about 100 piglit test case failures on s390x for me.
>>
>> Signed-off-by: Ulrich Weigand <ulrich.weigand at de.ibm.com>
>> ---
> Tested it on POWER7 ppc64 and saw about the same results as Ulrich.
> Checked that it didn't cause regressions on POWER8 ppc64le.
>
> Therefore, you can add my:
> Tested-by: Oded Gabbay <oded.gabbay at gmail.com>

FYI I've pushed to master with cc stable on it.

Dave.


More information about the mesa-dev mailing list