gallium: add AYUV and XYUV formats
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 3 Jul 2019 16:14:54 +0000 (12:14 -0400)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 31 Jul 2019 16:50:06 +0000 (09:50 -0700)
this only adds the PIPE_FORMAT members, not any direct handling for them

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/gallium/auxiliary/util/u_format.csv
src/gallium/auxiliary/util/u_format_yuv.c
src/gallium/auxiliary/util/u_format_yuv.h
src/gallium/drivers/svga/svga_format.c
src/gallium/include/pipe/p_format.h

index a7e2dbb70ef198d40b3dae2573f9d79071314c25..b55d7ba0540a89bb20529d1d3bd41729c1046636 100644 (file)
@@ -157,6 +157,10 @@ PIPE_FORMAT_Z24_UNORM_S8_UINT_AS_R8G8B8A8 , plain, 1, 1, un8 , un8 , un8 , un8 ,
 PIPE_FORMAT_UYVY                 , subsampled, 2, 1, x32 ,     ,     ,     , xyz1, yuv
 # http://www.fourcc.org/yuv.php#YUYV (a.k.a http://www.fourcc.org/yuv.php#YUY2)
 PIPE_FORMAT_YUYV                 , subsampled, 2, 1, x32 ,     ,     ,     , xyz1, yuv
+
+PIPE_FORMAT_AYUV                 , other, 4, 4, un8 ,     ,     ,     , xyzw, yuv
+PIPE_FORMAT_XYUV                 , other, 4, 4, un8 ,     ,     ,     , xyz1, yuv
+
 # same subsampling but with rgb channels
 PIPE_FORMAT_R8G8_B8G8_UNORM      , subsampled, 2, 1, x32 ,     ,     ,     , xyz1, rgb
 PIPE_FORMAT_G8R8_G8B8_UNORM      , subsampled, 2, 1, x32 ,     ,     ,     , xyz1, rgb
index e0f85c5aa97734fe9dd124ad725b7b3cbb9faae5..c3ccc35f2726bfdd32cdf997384bcd57e3f7954c 100644 (file)
@@ -1036,6 +1036,52 @@ util_format_p016_fetch_rgba_float(UNUSED float *dst, UNUSED const uint8_t *src,
                              UNUSED unsigned i, UNUSED unsigned j) {}
 
 void
+util_format_xyuv_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_xyuv_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_xyuv_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_xyuv_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_xyuv_fetch_rgba_float(UNUSED float *dst, UNUSED const uint8_t *src,
+                                        UNUSED unsigned i, UNUSED unsigned j) {}
+void
+util_format_ayuv_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_ayuv_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_ayuv_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_ayuv_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_ayuv_fetch_rgba_float(UNUSED float *dst, UNUSED const uint8_t *src,
+                                        UNUSED unsigned i, UNUSED unsigned j) {}
+void
 util_format_r8g8_r8b8_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) {}
index 171cbc928d7266215321602116c6669c09b66229..0acb1747e43a78f63483c7c7309889265a5f4e4b 100644 (file)
@@ -284,6 +284,53 @@ util_format_p016_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
 void
 util_format_p016_fetch_rgba_float(float *dst, const uint8_t *src,
                              unsigned i, unsigned j);
+
+void
+util_format_xyuv_unpack_rgba_float(float *dst_row, unsigned dst_stride,
+                                         const uint8_t *src_row, unsigned src_stride,
+                                         unsigned width, unsigned height);
+
+void
+util_format_xyuv_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_xyuv_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
+                                       const float *src_row, unsigned src_stride,
+                                       unsigned width, unsigned height);
+
+void
+util_format_xyuv_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_xyuv_fetch_rgba_float(float *dst, const uint8_t *src,
+                                        unsigned i, unsigned j);
+void
+util_format_ayuv_unpack_rgba_float(float *dst_row, unsigned dst_stride,
+                                         const uint8_t *src_row, unsigned src_stride,
+                                         unsigned width, unsigned height);
+
+void
+util_format_ayuv_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_ayuv_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
+                                       const float *src_row, unsigned src_stride,
+                                       unsigned width, unsigned height);
+
+void
+util_format_ayuv_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_ayuv_fetch_rgba_float(float *dst, const uint8_t *src,
+                                        unsigned i, unsigned j);
 void
 util_format_r8g8_b8g8_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
                                          const uint8_t *src_row, unsigned src_stride,
index 4ccbb82ceb729c1861645fa16d99aa56a3594d0b..dd49ed96855151612a171ed82c6aed9c496af981 100644 (file)
@@ -379,6 +379,8 @@ static const struct vgpu10_format_entry format_conversion_table[] =
    { PIPE_FORMAT_ATC_RGBA_EXPLICIT,     SVGA3D_FORMAT_INVALID,      SVGA3D_FORMAT_INVALID,       SVGA3D_FORMAT_INVALID,       0 },
    { PIPE_FORMAT_ATC_RGBA_INTERPOLATED, SVGA3D_FORMAT_INVALID,      SVGA3D_FORMAT_INVALID,       SVGA3D_FORMAT_INVALID,       0 },
    { PIPE_FORMAT_Z24_UNORM_S8_UINT_AS_R8G8B8A8, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID,    SVGA3D_FORMAT_INVALID,       0 },
+   { PIPE_FORMAT_AYUV,                  SVGA3D_FORMAT_INVALID,      SVGA3D_FORMAT_INVALID,       SVGA3D_FORMAT_INVALID,       0 },
+   { PIPE_FORMAT_XYUV,                  SVGA3D_FORMAT_INVALID,      SVGA3D_FORMAT_INVALID,       SVGA3D_FORMAT_INVALID,       0 },
 };
 
 
index 42908e9a720bf6185916dfb9ce6d1305f901edd0..973442e608f19b4b9a34c982bca9c500cf163ffe 100644 (file)
@@ -409,6 +409,9 @@ enum pipe_format {
 
    PIPE_FORMAT_Z24_UNORM_S8_UINT_AS_R8G8B8A8 = 320,
 
+   PIPE_FORMAT_AYUV                    = 321,
+   PIPE_FORMAT_XYUV                    = 322,
+
    PIPE_FORMAT_COUNT
 };