aboutsummaryrefslogtreecommitdiffstatsci
path: root/vke/src/Version.cs
blob: ed71d20a00a2582fa81cdb566cfc0caa238f21ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
namespace Vulkan 
{
    public struct Version
    {
        private readonly uint value;

        public Version(uint major, uint minor, uint patch)
        {
            value = major << 22 | minor << 12 | patch;
        }

        public uint Major => value >> 22;

        public uint Minor => (value >> 12) & 0x3ff;

        public uint Patch => (value >> 22) & 0xfff;

        public static implicit operator uint(Version version)
        {
            return version.value;
        }
    }
}