{-# language CPP #-}
module Vulkan.Version ( pattern HEADER_VERSION
, pattern HEADER_VERSION_COMPLETE
, pattern MAKE_VERSION
, _VERSION_MAJOR
, _VERSION_MINOR
, _VERSION_PATCH
) where
import Data.Bits ((.&.))
import Data.Bits ((.|.))
import Data.Bits (shiftL)
import Data.Bits (shiftR)
import Data.Word (Word32)
pattern HEADER_VERSION :: Word32
pattern = 149
pattern HEADER_VERSION_COMPLETE :: Word32
pattern = MAKE_VERSION 1 2 149
pattern MAKE_VERSION :: Word32 -> Word32 -> Word32 -> Word32
pattern $bMAKE_VERSION :: Word32 -> Word32 -> Word32 -> Word32
$mMAKE_VERSION :: forall r.
Word32 -> (Word32 -> Word32 -> Word32 -> r) -> (Void# -> r) -> r
MAKE_VERSION major minor patch <-
(\v -> (_VERSION_MAJOR v, _VERSION_MINOR v, _VERSION_PATCH v) -> (major, minor, patch))
where MAKE_VERSION major :: Word32
major minor :: Word32
minor patch :: Word32
patch = Word32
major Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
`shiftL` 22 Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
.|. Word32
minor Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
`shiftL` 12 Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
.|. Word32
patch
_VERSION_MAJOR :: Word32 -> Word32
_VERSION_MAJOR :: Word32 -> Word32
_VERSION_MAJOR v :: Word32
v = Word32
v Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
`shiftR` 22
_VERSION_MINOR :: Word32 -> Word32
_VERSION_MINOR :: Word32 -> Word32
_VERSION_MINOR v :: Word32
v = Word32
v Word32 -> Int -> Word32
forall a. Bits a => a -> Int -> a
`shiftR` 12 Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
.&. 0x3ff
_VERSION_PATCH :: Word32 -> Word32
_VERSION_PATCH :: Word32 -> Word32
_VERSION_PATCH v :: Word32
v = Word32
v Word32 -> Word32 -> Word32
forall a. Bits a => a -> a -> a
.&. 0xfff