{-# language CPP #-}
module Graphics.Vulkan.Core10.Enums.PhysicalDeviceType (PhysicalDeviceType( PHYSICAL_DEVICE_TYPE_OTHER
, PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU
, PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
, PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU
, PHYSICAL_DEVICE_TYPE_CPU
, ..
)) where
import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import GHC.Show (showsPrec)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import Foreign.Storable (Storable)
import Data.Int (Int32)
import GHC.Read (Read(readPrec))
import Text.Read.Lex (Lexeme(Ident))
import Graphics.Vulkan.Zero (Zero)
newtype PhysicalDeviceType = PhysicalDeviceType Int32
deriving newtype (Eq, Ord, Storable, Zero)
pattern PHYSICAL_DEVICE_TYPE_OTHER = PhysicalDeviceType 0
pattern PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = PhysicalDeviceType 1
pattern PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = PhysicalDeviceType 2
pattern PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = PhysicalDeviceType 3
pattern PHYSICAL_DEVICE_TYPE_CPU = PhysicalDeviceType 4
{-# complete PHYSICAL_DEVICE_TYPE_OTHER,
PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU,
PHYSICAL_DEVICE_TYPE_DISCRETE_GPU,
PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU,
PHYSICAL_DEVICE_TYPE_CPU :: PhysicalDeviceType #-}
instance Show PhysicalDeviceType where
showsPrec p = \case
PHYSICAL_DEVICE_TYPE_OTHER -> showString "PHYSICAL_DEVICE_TYPE_OTHER"
PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU -> showString "PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU"
PHYSICAL_DEVICE_TYPE_DISCRETE_GPU -> showString "PHYSICAL_DEVICE_TYPE_DISCRETE_GPU"
PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU -> showString "PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU"
PHYSICAL_DEVICE_TYPE_CPU -> showString "PHYSICAL_DEVICE_TYPE_CPU"
PhysicalDeviceType x -> showParen (p >= 11) (showString "PhysicalDeviceType " . showsPrec 11 x)
instance Read PhysicalDeviceType where
readPrec = parens (choose [("PHYSICAL_DEVICE_TYPE_OTHER", pure PHYSICAL_DEVICE_TYPE_OTHER)
, ("PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU", pure PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU)
, ("PHYSICAL_DEVICE_TYPE_DISCRETE_GPU", pure PHYSICAL_DEVICE_TYPE_DISCRETE_GPU)
, ("PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU", pure PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU)
, ("PHYSICAL_DEVICE_TYPE_CPU", pure PHYSICAL_DEVICE_TYPE_CPU)]
+++
prec 10 (do
expectP (Ident "PhysicalDeviceType")
v <- step readPrec
pure (PhysicalDeviceType v)))