Mesa (master): util/format: Use correct pipe format for VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat May 30 01:42:03 UTC 2020


Module: Mesa
Branch: master
Commit: d491b0dfd97c27b245ad0ed0e7356377f25ebe67
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d491b0dfd97c27b245ad0ed0e7356377f25ebe67

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Sun May 24 22:57:28 2020 +0200

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 at anholt.net>
Reviewed-by: Jonathan Marek <jonathan at marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5195>

---

 src/vulkan/util/vk_format.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vulkan/util/vk_format.c b/src/vulkan/util/vk_format.c
index c74e2047a73..2b89e0bdeea 100644
--- a/src/vulkan/util/vk_format.c
+++ b/src/vulkan/util/vk_format.c
@@ -251,7 +251,7 @@ vk_format_to_pipe_format(enum VkFormat vkformat)
       case VK_FORMAT_B8G8R8G8_422_UNORM:
          return PIPE_FORMAT_UYVY;
       case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:
-         return PIPE_FORMAT_YV12;
+         return PIPE_FORMAT_IYUV;
       case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:
          return PIPE_FORMAT_NV12;
       default:



More information about the mesa-commit mailing list