util/format: Use correct pipe format for VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 24 May 2020 20:57:28 +0000 (22:57 +0200)
committerMarge Bot <eric+marge@anholt.net>
Sat, 30 May 2020 01:22:51 +0000 (01:22 +0000)
commitd491b0dfd97c27b245ad0ed0e7356377f25ebe67
tree395d6922d118832f4d2cb12d2a50fe57d047f0a5
parent273ead81f1a219b39a93abbed4db548d8eeb0e5f
util/format: Use correct pipe format for VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM.

NV12 is UVUVUV (https://wiki.videolan.org/YUV#NV12) and in Vulkan is
VK_FORMAT_G8_B8R8_2PLANE_420_UNORM. So U=B and V=R. So plane order in
VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM is YUV, which is PIPE_FORMAT_IYUV.

Further confirmation: https://fourcc.org/yuv.php U=Cb V=Cr. From the nir
ycbcr conversion, B=Cb and R=Cr.

Fixes: 75d7ee80291 "util/format: translate 422_UNORM and 420_UNORM vulkan formats"
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5195>
src/vulkan/util/vk_format.c