From 84ed058b429a2974ec729f60fee9243240fddc6c Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Mon, 12 Dec 2022 09:44:32 -0800 Subject: [PATCH] [flutter_tools] Add remap sampler support (#116861) --- .../lib/src/build_system/targets/shader_compiler.dart | 1 + .../test/general.shard/asset_bundle_test.dart | 2 ++ .../test/general.shard/build_system/targets/ios_test.dart | 1 + .../build_system/targets/shader_compiler_test.dart | 8 ++++++++ 4 files changed, 12 insertions(+) diff --git a/packages/flutter_tools/lib/src/build_system/targets/shader_compiler.dart b/packages/flutter_tools/lib/src/build_system/targets/shader_compiler.dart index 5ca39654a6..56216a7193 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/shader_compiler.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/shader_compiler.dart @@ -186,6 +186,7 @@ class ShaderCompiler { '--spirv=$outputPath.spirv', '--input=${input.path}', '--input-type=frag', + '--remap-samplers', '--include=${input.parent.path}', '--include=$shaderLibPath', ]; diff --git a/packages/flutter_tools/test/general.shard/asset_bundle_test.dart b/packages/flutter_tools/test/general.shard/asset_bundle_test.dart index bd272f884f..2b34bafed9 100644 --- a/packages/flutter_tools/test/general.shard/asset_bundle_test.dart +++ b/packages/flutter_tools/test/general.shard/asset_bundle_test.dart @@ -453,6 +453,7 @@ flutter: '--spirv=$outputPath.spirv', '--input=/$shaderPath', '--input-type=frag', + '--remap-samplers', '--include=/$assetsPath', '--include=$shaderLibDir', ], @@ -541,6 +542,7 @@ flutter: '--spirv=${fileSystem.path.join(output.path, 'shaders', 'ink_sparkle.frag.spirv')}', '--input=${fileSystem.path.join(materialDir.path, 'shaders', 'ink_sparkle.frag')}', '--input-type=frag', + '--remap-samplers', '--include=${fileSystem.path.join(materialDir.path, 'shaders')}', '--include=$shaderLibDir', ], diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart index 314242fa83..ce1c831959 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart @@ -262,6 +262,7 @@ void main() { '--spirv=/App.framework/flutter_assets/shader.glsl.spirv', '--input=/shader.glsl', '--input-type=frag', + '--remap-samplers', '--include=/', '--include=/./shader_lib', ]), diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/shader_compiler_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/shader_compiler_test.dart index 481a514850..7482bcd971 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/shader_compiler_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/shader_compiler_test.dart @@ -50,6 +50,7 @@ void main() { '--spirv=$outputSpirvPath', '--input=$fragPath', '--input-type=frag', + '--remap-samplers', '--include=$fragDir', '--include=$shaderLibDir', ], @@ -90,6 +91,7 @@ void main() { '--spirv=$outputPath.spirv', '--input=$fragPath', '--input-type=frag', + '--remap-samplers', '--include=$fragDir', '--include=$shaderLibDir', ], @@ -128,6 +130,7 @@ void main() { '--spirv=$outputPath.spirv', '--input=$fragPath', '--input-type=frag', + '--remap-samplers', '--include=$fragDir', '--include=$shaderLibDir', ], @@ -166,6 +169,7 @@ void main() { '--spirv=$outputSpirvPath', '--input=$notFragPath', '--input-type=frag', + '--remap-samplers', '--include=$fragDir', '--include=$shaderLibDir', ], @@ -206,6 +210,7 @@ void main() { '--spirv=$outputSpirvPath', '--input=$notFragPath', '--input-type=frag', + '--remap-samplers', '--include=$fragDir', '--include=$shaderLibDir', ], @@ -248,6 +253,7 @@ void main() { '--spirv=/.tmp_rand0/0.8255140718871702.temp.spirv', '--input=$fragPath', '--input-type=frag', + '--remap-samplers', '--include=$fragDir', '--include=$shaderLibDir', ], @@ -293,6 +299,7 @@ void main() { '--spirv=/.tmp_rand0/0.8255140718871702.temp.spirv', '--input=$fragPath', '--input-type=frag', + '--remap-samplers', '--include=$fragDir', '--include=$shaderLibDir', ], @@ -339,6 +346,7 @@ void main() { '--spirv=/.tmp_rand0/0.8255140718871702.temp.spirv', '--input=$fragPath', '--input-type=frag', + '--remap-samplers', '--include=$fragDir', '--include=$shaderLibDir', ],