4646#define kHapFormatRGBADXT5 0xE
4747#define kHapFormatYCoCgDXT5 0xF
4848#define kHapFormatARGTC1 0x1
49+ #define kHapFormatRGBABPTC 0xC
4950
5051/*
5152 Packed byte values for Hap
5253
5354 Format Compressor Byte Code
5455 ----------------------------------------
55- RGB_DXT1 None 0xAB
56- RGB_DXT1 Snappy 0xBB
57- RGB_DXT1 Complex 0xCB
58- RGBA_DXT5 None 0xAE
59- RGBA_DXT5 Snappy 0xBE
60- RGBA_DXT5 Complex 0xCE
61- YCoCg_DXT5 None 0xAF
62- YCoCg_DXT5 Snappy 0xBF
63- YCoCg_DXT5 Complex 0xCF
64- A_RGTC1 None 0xA1
65- A_RGTC1 Snappy 0xB1
66- A_RGTC1 Complex 0xC1
56+ RGB_DXT1 None 0xAB
57+ RGB_DXT1 Snappy 0xBB
58+ RGB_DXT1 Complex 0xCB
59+ RGBA_DXT5 None 0xAE
60+ RGBA_DXT5 Snappy 0xBE
61+ RGBA_DXT5 Complex 0xCE
62+ YCoCg_DXT5 None 0xAF
63+ YCoCg_DXT5 Snappy 0xBF
64+ YCoCg_DXT5 Complex 0xCF
65+ A_RGTC1 None 0xA1
66+ A_RGTC1 Snappy 0xB1
67+ A_RGTC1 Complex 0xC1
68+ RGBA_BPTC_UNORM None 0xAC
69+ RGBA_BPTC_UNORM Snappy 0xBC
70+ RGBA_BPTC_UNORM Complex 0xCC
6771 */
6872
6973/*
@@ -212,6 +216,8 @@ static unsigned int hap_texture_format_constant_for_format_identifier(unsigned i
212216 return HapTextureFormat_YCoCg_DXT5 ;
213217 case kHapFormatARGTC1 :
214218 return HapTextureFormat_A_RGTC1 ;
219+ case kHapFormatRGBABPTC :
220+ return HapTextureFormat_RGBA_BPTC_UNORM ;
215221 default :
216222 return 0 ;
217223
@@ -231,6 +237,8 @@ static unsigned int hap_texture_format_identifier_for_format_constant(unsigned i
231237 return kHapFormatYCoCgDXT5 ;
232238 case HapTextureFormat_A_RGTC1 :
233239 return kHapFormatARGTC1 ;
240+ case HapTextureFormat_RGBA_BPTC_UNORM :
241+ return kHapFormatRGBABPTC ;
234242 default :
235243 return 0 ;
236244 }
@@ -346,6 +354,7 @@ static unsigned int hap_encode_texture(const void *inputBuffer, unsigned long in
346354 && textureFormat != HapTextureFormat_RGBA_DXT5
347355 && textureFormat != HapTextureFormat_YCoCg_DXT5
348356 && textureFormat != HapTextureFormat_A_RGTC1
357+ && textureFormat != HapTextureFormat_RGBA_BPTC_UNORM
349358 )
350359 || (compressor != HapCompressorNone
351360 && compressor != HapCompressorSnappy
0 commit comments