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