Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
		static void Main(string[] args)
		{
			var task = ShaderCompiler.Compile(args[0], args[1]);

			task.Wait();

			Console.WriteLine("Shader compilation finished successfully.");
		}
Ejemplo n.º 3
0
        public void ProcessSingleFile(ShaderFile inShaderFile)
        {
            // Get all structs
            Structs.AddRange(Struct.GetAllStructsFromShaderFile(inShaderFile));

            // Compile
            if (inShaderFile.ShouldCompile)
            {
                ShaderCompiler.Compile(inShaderFile);
            }
        }