[Mesa-dev] [PATCH] i965: Fix glCompressedTexSubImage2D offsets for ETC textures.

Ian Romanick idr at freedesktop.org
Wed Jan 2 10:55:03 PST 2013


On 12/29/2012 11:50 AM, Paul Berry wrote:
> 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.

I recall that ETC has additional restrictions on subimage updates.  Do 
we correctly respect those?

> ---
>   src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
> index 8d814bd..0c8e479 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;
>



More information about the mesa-dev mailing list