aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/State/RtColorMask.cs
blob: 3567bf37722454aa30e8a6bf3f70510bb1ca8332 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
namespace Ryujinx.Graphics.Gpu.State
{
    /// <summary>
    /// Render target color buffer mask.
    /// This defines which color channels are written to the color buffer.
    /// </summary>
    struct RtColorMask
    {
#pragma warning disable CS0649
        public uint Packed;
#pragma warning restore CS0649

        /// <summary>
        /// Unpacks red channel enable.
        /// </summary>
        /// <returns>True to write the new red channel color, false to keep the old value</returns>
        public bool UnpackRed()
        {
            return (Packed & 0x1) != 0;
        }

        /// <summary>
        /// Unpacks green channel enable.
        /// </summary>
        /// <returns>True to write the new green channel color, false to keep the old value</returns>
        public bool UnpackGreen()
        {
            return (Packed & 0x10) != 0;
        }

        /// <summary>
        /// Unpacks blue channel enable.
        /// </summary>
        /// <returns>True to write the new blue channel color, false to keep the old value</returns>
        public bool UnpackBlue()
        {
            return (Packed & 0x100) != 0;
        }

        /// <summary>
        /// Unpacks alpha channel enable.
        /// </summary>
        /// <returns>True to write the new alpha channel color, false to keep the old value</returns>
        public bool UnpackAlpha()
        {
            return (Packed & 0x1000) != 0;
        }
    }
}