From f0c70c7619111149944b2f4d285d2899024c54b2 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Tue, 28 Mar 2023 12:42:05 -0700 Subject: [PATCH] Handle removed shaders more gracefully in malioc_diff.py (flutter/engine#40720) Handle removed shaders more gracefully in malioc_diff.py --- engine/src/flutter/impeller/tools/malioc_diff.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/impeller/tools/malioc_diff.py b/engine/src/flutter/impeller/tools/malioc_diff.py index 7a77970a89..2bab4588da 100755 --- a/engine/src/flutter/impeller/tools/malioc_diff.py +++ b/engine/src/flutter/impeller/tools/malioc_diff.py @@ -278,6 +278,10 @@ def main(argv): changed = False for filename, shaders in before_json.items(): + if filename not in after_json.keys(): + print('Shader "{}" has been removed.'.format(filename)) + changed = True + continue for core, before_shader in shaders.items(): if core not in after_json[filename].keys(): continue @@ -287,14 +291,15 @@ def main(argv): for filename, shaders in after_json.items(): if filename not in before_json: - print('Shader {} is new.'.format(filename)) + print('Shader "{}" is new.'.format(filename)) changed = True if changed: print( - 'There are new shaders, or performance changes to existing shaders. ' - 'The golden file must be updated after a build of android_debug_unopt ' - 'using the --malioc-path flag to the flutter/tools/gn script.\n\n' + 'There are new shaders, shaders have been removed, or performance ' + 'changes to existing shaders. The golden file must be updated after a ' + 'build of android_debug_unopt using the --malioc-path flag to the ' + 'flutter/tools/gn script.\n\n' '$ ./flutter/impeller/tools/malioc_diff.py --before {} --after {} --update' .format(args.before, args.after) )