util/format: Add more multi-planar formats.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 24 May 2020 22:05:20 +0000 (00:05 +0200)
committerMarge Bot <eric+marge@anholt.net>
Sat, 30 May 2020 01:22:51 +0000 (01:22 +0000)
These don't have a fourcc code as far as I can tell, but we want
them for internal Vulkan use.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5195>

src/gallium/include/pipe/p_format.h
src/util/format/u_format.csv
src/util/format/u_format.h
src/util/format/u_format_yuv.c
src/util/format/u_format_yuv.h
src/vulkan/util/vk_format.c

index 8b10aae40a6602c96df865bc84cd39c5317a069b..f1a4652c36eca96916f31af4f159f2658adbca5b 100644 (file)
@@ -240,6 +240,18 @@ enum pipe_format {
    PIPE_FORMAT_NV12,
    PIPE_FORMAT_NV21,
 
+   /* PIPE_FORMAT_Y8_U8_V8_420_UNORM = IYUV */
+   /* PIPE_FORMAT_Y8_U8V8_420_UNORM = NV12 */
+   PIPE_FORMAT_Y8_U8_V8_422_UNORM,
+   PIPE_FORMAT_Y8_U8V8_422_UNORM,
+   PIPE_FORMAT_Y8_U8_V8_444_UNORM,
+
+   PIPE_FORMAT_Y16_U16_V16_420_UNORM,
+    /* PIPE_FORMAT_Y16_U16V16_420_UNORM */
+   PIPE_FORMAT_Y16_U16_V16_422_UNORM,
+   PIPE_FORMAT_Y16_U16V16_422_UNORM,
+   PIPE_FORMAT_Y16_U16_V16_444_UNORM,
+
    PIPE_FORMAT_A4R4_UNORM,
    PIPE_FORMAT_R4A4_UNORM,
    PIPE_FORMAT_R8A8_UNORM,
@@ -571,11 +583,19 @@ pipe_format_to_chroma_format(enum pipe_format format)
       case PIPE_FORMAT_IYUV:
       case PIPE_FORMAT_P010:
       case PIPE_FORMAT_P016:
+      case PIPE_FORMAT_Y16_U16_V16_420_UNORM:
          return PIPE_VIDEO_CHROMA_FORMAT_420;
       case PIPE_FORMAT_UYVY:
       case PIPE_FORMAT_YUYV:
       case PIPE_FORMAT_YV16:
+      case PIPE_FORMAT_Y8_U8_V8_422_UNORM:
+      case PIPE_FORMAT_Y8_U8V8_422_UNORM:
+      case PIPE_FORMAT_Y16_U16_V16_422_UNORM:
+      case PIPE_FORMAT_Y16_U16V16_422_UNORM:
          return PIPE_VIDEO_CHROMA_FORMAT_422;
+      case PIPE_FORMAT_Y8_U8_V8_444_UNORM:
+      case PIPE_FORMAT_Y16_U16_V16_444_UNORM:
+         return PIPE_VIDEO_CHROMA_FORMAT_444;
       default:
          return PIPE_VIDEO_CHROMA_FORMAT_NONE;
    }
index 97c76a928804ca1a52d6c8b2c18aaf86b71e075f..2f71e70e7368b6ab4468e8ef74bfa535fb07772e 100644 (file)
@@ -386,6 +386,15 @@ 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
 
+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
+
+PIPE_FORMAT_Y16_U16_V16_420_UNORM , planar3, 1, 1, 1,     ,     ,     ,     , xyzw, yuv
+PIPE_FORMAT_Y16_U16_V16_422_UNORM , planar3, 1, 1, 1,     ,     ,     ,     , xyzw, yuv
+PIPE_FORMAT_Y16_U16V16_422_UNORM  , planar2, 1, 1, 1,     ,     ,     ,     , xyzw, yuv
+PIPE_FORMAT_Y16_U16_V16_444_UNORM , planar3, 1, 1, 1,     ,     ,     ,     , xyzw, yuv
+
 PIPE_FORMAT_P010                  , planar2, 1, 1, 1,     ,     ,     ,     , xyzw, yuv
 PIPE_FORMAT_P016                  , planar2, 1, 1, 1,     ,     ,     ,     , xyzw, yuv
 
index 1b6f0b882893a316bbcdf01fbc1196a41a1decf4..f13dc9fc0d8d40f8270ba31c79a84fd30ad5a4cc 100644 (file)
@@ -1336,13 +1336,21 @@ util_format_get_plane_format(enum pipe_format format, unsigned plane)
    case PIPE_FORMAT_YV12:
    case PIPE_FORMAT_YV16:
    case PIPE_FORMAT_IYUV:
+   case PIPE_FORMAT_Y8_U8_V8_422_UNORM:
+   case PIPE_FORMAT_Y8_U8_V8_444_UNORM:
       return PIPE_FORMAT_R8_UNORM;
    case PIPE_FORMAT_NV12:
