[Mesa-dev] [PATCH v2 02/14] meta: Fix transfer operations check in meta pbo path for readpixels

Anuj Phogat anuj.phogat at gmail.com
Fri Jul 17 10:36:59 PDT 2015


Iago, Jason: Patches 2 and 5 in this series depend on patches 1 and 4
respectively, Since you guys reviewed 2 and 5, would you also like to
review 1, 4 and/or other patches in this series?

Thanks
-Anuj

On Sun, Jun 28, 2015 at 11:29 PM, Iago Toral <itoral at igalia.com> wrote:
> Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
>
> On Fri, 2015-06-26 at 13:15 -0700, Anuj Phogat wrote:
>> Currently used ctx->_ImageTransferState check is not sufficient
>> because it doesn't include the read color clamping enabled with
>> GL_CLAMP_READ_COLOR. So, use the helper function
>> _mesa_get_readpixels_transfer_ops().
>>
>> Also, transfer operations don't affect glGetTexImage(). So, do
>> the check only for glReadPixles.
>>
>> Without this patch, arb_color_buffer_float-readpixels test fails, when
>> forced to use meta pbo path.
>>
>> V2: Add a comment and bump up the commit message.
>>
>> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
>> Cc: <mesa-stable at lists.freedesktop.org>
>> Cc: Iago Toral <itoral at igalia.com>
>> Cc: Jason Ekstrand <jason.ekstrand at intel.com>
>> ---
>>  src/mesa/drivers/common/meta_tex_subimage.c | 13 +++++++++----
>>  1 file changed, 9 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/mesa/drivers/common/meta_tex_subimage.c b/src/mesa/drivers/common/meta_tex_subimage.c
>> index d2474f5..90d78e5 100644
>> --- a/src/mesa/drivers/common/meta_tex_subimage.c
>> +++ b/src/mesa/drivers/common/meta_tex_subimage.c
>> @@ -273,12 +273,17 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,
>>         format == GL_COLOR_INDEX)
>>        return false;
>>
>> -   if (ctx->_ImageTransferState)
>> -      return false;
>> -
>> -
>> +   /* Don't use meta path for readpixels in below conditions. */
>>     if (!tex_image) {
>>        rb = ctx->ReadBuffer->_ColorReadBuffer;
>> +
>> +      /* _mesa_get_readpixels_transfer_ops() includes the cases of read
>> +       * color clamping along with the ctx->_ImageTransferState.
>> +       */
>> +      if (_mesa_get_readpixels_transfer_ops(ctx, rb->Format, format,
>> +                                            type, GL_FALSE))
>> +         return false;
>> +
>>        if (_mesa_need_rgb_to_luminance_conversion(rb->Format, format))
>>           return false;
>>     }
>
>


More information about the mesa-dev mailing list