[Mesa-stable] [Mesa-dev] [PATCH 06/14] meta: Don't do fragment color clamping in case of ReadPixels

Anuj Phogat anuj.phogat at gmail.com
Wed Jul 22 11:40:47 PDT 2015


On Tue, Jul 21, 2015 at 1:18 AM, Iago Toral <itoral at igalia.com> wrote:
> On Tue, 2015-07-21 at 09:24 +0200, Iago Toral wrote:
>> On Tue, 2015-06-16 at 11:15 -0700, Anuj Phogat wrote:
>> > Without this patch, piglit test arb_color_buffer_float-readpixels
>> > fails, when forced to use the meta pbo path.
>> >
>> > Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
>> > Cc: <mesa-stable at lists.freedesktop.org>
>> > ---
>> >  src/mesa/drivers/common/meta_tex_subimage.c | 5 +++++
>> >  1 file changed, 5 insertions(+)
>> >
>> > diff --git a/src/mesa/drivers/common/meta_tex_subimage.c b/src/mesa/drivers/common/meta_tex_subimage.c
>> > index 84cbc50..ccb7dfb 100644
>> > --- a/src/mesa/drivers/common/meta_tex_subimage.c
>> > +++ b/src/mesa/drivers/common/meta_tex_subimage.c
>> > @@ -25,6 +25,7 @@
>> >   *    Jason Ekstrand <jason.ekstrand at intel.com>
>> >   */
>> >
>> > +#include "blend.h"
>> >  #include "bufferobj.h"
>> >  #include "buffers.h"
>> >  #include "fbobject.h"
>> > @@ -305,6 +306,10 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,
>> >     _mesa_meta_begin(ctx, ~(MESA_META_PIXEL_TRANSFER |
>> >                             MESA_META_PIXEL_STORE));
>> >
>> > +   /* GL_CLAMP_FRAGMENT_COLOR doesn't affect ReadPixels. */
>> > +   if (!tex_image && ctx->Extensions.ARB_color_buffer_float)
>> > +      _mesa_ClampColor(GL_CLAMP_FRAGMENT_COLOR, GL_FALSE);
>> > +
>>
>> I think you need to restore the original value of
>> GL_CLAMP_FRAGMENT_COLOR after you are done with ReadPixels,  otherwise
>> it looks like you would be changing the setting for future API calls
>> too.
>
> Oh, I just noticed that this setting is already being considered in the
> state flags passed to _mesa_meta_begin, so ignore that comment.
>
>> Also, does this only apply to ReadPixels and not to GetTexImage? That
>> looks odd to me.
You're right. This should apply to GetTexImage too. I'll send out v2 and
also add a piglit test for GetTexImage.

>>
>> Iago
>>
>> >     _mesa_GenFramebuffers(2, fbos);
>> >
>> >     if (tex_image && tex_image->TexObject->Target == GL_TEXTURE_1D_ARRAY) {
>>
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>


More information about the mesa-stable mailing list