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>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2022-04-20 11:09:40 +02:00 committed by Marge Bot
parent 2766972911
commit fcc499d5e1

View file

@ -1702,9 +1702,11 @@ static int gfx9_compute_miptree(struct ac_addrlib *addrlib, const struct radeon_
} }
if (in->swizzleMode == ADDR_SW_LINEAR) { if (in->swizzleMode == ADDR_SW_LINEAR) {
int alignment = 256 / surf->bpe;
for (unsigned i = 0; i < in->numMipLevels; i++) { for (unsigned i = 0; i < in->numMipLevels; i++) {
surf->u.gfx9.offset[i] = mip_info[i].offset; 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);
} }
} }