[go: nahoru, domu]

Skip to content

Commit

Permalink
[flutter_tools] use absolute path for shader lib (#116123)
Browse files Browse the repository at this point in the history
* [flutter_tools] use absolute path for shader lib

* update tests
  • Loading branch information
jonahwilliams committed Nov 29, 2022
1 parent 4c3b642 commit f777c9f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ class ShaderCompiler {
);
}

final String shaderLibPath = _fs.path.join(_fs.path.dirname(impellerc.path), 'shader_lib');

final String shaderLibPath = _fs.path.join(impellerc.parent.absolute.path, 'shader_lib');
final List<String> cmd = <String>[
impellerc.path,
target.target,
Expand All @@ -190,6 +189,7 @@ class ShaderCompiler {
'--include=${input.parent.path}',
'--include=$shaderLibPath',
];
_logger.printTrace('shaderc command: $cmd');
final Process impellercProcess = await _processManager.start(cmd);
final int code = await impellercProcess.exitCode;
if (code != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import 'package:flutter_tools/src/globals.dart' as globals;
import '../src/common.dart';
import '../src/context.dart';

const String shaderLibDir = './shader_lib';
const String shaderLibDir = '/./shader_lib';

void main() {
group('AssetBundle.build', () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void main() {
'--input=/shader.glsl',
'--input-type=frag',
'--include=/',
'--include=./shader_lib',
'--include=/./shader_lib',
]),
FakeCommand(command: <String>[
'codesign',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import '../../../src/common.dart';
import '../../../src/fake_process_manager.dart';

const String fragDir = '/shaders';
const String shaderLibDir = './shader_lib';
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';
Expand Down

0 comments on commit f777c9f

Please sign in to comment.