[flutter_tool] Build shaders as .iplr and use FragmentProgram.fromAsset for ink_sparkle (#108071)

This commit is contained in:
Zachary Anderson
2022-07-21 20:50:08 -07:00
committed by GitHub
parent cc62a5b961
commit dd20919ad6
4 changed files with 30 additions and 19 deletions

View File

@@ -5,6 +5,7 @@
import 'package:process/process.dart';
import '../../artifacts.dart';
import '../../base/error_handling_io.dart';
import '../../base/file_system.dart';
import '../../base/io.dart';
import '../../base/logger.dart';
@@ -64,8 +65,10 @@ class ShaderCompiler {
// TODO(zanderso): When impeller is enabled, the correct flags for the
// target backend will need to be passed.
// https://github.com/flutter/flutter/issues/102853
'--flutter-spirv',
'--spirv=$outputPath',
'--sksl',
'--iplr',
'--sl=$outputPath',
'--spirv=$outputPath.spirv',
'--input=${input.path}',
'--input-type=frag',
'--include=${input.parent.path}',
@@ -81,6 +84,7 @@ class ShaderCompiler {
);
}
ErrorHandlingFileSystem.deleteIfExists(_fs.file('$outputPath.spirv'));
return true;
}
}