Module: Mesa
Branch: master
Commit: 31a5135cd793951191c4a2fb86a50253a9931454
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=31a5135cd793951191c4a2fb86a50253a9931454

Author: Nanley Chery <nanley.g.ch...@intel.com>
Date:   Wed Aug 26 16:25:44 2015 -0700

mesa/formats: add MESA_LAYOUT_LATC

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.pho...@gmail.com>
Signed-off-by: Nanley Chery <nanley.g.ch...@intel.com>

---

 src/mesa/main/format_info.py |    2 +-
 src/mesa/main/formats.c      |   11 -----------
 src/mesa/main/formats.csv    |    8 ++++----
 src/mesa/main/formats.h      |    1 +
 src/mesa/main/texcompress.c  |    1 +
 5 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/src/mesa/main/format_info.py b/src/mesa/main/format_info.py
index 22eb5a7..50626a85 100644
--- a/src/mesa/main/format_info.py
+++ b/src/mesa/main/format_info.py
@@ -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':
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 982103f..9f92007 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -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)
diff --git a/src/mesa/main/formats.csv b/src/mesa/main/formats.csv
index 11228e0..529de31 100644
--- a/src/mesa/main/formats.csv
+++ b/src/mesa/main/formats.csv
@@ -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
diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h
index 2b8146c..794d599 100644
--- a/src/mesa/main/formats.h
+++ b/src/mesa/main/formats.h
@@ -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,
diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
index 394c8ba..e0294a8 100644
--- a/src/mesa/main/texcompress.c
+++ b/src/mesa/main/texcompress.c
@@ -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);

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to