summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2012-12-29 11:31:37 -0800
committerPaul Berry <stereotype441@gmail.com>2013-01-04 11:16:43 -0800
commit06f67e75ee7158e7f13860d07785e1cf3f8f4b13 (patch)
treeea6eb8ea87ffc2ccce79171ca080009cc69ed17f /src/mesa/drivers/dri
parent48ac6d7e97b93258bc784f46bd5f875c70a4b3b9 (diff)
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>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/intel/intel_mipmap_tree.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 8d814bd6d4a..0c8e479cd68 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -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;