[Impeller] Add shader include with FlutterFragCoord for use by FragmentProgram (#114214)
This commit is contained in:
@@ -17,6 +17,8 @@ import 'package:flutter_tools/src/globals.dart' as globals;
|
||||
import '../src/common.dart';
|
||||
import '../src/context.dart';
|
||||
|
||||
const String shaderLibDir = './shader_lib';
|
||||
|
||||
void main() {
|
||||
group('AssetBundle.build', () {
|
||||
late FileSystem testFileSystem;
|
||||
@@ -452,6 +454,7 @@ flutter:
|
||||
'--input=/$shaderPath',
|
||||
'--input-type=frag',
|
||||
'--include=/$assetsPath',
|
||||
'--include=$shaderLibDir',
|
||||
],
|
||||
onRun: () {
|
||||
fileSystem.file(outputPath).createSync(recursive: true);
|
||||
@@ -498,6 +501,7 @@ flutter:
|
||||
'--input=/$shaderPath',
|
||||
'--input-type=frag',
|
||||
'--include=/$assetsPath',
|
||||
'--include=$shaderLibDir',
|
||||
],
|
||||
onRun: () {
|
||||
fileSystem.file(outputPath).createSync(recursive: true);
|
||||
@@ -538,6 +542,7 @@ flutter:
|
||||
'--input=${fileSystem.path.join(materialDir.path, 'shaders', 'ink_sparkle.frag')}',
|
||||
'--input-type=frag',
|
||||
'--include=${fileSystem.path.join(materialDir.path, 'shaders')}',
|
||||
'--include=$shaderLibDir',
|
||||
],
|
||||
onRun: () {
|
||||
fileSystem.file(outputPath).createSync(recursive: true);
|
||||
|
||||
@@ -262,7 +262,8 @@ void main() {
|
||||
'--spirv=/App.framework/flutter_assets/shader.glsl.spirv',
|
||||
'--input=/shader.glsl',
|
||||
'--input-type=frag',
|
||||
'--include=/'
|
||||
'--include=/',
|
||||
'--include=./shader_lib',
|
||||
]),
|
||||
FakeCommand(command: <String>[
|
||||
'codesign',
|
||||
|
||||
@@ -16,6 +16,7 @@ import '../../../src/common.dart';
|
||||
import '../../../src/fake_process_manager.dart';
|
||||
|
||||
const String fragDir = '/shaders';
|
||||
const String shaderLibDir = './shader_lib';
|
||||
const String fragPath = '/shaders/my_shader.frag';
|
||||
const String notFragPath = '/shaders/not_a_frag.file';
|
||||
const String outputSpirvPath = '/output/shaders/my_shader.frag.spirv';
|
||||
@@ -50,6 +51,7 @@ void main() {
|
||||
'--input=$fragPath',
|
||||
'--input-type=frag',
|
||||
'--include=$fragDir',
|
||||
'--include=$shaderLibDir',
|
||||
],
|
||||
onRun: () {
|
||||
fileSystem.file(outputPath).createSync(recursive: true);
|
||||
@@ -89,6 +91,7 @@ void main() {
|
||||
'--input=$fragPath',
|
||||
'--input-type=frag',
|
||||
'--include=$fragDir',
|
||||
'--include=$shaderLibDir',
|
||||
],
|
||||
onRun: () {
|
||||
fileSystem.file(outputPath).createSync(recursive: true);
|
||||
@@ -126,6 +129,7 @@ void main() {
|
||||
'--input=$fragPath',
|
||||
'--input-type=frag',
|
||||
'--include=$fragDir',
|
||||
'--include=$shaderLibDir',
|
||||
],
|
||||
onRun: () {
|
||||
fileSystem.file(outputPath).createSync(recursive: true);
|
||||
@@ -163,6 +167,7 @@ void main() {
|
||||
'--input=$notFragPath',
|
||||
'--input-type=frag',
|
||||
'--include=$fragDir',
|
||||
'--include=$shaderLibDir',
|
||||
],
|
||||
onRun: () {
|
||||
fileSystem.file(outputPath).createSync(recursive: true);
|
||||
@@ -202,6 +207,7 @@ void main() {
|
||||
'--input=$notFragPath',
|
||||
'--input-type=frag',
|
||||
'--include=$fragDir',
|
||||
'--include=$shaderLibDir',
|
||||
],
|
||||
stdout: 'impellerc stdout',
|
||||
stderr: 'impellerc stderr',
|
||||
@@ -243,6 +249,7 @@ void main() {
|
||||
'--input=$fragPath',
|
||||
'--input-type=frag',
|
||||
'--include=$fragDir',
|
||||
'--include=$shaderLibDir',
|
||||
],
|
||||
onRun: () {
|
||||
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp.spirv').createSync();
|
||||
@@ -287,6 +294,7 @@ void main() {
|
||||
'--input=$fragPath',
|
||||
'--input-type=frag',
|
||||
'--include=$fragDir',
|
||||
'--include=$shaderLibDir',
|
||||
],
|
||||
onRun: () {
|
||||
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp.spirv').createSync();
|
||||
@@ -332,6 +340,7 @@ void main() {
|
||||
'--input=$fragPath',
|
||||
'--input-type=frag',
|
||||
'--include=$fragDir',
|
||||
'--include=$shaderLibDir',
|
||||
],
|
||||
onRun: () {
|
||||
fileSystem.file('/.tmp_rand0/0.8255140718871702.temp.spirv').createSync();
|
||||
|
||||
Reference in New Issue
Block a user