public RetroShaderChain(IGL owner, RetroShaderPreset preset, string baseDirectory, bool debug = false) { Owner = owner; this.Preset = preset; Passes = preset.Passes.ToArray(); bool ok = true; //load up the shaders Shaders = new RetroShader[preset.Passes.Count]; for (int i = 0; i < preset.Passes.Count; i++) { RetroShaderPreset.ShaderPass pass = preset.Passes[i]; //acquire content string path = Path.Combine(baseDirectory, pass.ShaderPath); if (!File.Exists(path)) { ok = false; break; } string content = File.ReadAllText(path); var shader = new RetroShader(Owner, content, debug); Shaders[i] = shader; if (!shader.Pipeline.Available) { ok = false; } } Available = ok; }
public RetroShaderChain(IGL owner, RetroShaderPreset preset, string baseDirectory, bool debug = false) { Owner = owner; this.Preset = preset; Passes = preset.Passes.ToArray(); bool ok = true; Errors = ""; //load up the shaders Shaders = new RetroShader[preset.Passes.Count]; for (int i = 0; i < preset.Passes.Count; i++) { RetroShaderPreset.ShaderPass pass = preset.Passes[i]; //acquire content string path = Path.Combine(baseDirectory, pass.ShaderPath); if (!File.Exists(path)) { ok = false; break; } string content = ResolveIncludes(File.ReadAllText(path), Path.GetDirectoryName(path)); var shader = new RetroShader(Owner, content, debug); Shaders[i] = shader; if (!shader.Available) { Errors += string.Format("===================\r\nPass {0}:\r\n{1}", i, shader.Errors); ok = false; } } Available = ok; }
public RetroShaderPass(RetroShaderChain RSC, int index) { this.RSC = RSC; this.RSI = index; this.SP = RSC.Passes[index]; }
public RetroShaderPass(RetroShaderChain rsc, int index) { _rsc = rsc; _rsi = index; _sp = _rsc.Passes[index]; }