mesa/formats: add MESA_LAYOUT_LATC
authorNanley Chery <nanley.g.chery@intel.com>
Wed, 26 Aug 2015 23:25:44 +0000 (16:25 -0700)
committerNanley Chery <nanley.g.chery@intel.com>
Sat, 19 Sep 2015 20:25:59 +0000 (13:25 -0700)
This enables us to predicate statments on a compressed format being
a type of LATC format. Also, remove the comment that lists the enum
(it was getting a tad long).

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
src/mesa/main/format_info.py
src/mesa/main/formats.c
src/mesa/main/formats.csv
src/mesa/main/formats.h
src/mesa/main/texcompress.c

index 22eb5a7..50626a8 100644 (file)
@@ -111,7 +111,7 @@ def get_channel_bits(fmat, chan_name):
             return 1 if fmat.has_channel('a') else 0
          else:
             return 0
-      elif fmat.layout == 'rgtc':
+      elif fmat.layout in ('rgtc', 'latc'):
          return 8 if fmat.has_channel(chan_name) else 0
       elif fmat.layout in ('etc1', 'etc2'):
          if fmat.name.endswith('_ALPHA1') and chan_name == 'a':
index 982103f..9f92007 100644 (file)
@@ -188,17 +188,6 @@ _mesa_get_format_max_bits(mesa_format format)
 
 /**
  * Return the layout type of the given format.
- * The return value will be one of:
- *    MESA_FORMAT_LAYOUT_ARRAY
- *    MESA_FORMAT_LAYOUT_PACKED
- *    MESA_FORMAT_LAYOUT_S3TC
- *    MESA_FORMAT_LAYOUT_RGTC
- *    MESA_FORMAT_LAYOUT_FXT1
- *    MESA_FORMAT_LAYOUT_ETC1
- *    MESA_FORMAT_LAYOUT_ETC2
- *    MESA_FORMAT_LAYOUT_BPTC
- *    MESA_FORMAT_LAYOUT_ASTC
- *    MESA_FORMAT_LAYOUT_OTHER
  */
 extern enum mesa_format_layout
 _mesa_get_format_layout(mesa_format format)
index 11228e0..529de31 100644 (file)
@@ -294,10 +294,10 @@ MESA_FORMAT_RG_RGTC2_UNORM                , rgtc  , 4, 4, x128,     ,     ,
 MESA_FORMAT_RG_RGTC2_SNORM                , rgtc  , 4, 4, x128,     ,     ,     , xy01, rgb
 
 # LATC1/2 compressed formats
-MESA_FORMAT_L_LATC1_UNORM                 , rgtc  , 4, 4, x64 ,     ,     ,     , xxx1, rgb
-MESA_FORMAT_L_LATC1_SNORM                 , rgtc  , 4, 4, x64 ,     ,     ,     , xxx1, rgb
-MESA_FORMAT_LA_LATC2_UNORM                , rgtc  , 4, 4, x128,     ,     ,     , xxxy, rgb
-MESA_FORMAT_LA_LATC2_SNORM                , rgtc  , 4, 4, x128,     ,     ,     , xxxy, rgb
+MESA_FORMAT_L_LATC1_UNORM                 , latc  , 4, 4, x64 ,     ,     ,     , xxx1, rgb
+MESA_FORMAT_L_LATC1_SNORM                 , latc  , 4, 4, x64 ,     ,     ,     , xxx1, rgb
+MESA_FORMAT_LA_LATC2_UNORM                , latc  , 4, 4, x128,     ,     ,     , xxxy, rgb
+MESA_FORMAT_LA_LATC2_SNORM                , latc  , 4, 4, x128,     ,     ,     , xxxy, rgb
 
 # ETC1/2 compressed formats
 MESA_FORMAT_ETC1_RGB8                     , etc1  , 4, 4, x64 ,     ,     ,     , xyz1, rgb
index 2b8146c..794d599 100644 (file)
@@ -66,6 +66,7 @@ enum mesa_format_layout {
    MESA_FORMAT_LAYOUT_PACKED,
    MESA_FORMAT_LAYOUT_S3TC,
    MESA_FORMAT_LAYOUT_RGTC,
+   MESA_FORMAT_LAYOUT_LATC,
    MESA_FORMAT_LAYOUT_FXT1,
    MESA_FORMAT_LAYOUT_ETC1,
    MESA_FORMAT_LAYOUT_ETC2,
index 394c8ba..e0294a8 100644 (file)
@@ -728,6 +728,7 @@ _mesa_get_compressed_fetch_func(mesa_format format)
    case MESA_FORMAT_LAYOUT_FXT1:
       return _mesa_get_fxt_fetch_func(format);
    case MESA_FORMAT_LAYOUT_RGTC:
+   case MESA_FORMAT_LAYOUT_LATC:
       return _mesa_get_compressed_rgtc_func(format);
    case MESA_FORMAT_LAYOUT_ETC1:
       return _mesa_get_etc_fetch_func(format);