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