summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2015-08-26 16:25:44 -0700
committerNanley Chery <[email protected]>2015-09-19 13:25:59 -0700
commit31a5135cd793951191c4a2fb86a50253a9931454 (patch)
tree0e483509e46230b4d53b1d9ee96fca4c780e096a /src
parentc228514c72cb2fd5fb9e510808e29204fc9e7ae1 (diff)
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 <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/format_info.py2
-rw-r--r--src/mesa/main/formats.c11
-rw-r--r--src/mesa/main/formats.csv8
-rw-r--r--src/mesa/main/formats.h1
-rw-r--r--src/mesa/main/texcompress.c1
5 files changed, 7 insertions, 16 deletions
diff --git a/src/mesa/main/format_info.py b/src/mesa/main/format_info.py
index 22eb5a734a6..50626a858c4 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 982103f3798..9f920075026 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 11228e0f3df..529de31212c 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 2b8146ce932..794d599db3b 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 394c8bab214..e0294a88bfa 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);