File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
lib/src/build_system/targets Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ class ShaderCompiler {
68
68
'--spirv=$outputPath ' ,
69
69
'--input=${input .path }' ,
70
70
'--input-type=frag' ,
71
+ '--include=${input .parent .path }' ,
71
72
];
72
73
final Process impellercProcess = await _processManager.start (cmd);
73
74
final int code = await impellercProcess.exitCode;
Original file line number Diff line number Diff line change @@ -397,6 +397,7 @@ flutter:
397
397
late Artifacts artifacts;
398
398
late String impellerc;
399
399
late Directory output;
400
+ late String assetsPath;
400
401
late String shaderPath;
401
402
late String outputPath;
402
403
@@ -408,8 +409,9 @@ flutter:
408
409
fileSystem.file (impellerc).createSync (recursive: true );
409
410
410
411
output = fileSystem.directory ('asset_output' )..createSync (recursive: true );
411
- shaderPath = fileSystem.path.join ('assets' , 'shader.frag' );
412
- outputPath = fileSystem.path.join (output.path, 'assets' , 'shader.frag' );
412
+ assetsPath = 'assets' ;
413
+ shaderPath = fileSystem.path.join (assetsPath, 'shader.frag' );
414
+ outputPath = fileSystem.path.join (output.path, assetsPath, 'shader.frag' );
413
415
fileSystem.file (shaderPath).createSync (recursive: true );
414
416
});
415
417
@@ -445,6 +447,7 @@ flutter:
445
447
'--spirv=$outputPath ' ,
446
448
'--input=/$shaderPath ' ,
447
449
'--input-type=frag' ,
450
+ '--include=/$assetsPath ' ,
448
451
],
449
452
onRun: () {
450
453
fileSystem.file (outputPath).createSync (recursive: true );
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import 'package:flutter_tools/src/build_system/targets/shader_compiler.dart';
10
10
import '../../../src/common.dart' ;
11
11
import '../../../src/fake_process_manager.dart' ;
12
12
13
+ const String fragDir = '/shaders' ;
13
14
const String fragPath = '/shaders/my_shader.frag' ;
14
15
const String notFragPath = '/shaders/not_a_frag.file' ;
15
16
const String outputPath = '/output/shaders/my_shader.spv' ;
@@ -40,6 +41,7 @@ void main() {
40
41
'--spirv=$outputPath ' ,
41
42
'--input=$fragPath ' ,
42
43
'--input-type=frag' ,
44
+ '--include=$fragDir ' ,
43
45
],
44
46
onRun: () {
45
47
fileSystem.file (outputPath).createSync (recursive: true );
@@ -72,6 +74,7 @@ void main() {
72
74
'--spirv=$outputPath ' ,
73
75
'--input=$notFragPath ' ,
74
76
'--input-type=frag' ,
77
+ '--include=$fragDir ' ,
75
78
],
76
79
onRun: () {
77
80
fileSystem.file (outputPath).createSync (recursive: true );
@@ -104,6 +107,7 @@ void main() {
104
107
'--spirv=$outputPath ' ,
105
108
'--input=$notFragPath ' ,
106
109
'--input-type=frag' ,
110
+ '--include=$fragDir ' ,
107
111
],
108
112
exitCode: 1 ,
109
113
),
You can’t perform that action at this time.
0 commit comments