public static void Build() { CreateGeneratedFolder(); // Read back from DB ReadDataBase(); // Go through all the files and create Shaderfiles ProcessFolder(Config.ShaderSourcePath); CreateDependencies(); // Tag all shaders that need to recompile and check if the DB was changed compared to the previous build bool db_changed = UpdateDadaBase(); if (db_changed) { ShaderFileParser fileParser = new ShaderFileParser(CurrentDB.Values.ToList()); fileParser.ProcessFiles(); // Generate \Shaders\include\Shaders.h ShaderCompiler.GenerateShaderHFile(); // Generate \Shaders\include\ConstantBuffers.h ShaderCompiler.GenerateConstantBufferHFile(fileParser.Structs); // Generate \Shaders\include\VertexLayouts.h ShaderCompiler.GenerateVertexLayoutHFile(fileParser.Structs); // Update DB by overwritting it WriteDataBase(); } }
public static void BuildForTest() { // Go through all the files and create Shaderfiles ProcessFolder(Config.ShaderSourcePath); ShaderFileParser fileParser = new ShaderFileParser(CurrentDB.Values.ToList()); // Iterate all Compiler/ShaderModel combinations EnumUtils.ForEach <Compiler>((compiler) => { EnumUtils.ForEach <ShaderModel>((shaderModel) => { Config.Compiler = compiler; Config.ShaderModel = shaderModel; if (Config.Verify(throws: false)) { fileParser.ProcessFiles(); } }); }); }