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(); } }
static void Main(string[] args) { var task = ShaderCompiler.Compile(args[0], args[1]); task.Wait(); Console.WriteLine("Shader compilation finished successfully."); }
public void ProcessSingleFile(ShaderFile inShaderFile) { // Get all structs Structs.AddRange(Struct.GetAllStructsFromShaderFile(inShaderFile)); // Compile if (inShaderFile.ShouldCompile) { ShaderCompiler.Compile(inShaderFile); } }