public void Compile(IShaderInfo info) { var bytes = info.ReadBytes(); bytes = compilator.Compile(bytes, info.EntryPoint, ConvertToShaderStage(info.Stage), info.Name); info.WriteCompiledBytes(bytes); }
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); }
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); }