diff options
author | Topi Pohjolainen <[email protected]> | 2017-06-30 20:56:01 +0300 |
---|---|---|
committer | Topi Pohjolainen <[email protected]> | 2017-07-18 21:35:03 +0300 |
commit | b9400b7ecde42bd4a437829f338a3f349338a16b (patch) | |
tree | 3b7dc294f718e57eb9d356205af2a989b5a4143d /src/mesa | |
parent | ee97b78a3e497a1f3b4c71d5fdfccb44da7a1c3a (diff) |
i965/tex: Use offset helper instead of accessing table directly
Reviewed-by: Jason Ekstrand <[email protected]>
Signed-off-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_tex_image.c | 6 | ||||
-rw-r--r-- | 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, |