RtControl.cs 801 B

1234567891011121314151617181920212223242526272829
  1. namespace Ryujinx.Graphics.Gpu.State
  2. {
  3. /// <summary>
  4. /// Render target draw buffers control.
  5. /// </summary>
  6. struct RtControl
  7. {
  8. public uint Packed;
  9. /// <summary>
  10. /// Unpacks the number of active draw buffers.
  11. /// </summary>
  12. /// <returns>Number of active draw buffers</returns>
  13. public int UnpackCount()
  14. {
  15. return (int)(Packed & 0xf);
  16. }
  17. /// <summary>
  18. /// Unpacks the color attachment index for a given draw buffer.
  19. /// </summary>
  20. /// <param name="index">Index of the draw buffer</param>
  21. /// <returns>Attachment index</returns>
  22. public int UnpackPermutationIndex(int index)
  23. {
  24. return (int)((Packed >> (4 + index * 3)) & 7);
  25. }
  26. }
  27. }