i965: Fix glCompressedTexSubImage2D offsets for ETC textures.
authorPaul Berry <stereotype441@gmail.com>
Sat, 29 Dec 2012 19:31:37 +0000 (11:31 -0800)
committerPaul Berry <stereotype441@gmail.com>
Fri, 4 Jan 2013 19:16:43 +0000 (11:16 -0800)
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>
src/mesa/drivers/dri/intel/intel_mipmap_tree.c

index 8d814bd6d4a50c62d999e733d2151518ce8061bf..0c8e479cd68a2039c9c5375032cc226ee3561f07 100644 (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;