gallium: Add the ASTC 3D formats.
authorEric Anholt <eric@anholt.net>
Wed, 14 Aug 2019 19:23:46 +0000 (12:23 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 26 Aug 2019 19:44:00 +0000 (19:44 +0000)
No driver implements them yet, but this is a long way toward gallium
having matching format enums for Mesa formats.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/util/u_format.csv
src/gallium/include/pipe/p_format.h
src/mesa/state_tracker/st_format.c

index 61b991e1f9e8d9079bcbcda012461ad641ce5ae1..800f3726cf7be92aa6c20188d41649809d822276 100644 (file)
@@ -249,6 +249,27 @@ PIPE_FORMAT_ASTC_10x10_SRGB         , astc,10,10, 1, x128,     ,     ,     , xyz
 PIPE_FORMAT_ASTC_12x10_SRGB         , astc,12,10, 1, x128,     ,     ,     , xyzw, srgb
 PIPE_FORMAT_ASTC_12x12_SRGB         , astc,12,12, 1, x128,     ,     ,     , xyzw, srgb
 
+PIPE_FORMAT_ASTC_3x3x3              , astc, 3, 3, 3, x128,     ,     ,     , xyzw, rgb
+PIPE_FORMAT_ASTC_4x3x3              , astc, 4, 3, 3, x128,     ,     ,     , xyzw, rgb
+PIPE_FORMAT_ASTC_4x4x3              , astc, 4, 4, 3, x128,     ,     ,     , xyzw, rgb
+PIPE_FORMAT_ASTC_4x4x4              , astc, 4, 4, 4, x128,     ,     ,     , xyzw, rgb
+PIPE_FORMAT_ASTC_5x4x4              , astc, 5, 4, 4, x128,     ,     ,     , xyzw, rgb
+PIPE_FORMAT_ASTC_5x5x4              , astc, 5, 5, 4, x128,     ,     ,     , xyzw, rgb
+PIPE_FORMAT_ASTC_5x5x5              , astc, 5, 5, 5, x128,     ,     ,     , xyzw, rgb
+PIPE_FORMAT_ASTC_6x5x5              , astc, 6, 5, 5, x128,     ,     ,     , xyzw, rgb
+PIPE_FORMAT_ASTC_6x6x5              , astc, 6, 6, 5, x128,     ,     ,     , xyzw, rgb
+PIPE_FORMAT_ASTC_6x6x6              , astc, 6, 6, 6, x128,     ,     ,     , xyzw, rgb
+PIPE_FORMAT_ASTC_3x3x3_SRGB         , astc, 3, 3, 3, x128,     ,     ,     , xyzw, srgb
+PIPE_FORMAT_ASTC_4x3x3_SRGB         , astc, 4, 3, 3, x128,     ,     ,     , xyzw, srgb
+PIPE_FORMAT_ASTC_4x4x3_SRGB         , astc, 4, 4, 3, x128,     ,     ,     , xyzw, srgb
+PIPE_FORMAT_ASTC_4x4x4_SRGB         , astc, 4, 4, 4, x128,     ,     ,     , xyzw, srgb
+PIPE_FORMAT_ASTC_5x4x4_SRGB         , astc, 5, 4, 4, x128,     ,     ,     , xyzw, srgb
+PIPE_FORMAT_ASTC_5x5x4_SRGB         , astc, 5, 5, 4, x128,     ,     ,     , xyzw, srgb
+PIPE_FORMAT_ASTC_5x5x5_SRGB         , astc, 5, 5, 5, x128,     ,     ,     , xyzw, srgb
+PIPE_FORMAT_ASTC_6x5x5_SRGB         , astc, 6, 5, 5, x128,     ,     ,     , xyzw, srgb
+PIPE_FORMAT_ASTC_6x6x5_SRGB         , astc, 6, 6, 5, x128,     ,     ,     , xyzw, srgb
+PIPE_FORMAT_ASTC_6x6x6_SRGB         , astc, 6, 6, 6, x128,     ,     ,     , xyzw, srgb
+
 PIPE_FORMAT_ATC_RGB                 ,  atc, 4, 4, 1, x64,      ,     ,     , xyz1, rgb
 PIPE_FORMAT_ATC_RGBA_EXPLICIT       ,  atc, 4, 4, 1, x128,     ,     ,     , xyzw, rgb
 PIPE_FORMAT_ATC_RGBA_INTERPOLATED   ,  atc, 4, 4, 1, x128,     ,     ,     , xyzw, rgb
index f4a17247db73bbde760d31c6a28539264bc19cc7..620e192e20c36e446197aa659eb2b8afd9c9eb1d 100644 (file)
@@ -389,6 +389,28 @@ enum pipe_format {
    PIPE_FORMAT_ASTC_12x10_SRGB,
    PIPE_FORMAT_ASTC_12x12_SRGB,
 
+   PIPE_FORMAT_ASTC_3x3x3,
+   PIPE_FORMAT_ASTC_4x3x3,
+   PIPE_FORMAT_ASTC_4x4x3,
+   PIPE_FORMAT_ASTC_4x4x4,
+   PIPE_FORMAT_ASTC_5x4x4,
+   PIPE_FORMAT_ASTC_5x5x4,
+   PIPE_FORMAT_ASTC_5x5x5,
+   PIPE_FORMAT_ASTC_6x5x5,
+   PIPE_FORMAT_ASTC_6x6x5,
+   PIPE_FORMAT_ASTC_6x6x6,
+
+   PIPE_FORMAT_ASTC_3x3x3_SRGB,
+   PIPE_FORMAT_ASTC_4x3x3_SRGB,
+   PIPE_FORMAT_ASTC_4x4x3_SRGB,
+   PIPE_FORMAT_ASTC_4x4x4_SRGB,
+   PIPE_FORMAT_ASTC_5x4x4_SRGB,
+   PIPE_FORMAT_ASTC_5x5x4_SRGB,
+   PIPE_FORMAT_ASTC_5x5x5_SRGB,
+   PIPE_FORMAT_ASTC_6x5x5_SRGB,
+   PIPE_FORMAT_ASTC_6x6x5_SRGB,
+   PIPE_FORMAT_ASTC_6x6x6_SRGB,
+
    PIPE_FORMAT_P016,
 
    PIPE_FORMAT_R10G10B10X2_UNORM,
index 4edb678247340308f39f3ae529127451cd35b478..5f7997c5c5acea5686fae71c297d28faf9238458 100644 (file)
@@ -602,6 +602,47 @@ st_mesa_format_to_pipe_format(const struct st_context *st,
          return PIPE_FORMAT_R8G8B8A8_SRGB;
       return PIPE_FORMAT_ASTC_12x12_SRGB;
 
+   case MESA_FORMAT_RGBA_ASTC_3x3x3:
+      return PIPE_FORMAT_ASTC_3x3x3;
+   case MESA_FORMAT_RGBA_ASTC_4x3x3:
+      return PIPE_FORMAT_ASTC_4x3x3;
+   case MESA_FORMAT_RGBA_ASTC_4x4x3:
+      return PIPE_FORMAT_ASTC_4x4x3;
+   case MESA_FORMAT_RGBA_ASTC_4x4x4:
+      return PIPE_FORMAT_ASTC_4x4x4;
+   case MESA_FORMAT_RGBA_ASTC_5x4x4:
+      return PIPE_FORMAT_ASTC_5x4x4;
+   case MESA_FORMAT_RGBA_ASTC_5x5x4:
+      return PIPE_FORMAT_ASTC_5x5x4;
+   case MESA_FORMAT_RGBA_ASTC_5x5x5:
+      return PIPE_FORMAT_ASTC_5x5x5;
+   case MESA_FORMAT_RGBA_ASTC_6x5x5:
+      return PIPE_FORMAT_ASTC_6x5x5;
+   case MESA_FORMAT_RGBA_ASTC_6x6x5:
+      return PIPE_FORMAT_ASTC_6x6x5;
+   case MESA_FORMAT_RGBA_ASTC_6x6x6:
+      return PIPE_FORMAT_ASTC_6x6x6;
+   case MESA_FORMAT_SRGB8_ALPHA8_ASTC_3x3x3:
+      return PIPE_FORMAT_ASTC_3x3x3_SRGB;
+   case MESA_FORMAT_SRGB8_ALPHA8_ASTC_4x3x3:
+      return PIPE_FORMAT_ASTC_4x3x3_SRGB;
+   case MESA_FORMAT_SRGB8_ALPHA8_ASTC_4x4x3:
+      return PIPE_FORMAT_ASTC_4x4x3_SRGB;
+   case MESA_FORMAT_SRGB8_ALPHA8_ASTC_4x4x4:
+      return PIPE_FORMAT_ASTC_4x4x4_SRGB;
+   case MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x4x4:
+      return PIPE_FORMAT_ASTC_5x4x4_SRGB;
+   case MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x5x4:
+      return PIPE_FORMAT_ASTC_5x5x4_SRGB;
+   case MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x5x5:
+      return PIPE_FORMAT_ASTC_5x5x5_SRGB;
+   case MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x5x5:
+      return PIPE_FORMAT_ASTC_6x5x5_SRGB;
+   case MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x6x5:
+      return PIPE_FORMAT_ASTC_6x6x5_SRGB;
+   case MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x6x6:
+      return PIPE_FORMAT_ASTC_6x6x6_SRGB;
+
    case MESA_FORMAT_ATC_RGB:
       return PIPE_FORMAT_ATC_RGB;
    case MESA_FORMAT_ATC_RGBA_EXPLICIT:
@@ -1095,6 +1136,47 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
    case PIPE_FORMAT_ASTC_12x12_SRGB:
       return MESA_FORMAT_SRGB8_ALPHA8_ASTC_12x12;
 
+   case PIPE_FORMAT_ASTC_3x3x3:
+      return MESA_FORMAT_RGBA_ASTC_3x3x3;
+   case PIPE_FORMAT_ASTC_4x3x3:
+      return MESA_FORMAT_RGBA_ASTC_4x3x3;
+   case PIPE_FORMAT_ASTC_4x4x3:
+      return MESA_FORMAT_RGBA_ASTC_4x4x3;
+   case PIPE_FORMAT_ASTC_4x4x4:
+      return MESA_FORMAT_RGBA_ASTC_4x4x4;
+   case PIPE_FORMAT_ASTC_5x4x4:
+      return MESA_FORMAT_RGBA_ASTC_5x4x4;
+   case PIPE_FORMAT_ASTC_5x5x4:
+      return MESA_FORMAT_RGBA_ASTC_5x5x4;
+   case PIPE_FORMAT_ASTC_5x5x5:
+      return MESA_FORMAT_RGBA_ASTC_5x5x5;
+   case PIPE_FORMAT_ASTC_6x5x5:
+      return MESA_FORMAT_RGBA_ASTC_6x5x5;
+   case PIPE_FORMAT_ASTC_6x6x5:
+      return MESA_FORMAT_RGBA_ASTC_6x6x5;
+   case PIPE_FORMAT_ASTC_6x6x6:
+      return MESA_FORMAT_RGBA_ASTC_6x6x6;
+   case PIPE_FORMAT_ASTC_3x3x3_SRGB:
+      return MESA_FORMAT_SRGB8_ALPHA8_ASTC_3x3x3;
+   case PIPE_FORMAT_ASTC_4x3x3_SRGB:
+      return MESA_FORMAT_SRGB8_ALPHA8_ASTC_4x3x3;
+   case PIPE_FORMAT_ASTC_4x4x3_SRGB:
+      return MESA_FORMAT_SRGB8_ALPHA8_ASTC_4x4x3;
+   case PIPE_FORMAT_ASTC_4x4x4_SRGB:
+      return MESA_FORMAT_SRGB8_ALPHA8_ASTC_4x4x4;
+   case PIPE_FORMAT_ASTC_5x4x4_SRGB:
+      return MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x4x4;
+   case PIPE_FORMAT_ASTC_5x5x4_SRGB:
+      return MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x5x4;
+   case PIPE_FORMAT_ASTC_5x5x5_SRGB:
+      return MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x5x5;
+   case PIPE_FORMAT_ASTC_6x5x5_SRGB:
+      return MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x5x5;
+   case PIPE_FORMAT_ASTC_6x6x5_SRGB:
+      return MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x6x5;
+   case PIPE_FORMAT_ASTC_6x6x6_SRGB:
+      return MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x6x6;
+
    case PIPE_FORMAT_ATC_RGB:
       return MESA_FORMAT_ATC_RGB;
    case PIPE_FORMAT_ATC_RGBA_EXPLICIT: