@Test public void testPreparedReferenceIsValid() throws Exception { final String json = "{ }"; final String vert = "#version 300 es\n" + "layout(location=0) in highp vec4 a_position;\n" + "void main() { gl_Position = a_position; }"; final String frag = "#version 300 es\n" + "layout(location=0) out highp vec4 _GLF_color;\n" + "void main() { _GLF_color = vec4(1.0, 0.0, 0.0, 1.0); }"; final File jsonFile = temporaryFolder.newFile("shader.json"); final File vertFile = temporaryFolder.newFile("shader.vert"); final File fragFile = temporaryFolder.newFile("shader.frag"); final File output = temporaryFolder.newFile("output.json"); FileUtils.writeStringToFile(jsonFile, json, StandardCharsets.UTF_8); FileUtils.writeStringToFile(vertFile, vert, StandardCharsets.UTF_8); FileUtils.writeStringToFile(fragFile, frag, StandardCharsets.UTF_8); final ShaderJobFileOperations fileOps = new ShaderJobFileOperations(); PrepareReference.mainHelper(new String[] { jsonFile.getAbsolutePath(), output.getAbsolutePath() }); assertTrue(fileOps.areShadersValid(output, false)); }
public static void mainHelper(String[] args) throws ArgumentParserException, IOException, ParseTimeoutException, InterruptedException, GlslParserException { Namespace ns = parse(args); ShaderJobFileOperations fileOps = new ShaderJobFileOperations(); prepareReference( ns.get("reference"), ns.get("output"), ns.get("replace_float_literals"), ns.get("max_uniforms"), ns.get("vulkan"), fileOps); }
PrepareReference { public static void mainHelper(String[] args) throws ArgumentParserException, IOException, ParseTimeoutException, InterruptedException, GlslParserException { Namespace ns = parse(args); ShaderJobFileOperations fileOps = new ShaderJobFileOperations(); prepareReference( ns.get("reference"), ns.get("output"), ns.get("replace_float_literals"), ns.get("max_uniforms"), ns.get("vulkan"), fileOps); } }
PrepareReference { public static void mainHelper(String[] args) throws ArgumentParserException, IOException, ParseTimeoutException, InterruptedException, GlslParserException { Namespace ns = parse(args); ShaderJobFileOperations fileOps = new ShaderJobFileOperations(); prepareReference( ns.get("reference"), ns.get("output"), ns.get("replace_float_literals"), ns.get("max_uniforms"), ns.get("vulkan"), fileOps); }  }
PrepareReference { public static void mainHelper(String[] args) throws ArgumentParserException, IOException, ParseTimeoutException, InterruptedException, GlslParserException { Namespace ns = parse(args); ShaderJobFileOperations fileOps = new ShaderJobFileOperations(); prepareReference( ns.get("reference"), ns.get("output"), ns.get("replace_float_literals"), ns.get("max_uniforms"), ns.get("vulkan"), fileOps); }  static void main(String[] args); static void mainHelper(String[] args); static void prepareReference(
      File referenceShaderJobFile,
      File outputShaderJobFile,
      boolean replaceFloatLiterals,
      int maxUniforms,
      boolean generateUniformBindings,
      ShaderJobFileOperations fileOps); static void prepareReference(ShaderJob shaderJob,
                                      boolean replaceFloatLiterals,
                                      int maxUniforms,
                                      boolean generateUniformBindings); }
PrepareReference { public static void mainHelper(String[] args) throws ArgumentParserException, IOException, ParseTimeoutException, InterruptedException, GlslParserException { Namespace ns = parse(args); ShaderJobFileOperations fileOps = new ShaderJobFileOperations(); prepareReference( ns.get("reference"), ns.get("output"), ns.get("replace_float_literals"), ns.get("max_uniforms"), ns.get("vulkan"), fileOps); }  static void main(String[] args); static void mainHelper(String[] args); static void prepareReference(
      File referenceShaderJobFile,
      File outputShaderJobFile,
      boolean replaceFloatLiterals,
      int maxUniforms,
      boolean generateUniformBindings,
      ShaderJobFileOperations fileOps); static void prepareReference(ShaderJob shaderJob,
                                      boolean replaceFloatLiterals,
                                      int maxUniforms,
                                      boolean generateUniformBindings);  }