예제 #1
0
        public void Compile(IShaderInfo info)
        {
            var bytes = info.ReadBytes();

            bytes = compilator.Compile(bytes, info.EntryPoint, ConvertToShaderStage(info.Stage), info.Name);
            info.WriteCompiledBytes(bytes);
        }
예제 #2
0
        public void Compile(IShaderInfo info, string text)
        {
            var bytes = Encoding.UTF8.GetBytes(text);

            bytes = compilator.Compile(bytes, info.EntryPoint, ConvertToShaderStage(info.Stage), info.Name);
            info.WriteCompiledBytes(bytes);
        }
예제 #3
0
        public void CompileWithPreprocessing(IShaderInfo info, string text)
        {
            info.ReadText();
            var preprocessed = compilator.Preprocess(text, include ?? new D3DIncludeAdapter(new Dictionary <string, IIncludeResourse>()));
            var bytes        = Encoding.UTF8.GetBytes(preprocessed);

            bytes = compilator.Compile(bytes, info.EntryPoint, ConvertToShaderStage(info.Stage), info.Name);
            info.WriteCompiledBytes(bytes);
        }