RtControl.cs 863 B

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