gallium: add ATC format support
authorJonathan Marek <jonathan@marek.ca>
Tue, 5 Feb 2019 15:59:42 +0000 (10:59 -0500)
committerRob Clark <robdclark@gmail.com>
Tue, 23 Apr 2019 17:11:56 +0000 (17:11 +0000)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/util/u_format.csv
src/gallium/auxiliary/util/u_format.h
src/gallium/auxiliary/util/u_format_pack.py
src/gallium/auxiliary/util/u_format_table.py
src/gallium/include/pipe/p_format.h

index 3a2a6331e01050e37a7cf5b4c9ed6b661e34b774..51a08bd6530c10b646b268c4690424cb66d1a5ab 100644 (file)
@@ -237,6 +237,10 @@ PIPE_FORMAT_ASTC_10x10_SRGB       , astc,10,10, x128,     ,     ,     , xyzw, sr
 PIPE_FORMAT_ASTC_12x10_SRGB       , astc,12,10, x128,     ,     ,     , xyzw, srgb
 PIPE_FORMAT_ASTC_12x12_SRGB       , astc,12,12, x128,     ,     ,     , xyzw, srgb
 
+PIPE_FORMAT_ATC_RGB               ,  atc, 4, 4, x64,      ,     ,     , xyz1, rgb
+PIPE_FORMAT_ATC_RGBA_EXPLICIT     ,  atc, 4, 4, x128,     ,     ,     , xyzw, rgb
+PIPE_FORMAT_ATC_RGBA_INTERPOLATED ,  atc, 4, 4, x128,     ,     ,     , xyzw, rgb
+
 # Straightforward D3D10-like formats (also used for 
 # vertex buffer element description)
 # 
index cb1138947aad659871bd548c48747142925b8212..cf69460e050db2756d2bf0421b51a902a6abbf91 100644 (file)
@@ -88,10 +88,15 @@ enum util_format_layout {
     */
    UTIL_FORMAT_LAYOUT_ASTC = 8,
 
+   /**
+    * ATC
+    */
+   UTIL_FORMAT_LAYOUT_ATC = 9,
+
    /**
     * Everything else that doesn't fit in any of the above layouts.
     */
-   UTIL_FORMAT_LAYOUT_OTHER = 9
+   UTIL_FORMAT_LAYOUT_OTHER = 10
 };
 
 
@@ -485,6 +490,7 @@ util_format_is_compressed(enum pipe_format format)
    case UTIL_FORMAT_LAYOUT_ETC:
    case UTIL_FORMAT_LAYOUT_BPTC:
    case UTIL_FORMAT_LAYOUT_ASTC:
+   case UTIL_FORMAT_LAYOUT_ATC:
       /* XXX add other formats in the future */
       return TRUE;
    default:
index 62e531716cae554b1bf0f1d19058a324610e3d88..b43851720ad57fc25f9a6f2f18c16bbf31378a01 100644 (file)
@@ -696,7 +696,7 @@ def generate_format_fetch(format, dst_channel, dst_native_type, dst_suffix):
 
 
 def is_format_hand_written(format):
-    return format.layout in ('s3tc', 'rgtc', 'etc', 'bptc', 'astc', 'subsampled', 'other') or format.colorspace == ZS
+    return format.layout in ('s3tc', 'rgtc', 'etc', 'bptc', 'astc', 'atc', 'subsampled', 'other') or format.colorspace == ZS
 
 
 def generate(formats):
index 97cd047438269aab00618609a063e41ecbb6629b..731e2fbae78c7527d59155a6710d0388c9944813 100644 (file)
@@ -142,7 +142,7 @@ def write_format_table(formats):
         u_format_pack.print_channels(format, do_swizzle_array)
         print("   %s," % (colorspace_map(format.colorspace),))
         access = True
-        if format.layout == 'astc':
+        if format.layout == 'astc' or format.layout == 'atc':
             access = False
         if format.layout == 'etc' and format.short_name() != 'etc1_rgb8':
             access = False
index c81fc67b8e89f842b9de898b435e731f54acd9cd..a4401658f5fa3f41decd1673addaa005c53d527f 100644 (file)
@@ -403,6 +403,10 @@ enum pipe_format {
    PIPE_FORMAT_A8B8G8R8_SINT           = 315,
    PIPE_FORMAT_X8B8G8R8_SINT           = 316,
 
+   PIPE_FORMAT_ATC_RGB                 = 317,
+   PIPE_FORMAT_ATC_RGBA_EXPLICIT       = 318,
+   PIPE_FORMAT_ATC_RGBA_INTERPOLATED   = 319,
+
    PIPE_FORMAT_COUNT
 };