RtColorMask.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. public uint Packed;
  10. /// <summary>
  11. /// Unpacks red channel enable.
  12. /// </summary>
  13. /// <returns>True to write the new red channel color, false to keep the old value</returns>
  14. public bool UnpackRed()
  15. {
  16. return (Packed & 0x1) != 0;
  17. }
  18. /// <summary>
  19. /// Unpacks green channel enable.
  20. /// </summary>
  21. /// <returns>True to write the new green channel color, false to keep the old value</returns>
  22. public bool UnpackGreen()
  23. {
  24. return (Packed & 0x10) != 0;
  25. }
  26. /// <summary>
  27. /// Unpacks blue channel enable.
  28. /// </summary>
  29. /// <returns>True to write the new blue channel color, false to keep the old value</returns>
  30. public bool UnpackBlue()
  31. {
  32. return (Packed & 0x100) != 0;
  33. }
  34. /// <summary>
  35. /// Unpacks alpha channel enable.
  36. /// </summary>
  37. /// <returns>True to write the new alpha channel color, false to keep the old value</returns>
  38. public bool UnpackAlpha()
  39. {
  40. return (Packed & 0x1000) != 0;
  41. }
  42. }
  43. }