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