ac/surface: adjust gfx9.pitch[*] based on surf->blk_w

This is the same as 8275dc1ed5, but since gfx9.pitch[...] is
used for linear surfaces since 86262b6eac we need to update
it as well.

Fixes: 86262b6eac ("radeonsi,radv: fix usages of surf_pitch")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16053>
(cherry picked from commit fcc499d5e1)
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2022-04-20 11:09:40 +02:00 committed by Dylan Baker
parent 03b9ee9e5a
commit 7713235e3e
2 changed files with 4 additions and 2 deletions

View file

@ -508,7 +508,7 @@
"description": "ac/surface: adjust gfx9.pitch[*] based on surf->blk_w",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"because_sha": "86262b6eac0c232f4b3085cfc86cff9b7de7d11b"
},
{

View file

@ -1701,9 +1701,11 @@ static int gfx9_compute_miptree(struct ac_addrlib *addrlib, const struct radeon_
}
if (in->swizzleMode == ADDR_SW_LINEAR) {
int alignment = 256 / surf->bpe;
for (unsigned i = 0; i < in->numMipLevels; i++) {
surf->u.gfx9.offset[i] = mip_info[i].offset;
surf->u.gfx9.pitch[i] = mip_info[i].pitch;
/* Adjust pitch like we did for surf_pitch */
surf->u.gfx9.pitch[i] = align(mip_info[i].pitch / surf->blk_w, alignment);
}
}