From 7bd97313e532f83a1b8d99651b50151941f2675f Mon Sep 17 00:00:00 2001 From: Valentine Burley Date: Sun, 1 Sep 2024 14:06:19 +0000 Subject: [PATCH] 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 Part-of: --- src/freedreno/vulkan/tu_image.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/freedreno/vulkan/tu_image.cc b/src/freedreno/vulkan/tu_image.cc index 0278c8f4bf3..672d9fa3712 100644 --- a/src/freedreno/vulkan/tu_image.cc +++ b/src/freedreno/vulkan/tu_image.cc @@ -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]; }