[Mesa-dev] [PATCH 04/16] i965/tex: Use offset helper instead of accessing table directly
Topi Pohjolainen
topi.pohjolainen at gmail.com
Mon Jul 17 13:34:55 UTC 2017
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
More information about the mesa-dev
mailing list