On Wed, Mar 2, 2016 at 11:48 PM, Marek Olšák <[email protected]> wrote:
> On Wed, Mar 2, 2016 at 8:22 PM, Oded Gabbay <[email protected]> wrote:
>> There is an old if statement (dated to 2011) that prevented doing
>> endian swap for colorformat, in case the buffer is marked
>> as PIPE_USAGE_STAGING.
>>
>> This is now wrong because st_ReadPixels() reads into a destination
>> texture that is marked with PIPE_USAGE_STAGING. Therefore, even if
>> the texture is rendered correctly to the monitor, when reading it
>> back we get unswapped/wrong values.
>>
>> This patch makes the check_rgba() function in gl-1.0-readpixsanity
>> piglit test pass in big-endian.
>>
>> Signed-off-by: Oded Gabbay <[email protected]>
>> Cc: "11.1 11.2" <[email protected]>
>> ---
>>  src/gallium/drivers/r600/evergreen_state.c | 13 ++-----------
>>  src/gallium/drivers/r600/r600_state.c      |  6 +-----
>>  2 files changed, 3 insertions(+), 16 deletions(-)
>>
>> diff --git a/src/gallium/drivers/r600/evergreen_state.c 
>> b/src/gallium/drivers/r600/evergreen_state.c
>> index a12638a..47ca7ce 100644
>> --- a/src/gallium/drivers/r600/evergreen_state.c
>> +++ b/src/gallium/drivers/r600/evergreen_state.c
>> @@ -989,12 +989,7 @@ void evergreen_init_color_surface_rat(struct 
>> r600_context *rctx,
>>                 MAX2(64, rctx->screen->b.info.pipe_interleave_bytes / 
>> block_size);
>>         unsigned pitch = align(pipe_buffer->width0, pitch_alignment);
>>
>> -       /* XXX: This is copied from evergreen_init_color_surface().  I don't
>> -        * know why this is necessary.
>> -        */
>> -       if (pipe_buffer->usage == PIPE_USAGE_STAGING) {
>> -               endian = ENDIAN_NONE;
>> -       }
>> +       endian = r600_colorformat_endian_swap(format);
>
> endian is already initiailzed at the beginning of the function.

Thanks, I'll of course fix that before pushing.

Oded
>
> Other than that:
>
> Reviewed-by: Marek Olšák <[email protected]>
>
> Marek
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to