iris: fix layer calculation for TEXTURE_3D ReadPixels() on mip-level>0

Fixes assert when ReadPixels() called to read from FBO to
GL_PIXEL_PACK_BUFFER, on mip-level > 0, since num_layers
wasn't properly calculated with mip-level.

The logic of fix is similar to one in 'update_image_surface' function
of i965 driver, which is introduced in commit
f9fd0cf4, and called in similar


Signed-off-by: Yevhenii Kharchenko <>
35 jobs for !26 with fix/iris-3d-texture-layers-num-2 in 32 seconds (queued for 3 seconds)
latest merge request