{-# language CPP #-}
module Graphics.Vulkan.Core10.Enums.VendorId (VendorId( VENDOR_ID_VIV
, VENDOR_ID_VSI
, VENDOR_ID_KAZAN
, VENDOR_ID_CODEPLAY
, ..
)) 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 VendorId = VendorId Int32
deriving newtype (Eq, Ord, Storable, Zero)
pattern VENDOR_ID_VIV = VendorId 65537
pattern VENDOR_ID_VSI = VendorId 65538
pattern VENDOR_ID_KAZAN = VendorId 65539
pattern VENDOR_ID_CODEPLAY = VendorId 65540
{-# complete VENDOR_ID_VIV,
VENDOR_ID_VSI,
VENDOR_ID_KAZAN,
VENDOR_ID_CODEPLAY :: VendorId #-}
instance Show VendorId where
showsPrec p = \case
VENDOR_ID_VIV -> showString "VENDOR_ID_VIV"
VENDOR_ID_VSI -> showString "VENDOR_ID_VSI"
VENDOR_ID_KAZAN -> showString "VENDOR_ID_KAZAN"
VENDOR_ID_CODEPLAY -> showString "VENDOR_ID_CODEPLAY"
VendorId x -> showParen (p >= 11) (showString "VendorId " . showsPrec 11 x)
instance Read VendorId where
readPrec = parens (choose [("VENDOR_ID_VIV", pure VENDOR_ID_VIV)
, ("VENDOR_ID_VSI", pure VENDOR_ID_VSI)
, ("VENDOR_ID_KAZAN", pure VENDOR_ID_KAZAN)
, ("VENDOR_ID_CODEPLAY", pure VENDOR_ID_CODEPLAY)]
+++
prec 10 (do
expectP (Ident "VendorId")
v <- step readPrec
pure (VendorId v)))