radv: Fix mipmap views on GFX10+
authorJohn Brooks <john@fastquake.com>
Tue, 9 Aug 2022 21:15:33 +0000 (17:15 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 23 Aug 2022 19:01:18 +0000 (19:01 +0000)
commit98ba1e0d817e0354aad5d82eb9a2dc4cce33540f
treea7ce6d9087b427fb0ac04908183e0f38f4f56cc2
parent35f053ba8cd11a16077a79ebf5d3952f6112b096
radv: Fix mipmap views on GFX10+

As explained in the previous commit, GFX9+ has issues with addressing
mipmaps in block-compressed images. In the case of copy commands, we fix
this by doing an extra copy for the missing blocks.

For GFX10, the mipmap layout in memory allows us to do better than that. We
can change the base level of the descriptor to one level bigger than the
requested level and adjust the extent and address to match. This is done by
ComputeNonBlockCompressedView in addrlib. Thus on GFX10 we can skip the
fixup copy workaround, and this will also fix cases outside of explicit
copy commands.

Signed-off-by: John Brooks <john@fastquake.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17970>
src/amd/common/ac_surface.c
src/amd/common/ac_surface.h
src/amd/vulkan/radv_image.c
src/amd/vulkan/radv_meta_bufimage.c