diff options
author | Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> | 2019-12-06 21:35:38 +0100 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-12-12 09:22:54 -0800 |
commit | 1452cf672cc2489763738e943d60680dee876e38 (patch) | |
tree | 02abe56ac4c4f1dd4502314e1b945af9aefe97f5 | |
parent | 88b2a8ba3fb631722b0a2331fbdf96c74bc13873 (diff) | |
download | mesa-1452cf672cc2489763738e943d60680dee876e38.tar.gz mesa-1452cf672cc2489763738e943d60680dee876e38.tar.bz2 mesa-1452cf672cc2489763738e943d60680dee876e38.zip |
radeonsi: use gfx9.surf_offset to compute texture offset
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2177
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit ff0f10866699a22216fd1a4af6cdb89c2fea10e1)
-rw-r--r-- | src/gallium/drivers/radeonsi/si_texture.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index 95feabe99b7..ebcc60dbf52 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -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 + |