[Mesa-dev] [PATCH] i965: call intel_prepare_render always when reading pixels

Kenneth Graunke kenneth at whitecape.org
Thu Jan 5 20:06:35 UTC 2017


On Thursday, January 5, 2017 2:19:15 PM PST Tapani Pälli wrote:
> Currently we do this only in the fallback code (when tiled memcpy
> version failed) but it needs to be done always so that we have
> correct read and write buffer in place. No regressions seen in CI.
> 
> Fixes:
> 	dEQP-EGL.functional.buffer_age.*
> 
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98330
> ---
>  src/mesa/drivers/dri/i965/intel_pixel_read.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_pixel_read.c b/src/mesa/drivers/dri/i965/intel_pixel_read.c
> index c15f891..2563897 100644
> --- a/src/mesa/drivers/dri/i965/intel_pixel_read.c
> +++ b/src/mesa/drivers/dri/i965/intel_pixel_read.c
> @@ -242,17 +242,17 @@ intelReadPixels(struct gl_context * ctx,
>        perf_debug("%s: fallback to CPU mapping in PBO case\n", __func__);
>     }
>  
> -   ok = intel_readpixels_tiled_memcpy(ctx, x, y, width, height,
> -                                      format, type, pixels, pack);
> -   if(ok)
> -      return;
> -
> -   /* glReadPixels() wont dirty the front buffer, so reset the dirty
> +   /* Reading pixels wont dirty the front buffer, so reset the dirty
>      * flag after calling intel_prepare_render(). */
>     dirty = brw->front_buffer_dirty;
>     intel_prepare_render(brw);
>     brw->front_buffer_dirty = dirty;
>  
> +   ok = intel_readpixels_tiled_memcpy(ctx, x, y, width, height,
> +                                      format, type, pixels, pack);
> +   if(ok)
> +      return;
> +
>     /* Update Mesa state before calling _mesa_readpixels().
>      * XXX this may not be needed since ReadPixels no longer uses the
>      * span code.
> 

Nice find, Tapani!  I'm glad this ended up being something simple!

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170105/24f08647/attachment.sig>


More information about the mesa-dev mailing list