[Mesa-dev] [PATCH 03/14] mesa: Fix conditions to test signed, unsigned integer format

Anuj Phogat anuj.phogat at gmail.com
Wed Jun 17 10:15:53 PDT 2015


On Tue, Jun 16, 2015 at 9:16 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> Please note in the commit message exactly what is broken.
>
I didn't notice any piglit failure without this change. As requested I'll add
this in the commit message:

"Just checking the type in glReadPixels() is not sufficient to decide if the
format is one of the integer formats. GL_INT, GL_SHORT or GL_BYTE types can
be used with both normalized fixed point formats and integer formats. So, add a
check to ensure the integer format."

> On Jun 16, 2015 11:15, "Anuj Phogat" <anuj.phogat at gmail.com> wrote:
>>
>> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
>> Cc: <mesa-stable at lists.freedesktop.org>
>> ---
>>  src/mesa/main/readpix.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
>> index caa2648..a9416ef 100644
>> --- a/src/mesa/main/readpix.c
>> +++ b/src/mesa/main/readpix.c
>> @@ -160,10 +160,12 @@ _mesa_readpixels_needs_slow_path(const struct
>> gl_context *ctx, GLenum format,
>>        srcType = _mesa_get_format_datatype(rb->Format);
>>
>>        if ((srcType == GL_INT &&
>> +           _mesa_is_enum_format_integer(format) &&
>>             (type == GL_UNSIGNED_INT ||
>>              type == GL_UNSIGNED_SHORT ||
>>              type == GL_UNSIGNED_BYTE)) ||
>>            (srcType == GL_UNSIGNED_INT &&
>> +           _mesa_is_enum_format_integer(format) &&
>>             (type == GL_INT ||
>>              type == GL_SHORT ||
>>              type == GL_BYTE))) {
>> --
>> 1.9.3
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list