Skip to content

Commit

Permalink
fix: Make the build_shader script work for windows (#3402)
Browse files Browse the repository at this point in the history
Windows needed some love
  • Loading branch information
wolfenrain authored Dec 14, 2024
1 parent 9c416cb commit ce7822a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/flame_3d/bin/build_shaders.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,25 @@ Future<void> compute(Directory assets, Directory shaders) async {
final uniqueShaders = shaders
.listSync()
.whereType<File>()
.map((f) => f.path.split('/').last.split('.').first)
.map((f) => f.path.split(Platform.pathSeparator).last.split('.').first)
.toSet();

for (final name in uniqueShaders) {
final bundle = {
'TextureFragment': {
'type': 'fragment',
'file': '${shaders.path}/$name.frag',
'file': '${shaders.path}${Platform.pathSeparator}$name.frag',
},
'TextureVertex': {
'type': 'vertex',
'file': '${shaders.path}/$name.vert',
'file': '${shaders.path}${Platform.pathSeparator}$name.vert',
},
};

stdout.writeln('Computing shader "$name"');
final impellerC = await findImpellerC();
final result = await Process.run(impellerC.toFilePath(), [
'--sl=${assets.path}/$name.shaderbundle',
'--sl=${assets.path}${Platform.pathSeparator}$name.shaderbundle',
'--shader-bundle=${jsonEncode(bundle)}',
]);

Expand Down

0 comments on commit ce7822a

Please sign in to comment.