Skip to content

Commit

Permalink
Fix broken mac catalyst build after recent format autogen
Browse files Browse the repository at this point in the history
  • Loading branch information
kakashidinho committed May 9, 2021
1 parent a7cfe31 commit 0eb8aee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions scripts/code_generation_hashes/Metal_format_table.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"src/libANGLE/renderer/angle_format_map.json":
"bca5e686001f6dd0af306af234a36677",
"src/libANGLE/renderer/metal/gen_mtl_format_table.py":
"4717afbffdb84cd15f6a32fdb6d92833",
"46747964c3246db209fa7915986f931c",
"src/libANGLE/renderer/metal/mtl_format_map.json":
"1bd5a07e2fb3da5c057facd95c8c81d4",
"src/libANGLE/renderer/metal/mtl_format_table_autogen.mm":
"7b002f843ecd78e2476b40a8cd2bd910"
"c304a6ad2cbe3907b3336843b4b81f23"
}
5 changes: 3 additions & 2 deletions src/libANGLE/renderer/metal/gen_mtl_format_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def gen_image_map_switch_common_case(angle_format, actual_angle_format):
switch_data += "#endif\n"

# iOS specific
switch_data += "#if TARGET_OS_IOS || TARGET_OS_TV\n"
switch_data += "#if (TARGET_OS_IOS && !TARGET_OS_MACCATALYST) || TARGET_OS_TV\n"
for angle_format in sorted(ios_specific_map.keys()):
if angle_format in astc_specific_map:
# ASTC is only supported since Apple GPU 3 (with 3D textures support)
Expand Down Expand Up @@ -455,7 +455,8 @@ def gen_image_mtl_to_angle_switch_string(image_table):
switch_data += "#endif // TARGET_OS_OSX || TARGET_OS_MACCATALYST\n"

# iOS + macOS 11.0+ specific
switch_data += "#if TARGET_OS_IOS || TARGET_OS_TV || (TARGET_OS_OSX && (__MAC_OS_X_VERSION_MAX_ALLOWED >= 101600))\n"
switch_data += "#if (TARGET_OS_IOS && !TARGET_OS_MACCATALYST) || TARGET_OS_TV || \\\n"
switch_data += " (TARGET_OS_OSX && (__MAC_OS_X_VERSION_MAX_ALLOWED >= 101600))\n"
for angle_format in sorted(ios_specific_map.keys()):
# ETC1_R8G8B8_UNORM_BLOCK is a duplicated of ETC2_R8G8B8_UNORM_BLOCK
if angle_format == 'ETC1_R8G8B8_UNORM_BLOCK':
Expand Down
5 changes: 3 additions & 2 deletions src/libANGLE/renderer/metal/mtl_format_table_autogen.mm
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@
case MTLPixelFormatDepth24Unorm_Stencil8:
return angle::FormatID::D24_UNORM_S8_UINT;
#endif // TARGET_OS_OSX || TARGET_OS_MACCATALYST
#if TARGET_OS_IOS || TARGET_OS_TV || (TARGET_OS_OSX && (__MAC_OS_X_VERSION_MAX_ALLOWED >= 101600))
#if (TARGET_OS_IOS && !TARGET_OS_MACCATALYST) || TARGET_OS_TV || \
(TARGET_OS_OSX && (__MAC_OS_X_VERSION_MAX_ALLOWED >= 101600))
case MTLPixelFormatASTC_10x10_sRGB:
return angle::FormatID::ASTC_10x10_SRGB_BLOCK;
case MTLPixelFormatASTC_10x10_LDR:
Expand Down Expand Up @@ -1163,7 +1164,7 @@
break;

#endif
#if TARGET_OS_IOS || TARGET_OS_TV
#if (TARGET_OS_IOS && !TARGET_OS_MACCATALYST) || TARGET_OS_TV
case angle::FormatID::ASTC_10x10_SRGB_BLOCK:

if (display->supportsAppleGPUFamily(3))
Expand Down

0 comments on commit 0eb8aee

Please sign in to comment.