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