+   case PIPE_FORMAT_Y8_U8V8_422_UNORM:
       return !plane ? PIPE_FORMAT_R8_UNORM : PIPE_FORMAT_RG88_UNORM;
    case PIPE_FORMAT_NV21:
       return !plane ? PIPE_FORMAT_R8_UNORM : PIPE_FORMAT_GR88_UNORM;
+   case PIPE_FORMAT_Y16_U16_V16_420_UNORM:
+   case PIPE_FORMAT_Y16_U16_V16_422_UNORM:
+   case PIPE_FORMAT_Y16_U16_V16_444_UNORM:
+      return PIPE_FORMAT_R16_UNORM;
    case PIPE_FORMAT_P010:
    case PIPE_FORMAT_P016:
+   case PIPE_FORMAT_Y16_U16V16_422_UNORM:
       return !plane ? PIPE_FORMAT_R16_UNORM : PIPE_FORMAT_R16G16_UNORM;
    default:
       return format;
@@ -1361,6 +1369,11 @@ util_format_get_plane_width(enum pipe_format format, unsigned plane,
    case PIPE_FORMAT_NV21:
    case PIPE_FORMAT_P010:
    case PIPE_FORMAT_P016:
+   case PIPE_FORMAT_Y8_U8_V8_422_UNORM:
+   case PIPE_FORMAT_Y8_U8V8_422_UNORM:
+   case PIPE_FORMAT_Y16_U16_V16_420_UNORM:
+   case PIPE_FORMAT_Y16_U16_V16_422_UNORM:
+   case PIPE_FORMAT_Y16_U16V16_422_UNORM:
       return !plane ? width : (width + 1) / 2;
    default:
       return width;
@@ -1378,6 +1391,7 @@ util_format_get_plane_height(enum pipe_format format, unsigned plane,
    case PIPE_FORMAT_NV21:
    case PIPE_FORMAT_P010:
    case PIPE_FORMAT_P016:
+   case PIPE_FORMAT_Y16_U16_V16_420_UNORM:
       return !plane ? height : (height + 1) / 2;
    case PIPE_FORMAT_YV16:
    default:
index ae088f4397871b7072341938fb343e90f777a33f..a6e0c2f07962898ca81058737ca77531bbfb182e 100644 (file)
@@ -1147,3 +1147,143 @@ util_format_g8r8_b8r8_unorm_pack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED uns
 void
 util_format_g8r8_b8r8_unorm_fetch_rgba_float(UNUSED float *dst, UNUSED const uint8_t *src,
                                         UNUSED unsigned i, UNUSED unsigned j) {}
+
+void
+util_format_y8_u8_v8_422_unorm_unpack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y8_u8_v8_422_unorm_pack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y8_u8_v8_422_unorm_unpack_rgba_float(UNUSED float *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y8_u8_v8_422_unorm_pack_rgba_float(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const float *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y8_u8_v8_422_unorm_fetch_rgba_float(UNUSED float *dst, UNUSED const uint8_t *src,
+                             UNUSED unsigned i, UNUSED unsigned j) {}
+
+void
+util_format_y8_u8v8_422_unorm_unpack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y8_u8v8_422_unorm_pack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y8_u8v8_422_unorm_unpack_rgba_float(UNUSED float *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y8_u8v8_422_unorm_pack_rgba_float(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const float *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y8_u8v8_422_unorm_fetch_rgba_float(UNUSED float *dst, UNUSED const uint8_t *src,
+                             UNUSED unsigned i, UNUSED unsigned j) {}
+
+void
+util_format_y8_u8_v8_444_unorm_unpack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y8_u8_v8_444_unorm_pack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y8_u8_v8_444_unorm_unpack_rgba_float(UNUSED float *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y8_u8_v8_444_unorm_pack_rgba_float(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const float *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y8_u8_v8_444_unorm_fetch_rgba_float(UNUSED float *dst, UNUSED const uint8_t *src,
+                             UNUSED unsigned i, UNUSED unsigned j) {}
+
+void
+util_format_y16_u16_v16_420_unorm_unpack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y16_u16_v16_420_unorm_pack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y16_u16_v16_420_unorm_unpack_rgba_float(UNUSED float *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y16_u16_v16_420_unorm_pack_rgba_float(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const float *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y16_u16_v16_420_unorm_fetch_rgba_float(UNUSED float *dst, UNUSED const uint8_t *src,
+                             UNUSED unsigned i, UNUSED unsigned j) {}
+
+void
+util_format_y16_u16_v16_422_unorm_unpack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y16_u16_v16_422_unorm_pack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y16_u16_v16_422_unorm_unpack_rgba_float(UNUSED float *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y16_u16_v16_422_unorm_pack_rgba_float(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const float *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y16_u16_v16_422_unorm_fetch_rgba_float(UNUSED float *dst, UNUSED const uint8_t *src,
+                             UNUSED unsigned i, UNUSED unsigned j) {}
+
+void
+util_format_y16_u16v16_422_unorm_unpack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y16_u16v16_422_unorm_pack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y16_u16v16_422_unorm_unpack_rgba_float(UNUSED float *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y16_u16v16_422_unorm_pack_rgba_float(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const float *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y16_u16v16_422_unorm_fetch_rgba_float(UNUSED float *dst, UNUSED const uint8_t *src,
+                             UNUSED unsigned i, UNUSED unsigned j) {}
+
+void
+util_format_y16_u16_v16_444_unorm_unpack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y16_u16_v16_444_unorm_pack_rgba_8unorm(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y16_u16_v16_444_unorm_unpack_rgba_float(UNUSED float *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const uint8_t *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y16_u16_v16_444_unorm_pack_rgba_float(UNUSED uint8_t *dst_row, UNUSED unsigned dst_stride,
+                             UNUSED const float *src_row, UNUSED unsigned src_stride,
+                             UNUSED unsigned width, UNUSED unsigned height) {}
+void
+util_format_y16_u16_v16_444_unorm_fetch_rgba_float(UNUSED float *dst, UNUSED const uint8_t *src,
+                             UNUSED unsigned i, UNUSED unsigned j) {}
index 37f76dc014cc01c955cf51a691bf6c55d54e5e45..e7f03c8e1573ece117b53ebfbda46808e6ad6e36 100644 (file)
@@ -448,4 +448,144 @@ void
 util_format_g8r8_b8r8_unorm_fetch_rgba_float(float *dst, const uint8_t *src,
                                         unsigned i, unsigned j);
 
+void
+util_format_y8_u8_v8_422_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y8_u8_v8_422_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y8_u8_v8_422_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y8_u8_v8_422_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
+                             const float *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y8_u8_v8_422_unorm_fetch_rgba_float(float *dst, const uint8_t *src,
+                             unsigned i, unsigned j);
+
+void
+util_format_y8_u8v8_422_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y8_u8v8_422_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y8_u8v8_422_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y8_u8v8_422_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
+                             const float *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y8_u8v8_422_unorm_fetch_rgba_float(float *dst, const uint8_t *src,
+                             unsigned i, unsigned j);
+
+void
+util_format_y8_u8_v8_444_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y8_u8_v8_444_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y8_u8_v8_444_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y8_u8_v8_444_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
+                             const float *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y8_u8_v8_444_unorm_fetch_rgba_float(float *dst, const uint8_t *src,
+                             unsigned i, unsigned j);
+
+void
+util_format_y16_u16_v16_420_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y16_u16_v16_420_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y16_u16_v16_420_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y16_u16_v16_420_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
+                             const float *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y16_u16_v16_420_unorm_fetch_rgba_float(float *dst, const uint8_t *src,
+                             unsigned i, unsigned j);
+
+void
+util_format_y16_u16_v16_422_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y16_u16_v16_422_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y16_u16_v16_422_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y16_u16_v16_422_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
+                             const float *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y16_u16_v16_422_unorm_fetch_rgba_float(float *dst, const uint8_t *src,
+                             unsigned i, unsigned j);
+
+void
+util_format_y16_u16v16_422_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y16_u16v16_422_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y16_u16v16_422_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y16_u16v16_422_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
+                             const float *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y16_u16v16_422_unorm_fetch_rgba_float(float *dst, const uint8_t *src,
+                             unsigned i, unsigned j);
+
+void
+util_format_y16_u16_v16_444_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y16_u16_v16_444_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y16_u16_v16_444_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
+                             const uint8_t *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y16_u16_v16_444_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
+                             const float *src_row, unsigned src_stride,
+                             unsigned width, unsigned height);
+void
+util_format_y16_u16_v16_444_unorm_fetch_rgba_float(float *dst, const uint8_t *src,
+                             unsigned i, unsigned j);
+
 #endif /* U_FORMAT_YUV_H_ */
index 2b89e0bdeeaedccb1878e727c22a45c58d60958d..9ffd3b9e292aa3c9dd6c01bb8c628be922a5ca2a 100644 (file)
@@ -254,6 +254,22 @@ vk_format_to_pipe_format(enum VkFormat vkformat)
          return PIPE_FORMAT_IYUV;
       case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:
          return PIPE_FORMAT_NV12;
+      case VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:
+         return PIPE_FORMAT_Y8_U8_V8_422_UNORM;
+      case VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:
+         return PIPE_FORMAT_Y8_U8V8_422_UNORM;
+      case VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:
+         return PIPE_FORMAT_Y8_U8_V8_444_UNORM;
+      case VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:
+         return PIPE_FORMAT_Y16_U16_V16_420_UNORM;
+      case VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:
+         return PIPE_FORMAT_P016;
+      case VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:
+         return PIPE_FORMAT_Y16_U16_V16_422_UNORM;
+      case VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:
+         return PIPE_FORMAT_Y16_U16V16_422_UNORM;
+      case VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:
+         return PIPE_FORMAT_Y16_U16_V16_444_UNORM;
       default:
          return PIPE_FORMAT_NONE;
       }