aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.ShaderTools/Program.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.ShaderTools/Program.cs')
-rw-r--r--Ryujinx.ShaderTools/Program.cs31
1 files changed, 15 insertions, 16 deletions
diff --git a/Ryujinx.ShaderTools/Program.cs b/Ryujinx.ShaderTools/Program.cs
index 77aba0ab..e763e2c1 100644
--- a/Ryujinx.ShaderTools/Program.cs
+++ b/Ryujinx.ShaderTools/Program.cs
@@ -1,5 +1,6 @@
using Ryujinx.Graphics.Gal;
-using Ryujinx.Graphics.Gal.Shader;
+using Ryujinx.Graphics.Shader;
+using Ryujinx.Graphics.Shader.Translation;
using System;
using System.IO;
@@ -7,32 +8,30 @@ namespace Ryujinx.ShaderTools
{
class Program
{
- private static readonly int MaxUboSize = 65536;
-
static void Main(string[] args)
{
if (args.Length == 2)
{
- GlslDecompiler Decompiler = new GlslDecompiler(MaxUboSize, true);
-
- GalShaderType ShaderType = GalShaderType.Vertex;
+ GalShaderType type = 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;
+ case "v": type = GalShaderType.Vertex; break;
+ case "tc": type = GalShaderType.TessControl; break;
+ case "te": type = GalShaderType.TessEvaluation; break;
+ case "g": type = GalShaderType.Geometry; break;
+ case "f": type = GalShaderType.Fragment; break;
}
- using (FileStream FS = new FileStream(args[1], FileMode.Open, FileAccess.Read))
+ using (FileStream fs = new FileStream(args[1], FileMode.Open, FileAccess.Read))
{
- Memory Mem = new Memory(FS);
+ Memory mem = new Memory(fs);
+
+ ShaderConfig config = new ShaderConfig(type, 65536);
- GlslProgram Program = Decompiler.Decompile(Mem, 0, ShaderType);
+ string code = Translator.Translate(mem, 0, config).Code;
- Console.WriteLine(Program.Code);
+ Console.WriteLine(code);
}
}
else
@@ -41,4 +40,4 @@ namespace Ryujinx.ShaderTools
}
}
}
-}
+} \ No newline at end of file