[Mesa-dev] [PATCH] meta: Fix BlitFramebuffer temp texture setup

Ian Romanick idr at freedesktop.org
Sat Jun 24 01:43:37 UTC 2017


On 06/23/2017 04:58 AM, ville.syrjala at linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> Pass the correct src coordinates to CopyTexSubImage()
> when creating the temporary texture, and also take care to adjust
> flipX/Y if the original src coordinates were flipped compared to
> the new temporary texture src coordinates.

Yes... this seems right.  The calculation of srcW and srcH already take
care to handle src[XY]0 > src[XY]1, so this make sense.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> This fixes all the flip_src_x/y tests in
> piglit.spec.arb_framebuffer_object.fbo-blit-stretch on i915, but
> we're still left with the some failures in the stretch tests.

Any idea what might be wrong with those?

> It looks to me like commit b702233f53d6 ("meta: Refactor the
> BlitFramebuffer color CopyTexImage fallback.") most likely
> broke this codepath.
> 
> Cc: mesa-stable at lists.freedesktop.org
> Cc: Eric Anholt <eric at anholt.net>
> Cc: Kenneth Graunke <kenneth at whitecape.org>
> Cc: Ian Romanick <ian.d.romanick at intel.com>
> Cc: Anuj Phogat <anuj.phogat at gmail.com>
> Fixes: b702233f53d6 ("meta: Refactor the BlitFramebuffer color CopyTexImage fallback.")
> References: https://bugs.freedesktop.org/show_bug.cgi?id=101414
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  src/mesa/drivers/common/meta_blit.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/drivers/common/meta_blit.c b/src/mesa/drivers/common/meta_blit.c
> index 7adad469aceb..7262ecdfaf13 100644
> --- a/src/mesa/drivers/common/meta_blit.c
> +++ b/src/mesa/drivers/common/meta_blit.c
> @@ -680,12 +680,16 @@ blitframebuffer_texture(struct gl_context *ctx,
>        }
>  
>        _mesa_meta_setup_copypix_texture(ctx, meta_temp_texture,
> -                                       srcX0, srcY0,
> +                                       MIN2(srcX0, srcX1),
> +                                       MIN2(srcY0, srcY1),
>                                         srcW, srcH,
>                                         tex_base_format,
>                                         filter);
>  
> -
> +      if (srcX0 > srcX1)
> +         flipX = -flipX;
> +      if (srcY0 > srcY1)
> +         flipY = -flipY;
>        srcX0 = 0;
>        srcY0 = 0;
>        srcX1 = srcW;


More information about the mesa-dev mailing list