Program.cs 936 B

12345678910111213141516171819202122232425262728293031323334
  1. using Ryujinx.Graphics.Shader.Translation;
  2. using System;
  3. using System.IO;
  4. namespace Ryujinx.ShaderTools
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. if (args.Length == 1 || args.Length == 2)
  11. {
  12. TranslationFlags flags = TranslationFlags.DebugMode;
  13. if (args.Length == 2 && args[0] == "--compute")
  14. {
  15. flags |= TranslationFlags.Compute;
  16. }
  17. byte[] data = File.ReadAllBytes(args[args.Length - 1]);
  18. TranslationConfig translationConfig = new TranslationConfig(0x10000, 0, flags);
  19. string code = Translator.Translate(data, translationConfig).Code;
  20. Console.WriteLine(code);
  21. }
  22. else
  23. {
  24. Console.WriteLine("Usage: Ryujinx.ShaderTools [--compute] shader.bin");
  25. }
  26. }
  27. }
  28. }