From 85cb4f299d8a0a0ebc8fe14d0ccd327375eda99e Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 20 Dec 2012 03:54:33 +0100 Subject: st/mesa: fix GetTexImage for compressed 2D array textures This uses a 3D blit to decompress the texture and then a 3D transfer to read it. Reviewed-by: Brian Paul --- src/gallium/auxiliary/util/u_inlines.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/gallium/auxiliary/util') diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index 582aacdca1e..2ff90c982d8 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -421,6 +421,24 @@ pipe_transfer_map(struct pipe_context *context, &box, transfer); } +static INLINE void * +pipe_transfer_map_3d(struct pipe_context *context, + struct pipe_resource *resource, + unsigned level, + enum pipe_transfer_usage usage, + unsigned x, unsigned y, unsigned z, + unsigned w, unsigned h, unsigned d, + struct pipe_transfer **transfer) +{ + struct pipe_box box; + u_box_3d(x, y, z, w, h, d, &box); + return context->transfer_map(context, + resource, + level, + usage, + &box, transfer); +} + static INLINE void pipe_transfer_unmap( struct pipe_context *context, struct pipe_transfer *transfer ) -- cgit v1.2.3