2019-10-13 02:02:07 -04:00
|
|
|
namespace Ryujinx.Graphics.Gpu.State
|
|
|
|
{
|
2019-12-31 11:32:06 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Render target color buffer mask.
|
|
|
|
/// This defines which color channels are written to the color buffer.
|
|
|
|
/// </summary>
|
2019-10-13 02:02:07 -04:00
|
|
|
struct RtColorMask
|
|
|
|
{
|
2020-04-20 17:59:59 -04:00
|
|
|
#pragma warning disable CS0649
|
2019-10-13 02:02:07 -04:00
|
|
|
public uint Packed;
|
2020-04-20 17:59:59 -04:00
|
|
|
#pragma warning restore CS0649
|
2019-10-13 02:02:07 -04:00
|
|
|
|
2019-12-31 11:32:06 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Unpacks red channel enable.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>True to write the new red channel color, false to keep the old value</returns>
|
2019-10-13 02:02:07 -04:00
|
|
|
public bool UnpackRed()
|
|
|
|
{
|
|
|
|
return (Packed & 0x1) != 0;
|
|
|
|
}
|
|
|
|
|
2019-12-31 11:32:06 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Unpacks green channel enable.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>True to write the new green channel color, false to keep the old value</returns>
|
2019-10-13 02:02:07 -04:00
|
|
|
public bool UnpackGreen()
|
|
|
|
{
|
|
|
|
return (Packed & 0x10) != 0;
|
|
|
|
}
|
|
|
|
|
2019-12-31 11:32:06 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Unpacks blue channel enable.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>True to write the new blue channel color, false to keep the old value</returns>
|
2019-10-13 02:02:07 -04:00
|
|
|
public bool UnpackBlue()
|
|
|
|
{
|
|
|
|
return (Packed & 0x100) != 0;
|
|
|
|
}
|
|
|
|
|
2019-12-31 11:32:06 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Unpacks alpha channel enable.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>True to write the new alpha channel color, false to keep the old value</returns>
|
2019-10-13 02:02:07 -04:00
|
|
|
public bool UnpackAlpha()
|
|
|
|
{
|
|
|
|
return (Packed & 0x1000) != 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|