{-# language CPP #-}
module Graphics.Vulkan.Core11.Enums.MemoryAllocateFlagBits ( MemoryAllocateFlagBits( MEMORY_ALLOCATE_DEVICE_MASK_BIT
, MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT
, MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT
, ..
)
, MemoryAllocateFlags
) where
import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import Numeric (showHex)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import Data.Bits (Bits)
import Foreign.Storable (Storable)
import GHC.Read (Read(readPrec))
import Text.Read.Lex (Lexeme(Ident))
import Graphics.Vulkan.Core10.BaseType (Flags)
import Graphics.Vulkan.Zero (Zero)
newtype MemoryAllocateFlagBits = MemoryAllocateFlagBits Flags
deriving newtype (Eq, Ord, Storable, Zero, Bits)
pattern MEMORY_ALLOCATE_DEVICE_MASK_BIT = MemoryAllocateFlagBits 0x00000001
pattern MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT = MemoryAllocateFlagBits 0x00000004
pattern MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT = MemoryAllocateFlagBits 0x00000002
type MemoryAllocateFlags = MemoryAllocateFlagBits
instance Show MemoryAllocateFlagBits where
showsPrec p = \case
MEMORY_ALLOCATE_DEVICE_MASK_BIT -> showString "MEMORY_ALLOCATE_DEVICE_MASK_BIT"
MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT -> showString "MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT"
MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT -> showString "MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT"
MemoryAllocateFlagBits x -> showParen (p >= 11) (showString "MemoryAllocateFlagBits 0x" . showHex x)
instance Read MemoryAllocateFlagBits where
readPrec = parens (choose [("MEMORY_ALLOCATE_DEVICE_MASK_BIT", pure MEMORY_ALLOCATE_DEVICE_MASK_BIT)
, ("MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT", pure MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT)
, ("MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT", pure MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT)]
+++
prec 10 (do
expectP (Ident "MemoryAllocateFlagBits")
v <- step readPrec
pure (MemoryAllocateFlagBits v)))