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