{-# language CPP #-}
module Graphics.Vulkan.Core12.Enums.SemaphoreType (SemaphoreType( SEMAPHORE_TYPE_BINARY
, SEMAPHORE_TYPE_TIMELINE
, ..
)) 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 SemaphoreType = SemaphoreType Int32
deriving newtype (Eq, Ord, Storable, Zero)
pattern SEMAPHORE_TYPE_BINARY = SemaphoreType 0
pattern SEMAPHORE_TYPE_TIMELINE = SemaphoreType 1
{-# complete SEMAPHORE_TYPE_BINARY,
SEMAPHORE_TYPE_TIMELINE :: SemaphoreType #-}
instance Show SemaphoreType where
showsPrec p = \case
SEMAPHORE_TYPE_BINARY -> showString "SEMAPHORE_TYPE_BINARY"
SEMAPHORE_TYPE_TIMELINE -> showString "SEMAPHORE_TYPE_TIMELINE"
SemaphoreType x -> showParen (p >= 11) (showString "SemaphoreType " . showsPrec 11 x)
instance Read SemaphoreType where
readPrec = parens (choose [("SEMAPHORE_TYPE_BINARY", pure SEMAPHORE_TYPE_BINARY)
, ("SEMAPHORE_TYPE_TIMELINE", pure SEMAPHORE_TYPE_TIMELINE)]
+++
prec 10 (do
expectP (Ident "SemaphoreType")
v <- step readPrec
pure (SemaphoreType v)))