OpCodeAttribute.cs 842 B

1234567891011121314151617181920212223
  1. using Ryujinx.Graphics.Shader.Instructions;
  2. namespace Ryujinx.Graphics.Shader.Decoders
  3. {
  4. class OpCodeAttribute : OpCodeAluReg, IOpCodeAttribute
  5. {
  6. public int AttributeOffset { get; }
  7. public bool Patch { get; }
  8. public int Count { get; }
  9. public bool Phys => !Patch && AttributeOffset == 0 && !Ra.IsRZ;
  10. public bool Indexed => Phys;
  11. public new static OpCode Create(InstEmitter emitter, ulong address, long opCode) => new OpCodeAttribute(emitter, address, opCode);
  12. public OpCodeAttribute(InstEmitter emitter, ulong address, long opCode) : base(emitter, address, opCode)
  13. {
  14. AttributeOffset = opCode.Extract(20, 10);
  15. Patch = opCode.Extract(31);
  16. Count = opCode.Extract(47, 2) + 1;
  17. }
  18. }
  19. }