{-# language CPP #-}
module Graphics.Vulkan.Core10.Enums.BufferCreateFlagBits ( BufferCreateFlagBits( BUFFER_CREATE_SPARSE_BINDING_BIT
, BUFFER_CREATE_SPARSE_RESIDENCY_BIT
, BUFFER_CREATE_SPARSE_ALIASED_BIT
, BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT
, BUFFER_CREATE_PROTECTED_BIT
, ..
)
, BufferCreateFlags
) 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 BufferCreateFlagBits = BufferCreateFlagBits Flags
deriving newtype (Eq, Ord, Storable, Zero, Bits)
pattern BUFFER_CREATE_SPARSE_BINDING_BIT = BufferCreateFlagBits 0x00000001
pattern BUFFER_CREATE_SPARSE_RESIDENCY_BIT = BufferCreateFlagBits 0x00000002
pattern BUFFER_CREATE_SPARSE_ALIASED_BIT = BufferCreateFlagBits 0x00000004
pattern BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT = BufferCreateFlagBits 0x00000010
pattern BUFFER_CREATE_PROTECTED_BIT = BufferCreateFlagBits 0x00000008
type BufferCreateFlags = BufferCreateFlagBits
instance Show BufferCreateFlagBits where
showsPrec p = \case
BUFFER_CREATE_SPARSE_BINDING_BIT -> showString "BUFFER_CREATE_SPARSE_BINDING_BIT"
BUFFER_CREATE_SPARSE_RESIDENCY_BIT -> showString "BUFFER_CREATE_SPARSE_RESIDENCY_BIT"
BUFFER_CREATE_SPARSE_ALIASED_BIT -> showString "BUFFER_CREATE_SPARSE_ALIASED_BIT"
BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT -> showString "BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT"
BUFFER_CREATE_PROTECTED_BIT -> showString "BUFFER_CREATE_PROTECTED_BIT"
BufferCreateFlagBits x -> showParen (p >= 11) (showString "BufferCreateFlagBits 0x" . showHex x)
instance Read BufferCreateFlagBits where
readPrec = parens (choose [("BUFFER_CREATE_SPARSE_BINDING_BIT", pure BUFFER_CREATE_SPARSE_BINDING_BIT)
, ("BUFFER_CREATE_SPARSE_RESIDENCY_BIT", pure BUFFER_CREATE_SPARSE_RESIDENCY_BIT)
, ("BUFFER_CREATE_SPARSE_ALIASED_BIT", pure BUFFER_CREATE_SPARSE_ALIASED_BIT)
, ("BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT", pure BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT)
, ("BUFFER_CREATE_PROTECTED_BIT", pure BUFFER_CREATE_PROTECTED_BIT)]
+++
prec 10 (do
expectP (Ident "BufferCreateFlagBits")
v <- step readPrec
pure (BufferCreateFlagBits v)))