[Mesa-dev] [PATCH 05/27] i965: Replace open coded with intel_miptree_get_image_offset()

Samuel Iglesias Gonsálvez siglesias at igalia.com
Mon Jan 16 12:39:38 UTC 2017


Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>

On Mon, 2017-01-16 at 11:13 +0200, Topi Pohjolainen wrote:
> Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
>  src/mesa/drivers/dri/i965/intel_pixel_read.c | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_pixel_read.c
> b/src/mesa/drivers/dri/i965/intel_pixel_read.c
> index 2563897..ace94a0 100644
> --- a/src/mesa/drivers/dri/i965/intel_pixel_read.c
> +++ b/src/mesa/drivers/dri/i965/intel_pixel_read.c
> @@ -47,6 +47,19 @@
>  
>  #define FILE_DEBUG_FLAG DEBUG_PIXEL
>  
> +static void
> +adjust_image_offset(const struct intel_renderbuffer *irb,
> +                    int *xoffset, int *yoffset)
> +{
> +   unsigned x;
> +   unsigned y;
> +   intel_miptree_get_image_offset(irb->mt, irb->mt_level, irb-
> >mt_layer,
> +                                  &x, &y);
> +
> +   *xoffset += x;
> +   *yoffset += y;
> +}
> +
>  /**
>   * \brief A fast path for glReadPixels
>   *
> @@ -153,8 +166,7 @@ intel_readpixels_tiled_memcpy(struct gl_context *
> ctx,
>        return false;
>     }
>  
> -   xoffset += irb->mt->level[irb->mt_level].slice[irb-
> >mt_layer].x_offset;
> -   yoffset += irb->mt->level[irb->mt_level].slice[irb-
> >mt_layer].y_offset;
> +   adjust_image_offset(irb, &xoffset, &yoffset);
>  
>     dst_pitch = _mesa_image_row_stride(pack, width, format, type);
>  


More information about the mesa-dev mailing list