public static ExecResult runSwiftshaderOnShader(
ExecHelper.RedirectType redirectType,
File fragmentShader,
File imageOutput,
boolean skipRender,
int width,
int height)
throws IOException, InterruptedException {
List<String> command = new ArrayList<>(Arrays.asList(
ToolPaths.getImageEglSwiftshader(),
fragmentShader.toString(),
"--output", imageOutput.toString(),
"--resolution",
String.valueOf(width),
String.valueOf(height)));
if (skipRender) {
command.add("--exit-linking");
}
return new ExecHelper().exec(
redirectType,
null,
false,
command.toArray(new String[]{}));
}