summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/i965/intel_tex_image.c6
-rw-r--r--src/mesa/drivers/dri/i965/intel_tex_subimage.c6
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,