radv: fix programming mip level for TILED_SUB_WINDOWS on GFX12

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33252>
This commit is contained in:
Samuel Pitoiset
2025-01-27 10:11:17 -08:00
committed by Marge Bot
parent 7c949f1760
commit 18c7eafcdc
+8 -11
View File
@@ -226,21 +226,18 @@ radv_sdma_get_tiled_info_dword(const struct radv_device *const device, const str
const uint32_t bpe = radv_sdma_get_bpe(image, subresource.aspectMask);
const uint32_t element_size = util_logbase2(bpe);
const uint32_t swizzle_mode = surf->has_stencil ? surf->u.gfx9.zs.stencil_swizzle_mode : surf->u.gfx9.swizzle_mode;
const enum gfx9_resource_type dimension = radv_sdma_surface_resource_type(device, surf);
uint32_t info = element_size | swizzle_mode << 3;
const enum sdma_version ver = pdev->info.sdma_ip_version;
const uint32_t mip_max = MAX2(image->vk.mip_levels, 1);
const uint32_t mip_id = subresource.mipLevel;
if (ver < SDMA_7_0) {
const enum gfx9_resource_type dimension = radv_sdma_surface_resource_type(device, surf);
info |= dimension << 9;
}
if (ver >= SDMA_5_0) {
const uint32_t mip_max = MAX2(image->vk.mip_levels, 1);
const uint32_t mip_id = subresource.mipLevel;
return info | (mip_max - 1) << 16 | mip_id << 20;
if (ver >= SDMA_7_0) {
return info | (mip_max - 1) << 16 | mip_id << 24;
} else if (ver >= SDMA_5_0) {
return info | dimension << 9 | (mip_max - 1) << 16 | mip_id << 20;
} else if (ver >= SDMA_4_0) {
return info | surf->u.gfx9.epitch << 16;
return info | dimension << 9 | surf->u.gfx9.epitch << 16;
} else {
unreachable("unsupported SDMA version");
}