aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/State/CopyBufferSwizzle.cs
blob: b4a9d9c2835123f346c7abc1157d75db790dd1a6 (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
namespace Ryujinx.Graphics.Gpu.State
{
    /// <summary>
    /// Buffer to buffer copy vector swizzle parameters.
    /// </summary>
    struct CopyBufferSwizzle
    {
#pragma warning disable CS0649
        public uint Swizzle;
#pragma warning restore CS0649

        /// <summary>
        /// Unpacks the size of each vector component of the copy.
        /// </summary>
        /// <returns>Vector component size</returns>
        public int UnpackComponentSize()
        {
            return (int)((Swizzle >> 16) & 3) + 1;
        }

        /// <summary>
        /// Unpacks the number of components of the source vector of the copy.
        /// </summary>
        /// <returns>Number of vector components</returns>
        public int UnpackSrcComponentsCount()
        {
            return (int)((Swizzle >> 20) & 7) + 1;
        }

        /// <summary>
        /// Unpacks the number of components of the destination vector of the copy.
        /// </summary>
        /// <returns>Number of vector components</returns>
        public int UnpackDstComponentsCount()
        {
            return (int)((Swizzle >> 24) & 7) + 1;
        }
    }
}