From 23580b09a34a4d6594cd5e62556f1285c03b353d Mon Sep 17 00:00:00 2001 From: Sathishkumar S Date: Wed, 29 Mar 2023 02:03:38 -0500 Subject: [PATCH] util/format: add planar3 r8_g8_b8_unorm pipe format add pipe format to represent three plane 8bit RGB format Signed-off-by: Sathishkumar S Reviewed-by: Leo Liu Part-of: --- src/util/format/u_format.csv | 1 + src/util/format/u_format.h | 1 + src/util/format/u_format_table.py | 1 + src/util/format/u_formats.h | 1 + 4 files changed, 4 insertions(+) diff --git a/src/util/format/u_format.csv b/src/util/format/u_format.csv index 41664a98609..ef00ec776eb 100644 --- a/src/util/format/u_format.csv +++ b/src/util/format/u_format.csv @@ -404,6 +404,7 @@ PIPE_FORMAT_Y8_400_UNORM , other , 1, 1, 1, un8, , , , x0 PIPE_FORMAT_R8_G8B8_420_UNORM , planar2, 1, 1, 1, un8, , , , xyzw, rgb PIPE_FORMAT_G8_B8R8_420_UNORM , planar2, 1, 1, 1, un8, , , , xyzw, rgb PIPE_FORMAT_G8_B8_R8_420_UNORM , planar3, 1, 1, 1, un8, , , , xyzw, rgb +PIPE_FORMAT_R8_G8_B8_UNORM , planar3, 1, 1, 1, un8, , , , xyzw, rgb # While most of Mesa uses R8 for Y, U, and V planes, freedreno requires distinguishing # between tiled Y8 data and tiled R8 data. diff --git a/src/util/format/u_format.h b/src/util/format/u_format.h index 439c3ceb0cc..5c24ab6f745 100644 --- a/src/util/format/u_format.h +++ b/src/util/format/u_format.h @@ -1378,6 +1378,7 @@ util_format_get_plane_format(enum pipe_format format, unsigned plane) case PIPE_FORMAT_Y8_U8_V8_422_UNORM: case PIPE_FORMAT_Y8_U8_V8_444_UNORM: case PIPE_FORMAT_Y8_400_UNORM: + case PIPE_FORMAT_R8_G8_B8_UNORM: return PIPE_FORMAT_R8_UNORM; case PIPE_FORMAT_NV12: case PIPE_FORMAT_Y8_U8V8_422_UNORM: diff --git a/src/util/format/u_format_table.py b/src/util/format/u_format_table.py index fdab1a2e069..667c27141bf 100644 --- a/src/util/format/u_format_table.py +++ b/src/util/format/u_format_table.py @@ -113,6 +113,7 @@ def has_access(format): 'r8_g8b8_420_unorm', 'g8_b8r8_420_unorm', 'g8_b8_r8_420_unorm', + 'r8_g8_b8_unorm', 'y8_unorm', ] if format.short_name() in noaccess_formats: diff --git a/src/util/format/u_formats.h b/src/util/format/u_formats.h index 37a5892fc09..19c9b9a0388 100644 --- a/src/util/format/u_formats.h +++ b/src/util/format/u_formats.h @@ -509,6 +509,7 @@ enum pipe_format { PIPE_FORMAT_R8_G8B8_420_UNORM, PIPE_FORMAT_G8_B8R8_420_UNORM, PIPE_FORMAT_G8_B8_R8_420_UNORM, + PIPE_FORMAT_R8_G8_B8_UNORM, PIPE_FORMAT_Y8_UNORM, PIPE_FORMAT_B8G8R8X8_SNORM,