[Mesa-dev] [PATCH 04/16] i965/tex: Use offset helper instead of accessing table directly

Jason Ekstrand jason at jlekstrand.net
Mon Jul 17 16:07:04 UTC 2017


1-4 are

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

On Mon, Jul 17, 2017 at 6:34 AM, Topi Pohjolainen <
topi.pohjolainen at gmail.com> wrote:

> Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
>  src/mesa/drivers/dri/i965/intel_tex_image.c    | 6 ++++--
>  src/mesa/drivers/dri/i965/intel_tex_subimage.c | 6 ++++--
>  2 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c
> b/src/mesa/drivers/dri/i965/intel_tex_image.c
> index 68d0a57667..ba5d099fb4 100644
> --- a/src/mesa/drivers/dri/i965/intel_tex_image.c
> +++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
> @@ -484,8 +484,10 @@ intel_gettexsubimage_tiled_memcpy(struct gl_context
> *ctx,
>         packing->SkipRows);
>
>     /* Adjust x and y offset based on miplevel */
> -   xoffset += image->mt->level[level].level_x;
> -   yoffset += image->mt->level[level].level_y;
> +   unsigned level_x, level_y;
> +   intel_miptree_get_image_offset(image->mt, level, 0, &level_x,
> &level_y);
> +   xoffset += level_x;
> +   yoffset += level_y;
>
>     tiled_to_linear(
>        xoffset * cpp, (xoffset + width) * cpp,
> diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c
> b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
> index da5b3f0d30..b498b2e1c0 100644
> --- a/src/mesa/drivers/dri/i965/intel_tex_subimage.c
> +++ b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
> @@ -181,8 +181,10 @@ intel_texsubimage_tiled_memcpy(struct gl_context *
> ctx,
>         packing->SkipRows, for_glTexImage);
>
>     /* Adjust x and y offset based on miplevel */
> -   xoffset += image->mt->level[level].level_x;
> -   yoffset += image->mt->level[level].level_y;
> +   unsigned level_x, level_y;
> +   intel_miptree_get_image_offset(image->mt, level, 0, &level_x,
> &level_y);
> +   xoffset += level_x;
> +   yoffset += level_y;
>
>     linear_to_tiled(
>        xoffset * cpp, (xoffset + width) * cpp,
> --
> 2.11.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170717/239607ba/attachment.html>


More information about the mesa-dev mailing list