radeonsi: use gfx9.surf_offset to compute texture offset
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 6 Dec 2019 20:35:38 +0000 (21:35 +0100)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tue, 10 Dec 2019 07:52:07 +0000 (08:52 +0100)
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2177
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_texture.c

index eb17f6c82c4787117054a2e1a73c01b1d1a58be9..de3cbb2bb8853d52d259bdb1edecfb271fe0eb24 100644 (file)
@@ -199,7 +199,8 @@ static unsigned si_texture_get_offset(struct si_screen *sscreen,
 
                /* Each texture is an array of slices. Each slice is an array
                 * of mipmap levels. */
-               return box->z * tex->surface.u.gfx9.surf_slice_size +
+               return tex->surface.u.gfx9.surf_offset +
+                      box->z * tex->surface.u.gfx9.surf_slice_size +
                       tex->surface.u.gfx9.offset[level] +
                       (box->y / tex->surface.blk_h *
                        tex->surface.u.gfx9.surf_pitch +