RtColorMask.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. namespace Ryujinx.Graphics.Gpu.State
  2. {
  3. /// <summary>
  4. /// Render target color buffer mask.
  5. /// This defines which color channels are written to the color buffer.
  6. /// </summary>
  7. struct RtColorMask
  8. {
  9. #pragma warning disable CS0649
  10. public uint Packed;
  11. #pragma warning restore CS0649
  12. /// <summary>
  13. /// Unpacks red channel enable.
  14. /// </summary>
  15. /// <returns>True to write the new red channel color, false to keep the old value</returns>
  16. public bool UnpackRed()
  17. {
  18. return (Packed & 0x1) != 0;
  19. }
  20. /// <summary>
  21. /// Unpacks green channel enable.
  22. /// </summary>
  23. /// <returns>True to write the new green channel color, false to keep the old value</returns>
  24. public bool UnpackGreen()
  25. {
  26. return (Packed & 0x10) != 0;
  27. }
  28. /// <summary>
  29. /// Unpacks blue channel enable.
  30. /// </summary>
  31. /// <returns>True to write the new blue channel color, false to keep the old value</returns>
  32. public bool UnpackBlue()
  33. {
  34. return (Packed & 0x100) != 0;
  35. }
  36. /// <summary>
  37. /// Unpacks alpha channel enable.
  38. /// </summary>
  39. /// <returns>True to write the new alpha channel color, false to keep the old value</returns>
  40. public bool UnpackAlpha()
  41. {
  42. return (Packed & 0x1000) != 0;
  43. }
  44. }
  45. }