ShaderDecodeFlow.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using static Ryujinx.Graphics.Gal.Shader.ShaderDecodeHelper;
  3. namespace Ryujinx.Graphics.Gal.Shader
  4. {
  5. static partial class ShaderDecode
  6. {
  7. public static void Bra(ShaderIrBlock Block, long OpCode)
  8. {
  9. if ((OpCode & 0x20) != 0)
  10. {
  11. //This reads the target offset from the constant buffer.
  12. //Almost impossible to support with GLSL.
  13. throw new NotImplementedException();
  14. }
  15. int Target = ((int)(OpCode >> 20) << 8) >> 8;
  16. ShaderIrOperImm Imm = new ShaderIrOperImm(Target);
  17. Block.AddNode(GetPredNode(new ShaderIrOp(ShaderIrInst.Bra, Imm), OpCode));
  18. }
  19. public static void Exit(ShaderIrBlock Block, long OpCode)
  20. {
  21. int CCode = (int)OpCode & 0x1f;
  22. //TODO: Figure out what the other condition codes mean...
  23. if (CCode == 0xf)
  24. {
  25. Block.AddNode(GetPredNode(new ShaderIrOp(ShaderIrInst.Exit), OpCode));
  26. }
  27. }
  28. public static void Kil(ShaderIrBlock Block, long OpCode)
  29. {
  30. Block.AddNode(GetPredNode(new ShaderIrOp(ShaderIrInst.Kil), OpCode));
  31. }
  32. }
  33. }