@Test public void testPreparedComputeShaderNoBindingClash() throws Exception { final String json = "{\n" + " \"f\": {\n" + " \"func\": \"glUniform1f\",\n" + " \"args\": [\n" + " 1.0\n" + " ]\n" + " }\n" + "}\n"; final String comp = "#version 320 es\n" + "layout(std430, binding = 0) buffer doesNotMatter {\n" + " int result;\n" + " int data[];\n" + "} ;\n" + "layout(local_size_x = 16, local_size_y = 1) in;\n" + "uniform float f;\n" + "void main() { }"; final File jsonFile = temporaryFolder.newFile("shader.json"); final File compFile = temporaryFolder.newFile("shader.comp"); final File output = temporaryFolder.newFile("output.json"); FileUtils.writeStringToFile(jsonFile, json, StandardCharsets.UTF_8); FileUtils.writeStringToFile(compFile, comp, StandardCharsets.UTF_8); final ShaderJobFileOperations fileOps = new ShaderJobFileOperations(); PrepareReference.mainHelper(new String[] { jsonFile.getAbsolutePath(), output.getAbsolutePath(), "--vulkan" }); assertTrue(fileOps.areShadersValid(output, false, true)); final PipelineInfo pipelineInfo = new PipelineInfo(output); assertTrue(pipelineInfo.hasUniform("f")); assertEquals(1, pipelineInfo.getBinding("f")); }
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);  }