radv: move the GFX11 special case for mips to radv_image_is_pipe_misaligned()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31921>
This commit is contained in:
Samuel Pitoiset
2024-10-31 08:43:46 +01:00
committed by Marge Bot
parent 65bb39bf96
commit c5d5f2fbef
+12 -12
View File
@@ -875,6 +875,18 @@ radv_image_is_pipe_misaligned(const struct radv_device *device, const struct rad
assert(gpu_info->gfx_level >= GFX10);
/* Add a special case for mips in the metadata mip-tail for GFX11. */
if (pdev->info.gfx_level >= GFX11) {
if (image->vk.mip_levels > 1 && (radv_image_has_dcc(image) || radv_image_has_htile(image))) {
for (unsigned i = 0; i < image->plane_count; ++i) {
const struct radeon_surf *surf = &image->planes[i].surface;
if (surf->num_meta_levels != image->vk.mip_levels)
return true;
}
}
}
for (unsigned i = 0; i < image->plane_count; ++i) {
VkFormat fmt = radv_image_get_plane_format(pdev, image, i);
int log2_bpp = util_logbase2(vk_format_get_blocksize(fmt));
@@ -923,18 +935,6 @@ radv_image_is_l2_coherent(const struct radv_device *device, const struct radv_im
if (pdev->info.gfx_level >= GFX12) {
return true; /* Everything is coherent with TC L2. */
} else if (pdev->info.gfx_level >= GFX10) {
/* Add a special case for mips in the metadata mip-tail for GFX11. */
if (pdev->info.gfx_level >= GFX11) {
if (image->vk.mip_levels > 1 && (radv_image_has_dcc(image) || radv_image_has_htile(image))) {
for (unsigned i = 0; i < image->plane_count; ++i) {
const struct radeon_surf *surf = &image->planes[i].surface;
if (surf->num_meta_levels != image->vk.mip_levels)
return false;
}
}
}
return !radv_image_is_pipe_misaligned(device, image);
} else if (pdev->info.gfx_level == GFX9) {
if (image->vk.samples == 1 &&