tu: Use vk_format_get_plane_count instead of special casing

Use the vk_format_get_plane_count helper in tu_image_view_init instead of
checking the formats directly.

Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31304>
This commit is contained in:
Valentine Burley 2024-09-01 14:06:19 +00:00 committed by Marge Bot
parent 913d452dc5
commit 7bd97313e5

View file

@ -227,8 +227,7 @@ tu_image_view_init(struct tu_device *device,
}
if (aspect_mask == VK_IMAGE_ASPECT_COLOR_BIT &&
(vk_format == VK_FORMAT_G8_B8R8_2PLANE_420_UNORM ||
vk_format == VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM)) {
vk_format_get_plane_count(vk_format) > 1) {
layouts[1] = &image->layout[1];
layouts[2] = &image->layout[2];
}