mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
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.phogat@gmail.com> Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
This commit is contained in:
parent
c228514c72
commit
31a5135cd7
5 changed files with 7 additions and 16 deletions
|
|
@ -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':
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
Can't render this file because it contains an unexpected character in line 9 and column 3.
|
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue