コード例 #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
ファイル: Retro.cs プロジェクト: Arnyew/RTC-0.7-Deprecated-
        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
ファイル: Retro.cs プロジェクト: Arnyew/RTC-0.7-Deprecated-
 public RetroShaderPass(RetroShaderChain RSC, int index)
 {
     this.RSC = RSC;
     this.RSI = index;
     this.SP  = RSC.Passes[index];
 }
コード例 #4
0
ファイル: Retro.cs プロジェクト: xHailFirex/BizHawk
 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];
		}