i965: Fix glCompressedTexSubImage2D offsets for ETC textures.

This patch fixes intel_miptree_unmap_etc() (which decompresses ETC
textures to linear) to pay attention to map->x and map->y when writing
to the destination image.  Previously these values were ignored,
causing the xoffset and yoffset parameters passed to
glCompressedTexSubImage2D() to be ignored.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Paul Berry 2012-12-29 11:31:37 -08:00
parent 48ac6d7e97
commit 06f67e75ee

View file

@ -1329,6 +1329,9 @@ intel_miptree_unmap_etc(struct intel_context *intel,
uint32_t image_y;
intel_miptree_get_image_offset(mt, level, slice, &image_x, &image_y);
image_x += map->x;
image_y += map->y;
uint8_t *dst = intel_region_map(intel, mt->region, map->mode)
+ image_y * mt->region->pitch * mt->region->cpp
+ image_x * mt->region->cpp;