mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 19:50:11 +01:00
ac/surface: adjust gfx9.pitch[*] based on surf->blk_w
This is the same as8275dc1ed5, but since gfx9.pitch[...] is used for linear surfaces since86262b6eacwe 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:
parent
2766972911
commit
fcc499d5e1
1 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue