示例#1
0
文件: Retro.cs 项目: stuff2600/RAEmus
        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;
        }
示例#2
0
        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;
        }
示例#3
0
 public RetroShaderPass(RetroShaderChain RSC, int index)
 {
     this.RSC = RSC;
     this.RSI = index;
     this.SP  = RSC.Passes[index];
 }
示例#4
0
 public RetroShaderPass(RetroShaderChain rsc, int index)
 {
     _rsc = rsc;
     _rsi = index;
     _sp  = _rsc.Passes[index];
 }
示例#5
0
文件: Retro.cs 项目: adituv/BizHawk
		public RetroShaderPass(RetroShaderChain RSC, int index)
		{
			this.RSC = RSC;
			this.RSI = index;
			this.SP = RSC.Passes[index];
		}