diff options
| author | Lordmau5 <mail@lordmau5.com> | 2018-06-11 06:03:37 +0200 |
|---|---|---|
| committer | Lordmau5 <mail@lordmau5.com> | 2018-06-11 06:03:37 +0200 |
| commit | c636c74dd2a54a9c0ece6cd31b03512f8c41fc43 (patch) | |
| tree | e7b5089e4d873e51337752b8819c71c9f6257e93 /Ryujinx.ShaderTools/Program.cs | |
| parent | 851f2ded9a369633bb18a5fc97c123b3ef94c24e (diff) | |
| parent | 76f3b1b3a4637ec72abfbb8cbc0679f2e0ca838f (diff) | |
Merge branch 'master' into ICommonStateGetter
Diffstat (limited to 'Ryujinx.ShaderTools/Program.cs')
| -rw-r--r-- | Ryujinx.ShaderTools/Program.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Ryujinx.ShaderTools/Program.cs b/Ryujinx.ShaderTools/Program.cs new file mode 100644 index 00000000..3597f256 --- /dev/null +++ b/Ryujinx.ShaderTools/Program.cs @@ -0,0 +1,42 @@ +using Ryujinx.Graphics.Gal; +using Ryujinx.Graphics.Gal.Shader; +using System; +using System.IO; + +namespace Ryujinx.ShaderTools +{ + class Program + { + static void Main(string[] args) + { + if (args.Length == 2) + { + GlslDecompiler Decompiler = new GlslDecompiler(); + + GalShaderType ShaderType = GalShaderType.Vertex; + + switch (args[0].ToLower()) + { + case "v": ShaderType = GalShaderType.Vertex; break; + case "tc": ShaderType = GalShaderType.TessControl; break; + case "te": ShaderType = GalShaderType.TessEvaluation; break; + case "g": ShaderType = GalShaderType.Geometry; break; + case "f": ShaderType = GalShaderType.Fragment; break; + } + + using (FileStream FS = new FileStream(args[1], FileMode.Open, FileAccess.Read)) + { + Memory Mem = new Memory(FS); + + GlslProgram Program = Decompiler.Decompile(Mem, 0, ShaderType); + + Console.WriteLine(Program.Code); + } + } + else + { + Console.WriteLine("Usage: Ryujinx.ShaderTools [v|tc|te|g|f] shader.bin"); + } + } + } +} |
