From b9400b7ecde42bd4a437829f338a3f349338a16b Mon Sep 17 00:00:00 2001 From: Topi Pohjolainen Date: Fri, 30 Jun 2017 20:56:01 +0300 Subject: [PATCH] i965/tex: Use offset helper instead of accessing table directly Reviewed-by: Jason Ekstrand Signed-off-by: Topi Pohjolainen --- 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 68d0a576670..ba5d099fb40 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 da5b3f0d302..b498b2e1c0c 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.30.2