From e23bcb69c3543bb89f92146c23c52038d1b28df9 Mon Sep 17 00:00:00 2001 From: "Kristian H. Kristensen" Date: Mon, 28 Sep 2020 15:34:07 +0000 Subject: [PATCH] util/formats: Add PIPE_FORMAT_R8_G8B8_420_UNORM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a planar, subsampled format. It's basically NV12, but without colorspace conversion. Reviewed-by: Marek Olšák Reviewed-by: Rob Clark Part-of: --- src/gallium/include/pipe/p_format.h | 2 ++ src/util/format/u_format.csv | 4 ++++ src/util/format/u_format_table.py | 1 + 3 files changed, 7 insertions(+) diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index fd3cf5b3236..b39695a6198 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -488,6 +488,8 @@ enum pipe_format { PIPE_FORMAT_AYUV, PIPE_FORMAT_XYUV, + PIPE_FORMAT_R8_G8B8_420_UNORM, + PIPE_FORMAT_COUNT }; diff --git a/src/util/format/u_format.csv b/src/util/format/u_format.csv index 3ed5bb8aaaa..3209b42e1c3 100644 --- a/src/util/format/u_format.csv +++ b/src/util/format/u_format.csv @@ -386,6 +386,10 @@ PIPE_FORMAT_IYUV , planar3, 1, 1, 1, , , , , xy PIPE_FORMAT_NV12 , planar2, 1, 1, 1, , , , , xyzw, yuv PIPE_FORMAT_NV21 , planar2, 1, 1, 1, , , , , xyzw, yuv +# RGB version of NV12 for hardware that supports sampling from +# multiplane textures but needs color-space conversion in the shader. +PIPE_FORMAT_R8_G8B8_420_UNORM , planar2, 1, 1, 1, un8, , , , xyzw, rgb + PIPE_FORMAT_Y8_U8_V8_422_UNORM , planar3, 1, 1, 1, , , , , xyzw, yuv PIPE_FORMAT_Y8_U8V8_422_UNORM , planar2, 1, 1, 1, , , , , xyzw, yuv PIPE_FORMAT_Y8_U8_V8_444_UNORM , planar3, 1, 1, 1, , , , , xyzw, yuv diff --git a/src/util/format/u_format_table.py b/src/util/format/u_format_table.py index e3bbe1d27e6..fa681b716f8 100644 --- a/src/util/format/u_format_table.py +++ b/src/util/format/u_format_table.py @@ -104,6 +104,7 @@ def has_access(format): 'y16_u16_v16_422_unorm', 'y16_u16v16_422_unorm', 'y16_u16_v16_444_unorm', + 'r8_g8b8_420_unorm', ] if format.short_name() in noaccess_formats: return False