shaderBundleImpellercArguments function
Builds the impellerc argument list for a shader-bundle compile.
The first two --include directories are always the manifest's own
directory and impellerc's bundled shader_lib. Any includeDirectories
are appended after them, so a package that ships reusable GLSL (for example
framework shaders that generated bundles #include) can put its shader
directory on the search path.
Exposed so users authoring custom build hooks (and tests) can inspect the
exact arguments buildShaderBundleJson passes to impellerc.
Implementation
List<String> shaderBundleImpellercArguments({
required Uri outputBundleFilePath,
required String manifestJson,
required Uri manifestDirectory,
required Uri shaderLibDirectory,
List<Uri> includeDirectories = const [],
Uri? depfilePath,
}) {
return [
'--sl=${outputBundleFilePath.toFilePath()}',
'--shader-bundle=$manifestJson',
if (depfilePath != null) '--depfile=${depfilePath.toFilePath()}',
'--include=${manifestDirectory.toFilePath()}',
'--include=${shaderLibDirectory.toFilePath()}',
for (final directory in includeDirectories)
'--include=${directory.toFilePath()}',
];
}