st/mesa: simplify and fix st_GetTexSubImage
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 9 Nov 2016 14:46:21 +0000 (15:46 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 16 Nov 2016 09:31:34 +0000 (10:31 +0100)
commit22360406f78b29eb0548b2f71bfb8ed447b3c1dd
treeb5925ef5bbeb6e9194e73242c299467f1237cc74
parent7cdf292dc3a83ff8d6cb26fc15a679d6d2cdc25b
st/mesa: simplify and fix st_GetTexSubImage

By using _mesa_image_address, the code becomes simpler _and_ fixes the bug
that GL_PACK_SKIP_IMAGES was applied even on non-3D textures.

Also, converting a whole slice at a time simplifies the format translation
fallback path.

Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pixelstore.

v2: fix a silly mistake during code movement

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
src/mesa/state_tracker/st_cb_texture.c