Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit e8e0e0b

Browse files
authored
Add support for the Metal backend on all iOS builds. (#17080)
1 parent 0e8a2f3 commit e8e0e0b

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tools/gn

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ def get_out_dir(args):
4444
if args.enable_vulkan:
4545
target_dir.append('vulkan')
4646

47-
if args.enable_metal and args.target_os == 'ios':
48-
target_dir.append('metal')
49-
5047
return os.path.join(args.out_dir, 'out', '_'.join(target_dir))
5148

5249
def to_command_line(gn_args):
@@ -219,17 +216,18 @@ def to_gn_args(args):
219216
gn_args['use_goma'] = False
220217
gn_args['goma_dir'] = None
221218

222-
if args.enable_metal:
223-
gn_args['skia_use_metal'] = True
224-
gn_args['shell_enable_metal'] = True
225-
gn_args['allow_deprecated_api_calls'] = True
226-
227219
if args.enable_vulkan:
228220
# Enable vulkan in the Flutter shell.
229221
gn_args['shell_enable_vulkan'] = True
230222
# Configure Skia for Vulkan support.
231223
gn_args['skia_use_vulkan'] = True
232224

225+
# Enable Metal on non-simulator iOS builds.
226+
if args.target_os == 'ios':
227+
gn_args['skia_use_metal'] = not args.simulator
228+
gn_args['shell_enable_metal'] = not args.simulator
229+
gn_args['allow_deprecated_api_calls'] = not args.simulator
230+
233231
# The buildroot currently isn't set up to support Vulkan in the
234232
# Windows ANGLE build, so disable it regardless of enable_vulkan's value.
235233
if sys.platform.startswith(('cygwin', 'win')):

0 commit comments

Comments
 (0)