amd/surface: fix base_mip_width of subsampled formats
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Sat, 11 Feb 2023 00:38:33 +0000 (19:38 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 16 Feb 2023 05:25:17 +0000 (00:25 -0500)
commitaffa8a9fb2f3ed02ab812bf8f991783683fd408d
treedd860bb352fc5e0cee6a2168f5c73887e7fb2ef4
parent28d0ddead0a913900e210097c583c0cf506529f9
amd/surface: fix base_mip_width of subsampled formats

base_mip_width is used in si_compute_copy_image when the
SI_IMAGE_ACCESS_BLOCK_FORMAT_AS_UINT flag is used.

   width = tex->surface.u.gfx9.base_mip_width;

This will be incorrect if we don't adjust it. For instance,
with a 260x256 image, surf_pitch and base_mip_width are
320 before surf_pitch is updated to be 192.

Both need to match, or computing the width from base_mip_width
leads to incorrect result.

Cc: mesa-stable
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21253>
src/amd/common/ac_surface.c