util/format: Add VK_FORMAT_D16_UNORM_S8_UINT.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 24 May 2020 17:11:16 +0000 (19:11 +0200)
committerMarge Bot <eric+marge@anholt.net>
Sat, 30 May 2020 01:22:51 +0000 (01:22 +0000)
Not participating in packing/unpacking/stencil-only/depth-only,
because it doesn't mix well in a single plane.

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_zs.c
src/util/format/u_format_zs.h
src/vulkan/util/vk_format.c

index a51843caa203b888f7bf37a7ff10517f9a0cda99..8b10aae40a6602c96df865bc84cd39c5317a069b 100644 (file)
@@ -58,6 +58,7 @@ enum pipe_format {
    PIPE_FORMAT_UYVY,
    PIPE_FORMAT_YUYV,
    PIPE_FORMAT_Z16_UNORM,
+   PIPE_FORMAT_Z16_UNORM_S8_UINT,
    PIPE_FORMAT_Z32_UNORM,
    PIPE_FORMAT_Z32_FLOAT,
    PIPE_FORMAT_Z24_UNORM_S8_UINT,
index 17c3566ec3e9e74850e4d81c940ba66f29a7576d..97c76a928804ca1a52d6c8b2c18aaf86b71e075f 100644 (file)
@@ -144,6 +144,7 @@ PIPE_FORMAT_R5SG5SB6U_NORM          , plain, 1, 1, 1, sn5 , sn5 , un6 ,     , xy
 # Depth-stencil formats
 PIPE_FORMAT_S8_UINT                 , plain, 1, 1, 1, up8 ,     ,     ,     , _x__, zs
 PIPE_FORMAT_Z16_UNORM               , plain, 1, 1, 1, un16,     ,     ,     , x___, zs
+PIPE_FORMAT_Z16_UNORM_S8_UINT       , plain, 1, 1, 1, un16, up8 ,     ,     , xy__, zs
 PIPE_FORMAT_Z32_UNORM               , plain, 1, 1, 1, un32,     ,     ,     , x___, zs
 PIPE_FORMAT_Z32_FLOAT               , plain, 1, 1, 1, f32 ,     ,     ,     , x___, zs
 PIPE_FORMAT_Z24_UNORM_S8_UINT       , plain, 1, 1, 1, un24, up8 ,     ,     , xy__, zs,    up8 , un24,     ,     , yx__
index d37baab8744aa913db2cfe1a3ed44490f2261713..bbd7e02e563273a8a03e86c844e5d952bf66715a 100644 (file)
@@ -333,6 +333,54 @@ util_format_z32_float_pack_z_32unorm(uint8_t *dst_row, unsigned dst_stride,
    }
 }
 
+void
+util_format_z16_unorm_s8_uint_unpack_z_float(float *dst_row, unsigned dst_stride,
+                                             const uint8_t *src_row, unsigned src_stride,
+                                             unsigned width, unsigned height)
+{
+   unreachable("z16_s8 packing/unpacking is not implemented.");
+}
+
+void
+util_format_z16_unorm_s8_uint_pack_z_float(uint8_t *dst_row, unsigned dst_stride,
+                                           const float *src_row, unsigned src_stride,
+                                           unsigned width, unsigned height)
+{
+   unreachable("z16_s8 packing/unpacking is not implemented.");
+}
+
+void
+util_format_z16_unorm_s8_uint_unpack_z_32unorm(uint32_t *dst_row, unsigned dst_stride,
+                                               const uint8_t *src_row, unsigned src_stride,
+                                               unsigned width, unsigned height)
+{
+   unreachable("z16_s8 packing/unpacking is not implemented.");
+}
+
+void
+util_format_z16_unorm_s8_uint_pack_z_32unorm(uint8_t *dst_row, unsigned dst_stride,
+                                             const uint32_t *src_row, unsigned src_stride,
+                                             unsigned width, unsigned height)
+{
+   unreachable("z16_s8 packing/unpacking is not implemented.");
+}
+
+void
+util_format_z16_unorm_s8_uint_unpack_s_8uint(uint8_t *dst_row, unsigned dst_stride,
+                                             const uint8_t *src_row, unsigned src_stride,
+                                             unsigned width, unsigned height)
+{
+   unreachable("z16_s8 packing/unpacking is not implemented.");
+}
+
+void
+util_format_z16_unorm_s8_uint_pack_s_8uint(uint8_t *dst_row, unsigned dst_stride,
+                                           const uint8_t *src_row, unsigned src_stride,
+                                           unsigned width, unsigned height)
+{
+   unreachable("z16_s8 packing/unpacking is not implemented.");
+}
+
 void
 util_format_z24_unorm_s8_uint_unpack_z_float(float *dst_row, unsigned dst_stride,
                                                 const uint8_t *src_row, unsigned src_stride,
index bed3c5198e8f1ca65c30dc5cf16ff7a6a0f29c24..61fb960f9c1d444e8078b98e82e6e967263b931c 100644 (file)
@@ -194,6 +194,29 @@ util_format_z32_float_s8x24_uint_unpack_s_8uint(uint8_t *dst_row, unsigned dst_s
 void
 util_format_z32_float_s8x24_uint_pack_s_8uint(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height);
 
+void
+util_format_z16_unorm_s8_uint_unpack_z_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height);
+
+
+void
+util_format_z16_unorm_s8_uint_pack_z_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height);
+
+
+void
+util_format_z16_unorm_s8_uint_unpack_z_32unorm(uint32_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height);
+
+
+void
+util_format_z16_unorm_s8_uint_pack_z_32unorm(uint8_t *dst_row, unsigned dst_stride, const uint32_t *src_row, unsigned src_stride, unsigned width, unsigned height);
+
+
+void
+util_format_z16_unorm_s8_uint_unpack_s_8uint(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height);
+
+
+void
+util_format_z16_unorm_s8_uint_pack_s_8uint(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height);
+
 void
 util_format_x24s8_uint_unpack_s_8uint(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height);
 
index 9afe89f7f20b9d9417bb0110c1854aa6b9bcac43..c74e2047a730a36a501d5bab164dc062f5e40659 100644 (file)
@@ -171,7 +171,7 @@ static const enum pipe_format vk_format_map[] = {
    [VK_FORMAT_X8_D24_UNORM_PACK32] = PIPE_FORMAT_Z24X8_UNORM,
    [VK_FORMAT_D32_SFLOAT] = PIPE_FORMAT_Z32_FLOAT,
    [VK_FORMAT_S8_UINT] = PIPE_FORMAT_S8_UINT,
-   /* Missing D16_UNORM_S8_UINT */
+   [VK_FORMAT_D16_UNORM_S8_UINT] = PIPE_FORMAT_Z16_UNORM_S8_UINT,
    [VK_FORMAT_D24_UNORM_S8_UINT] = PIPE_FORMAT_Z24_UNORM_S8_UINT,
    [VK_FORMAT_D32_SFLOAT_S8_UINT] = PIPE_FORMAT_Z32_FLOAT_S8X24_UINT,