{-# language CPP #-}
module Graphics.Vulkan.Core10.Enums.SampleCountFlagBits ( SampleCountFlagBits( SAMPLE_COUNT_1_BIT
, SAMPLE_COUNT_2_BIT
, SAMPLE_COUNT_4_BIT
, SAMPLE_COUNT_8_BIT
, SAMPLE_COUNT_16_BIT
, SAMPLE_COUNT_32_BIT
, SAMPLE_COUNT_64_BIT
, ..
)
, SampleCountFlags
) where
import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import Numeric (showHex)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import Data.Bits (Bits)
import Foreign.Storable (Storable)
import GHC.Read (Read(readPrec))
import Text.Read.Lex (Lexeme(Ident))
import Graphics.Vulkan.Core10.BaseType (Flags)
import Graphics.Vulkan.Zero (Zero)
newtype SampleCountFlagBits = SampleCountFlagBits Flags
deriving newtype (Eq, Ord, Storable, Zero, Bits)
pattern SAMPLE_COUNT_1_BIT = SampleCountFlagBits 0x00000001
pattern SAMPLE_COUNT_2_BIT = SampleCountFlagBits 0x00000002
pattern SAMPLE_COUNT_4_BIT = SampleCountFlagBits 0x00000004
pattern SAMPLE_COUNT_8_BIT = SampleCountFlagBits 0x00000008
pattern SAMPLE_COUNT_16_BIT = SampleCountFlagBits 0x00000010
pattern SAMPLE_COUNT_32_BIT = SampleCountFlagBits 0x00000020
pattern SAMPLE_COUNT_64_BIT = SampleCountFlagBits 0x00000040
type SampleCountFlags = SampleCountFlagBits
instance Show SampleCountFlagBits where
showsPrec p = \case
SAMPLE_COUNT_1_BIT -> showString "SAMPLE_COUNT_1_BIT"
SAMPLE_COUNT_2_BIT -> showString "SAMPLE_COUNT_2_BIT"
SAMPLE_COUNT_4_BIT -> showString "SAMPLE_COUNT_4_BIT"
SAMPLE_COUNT_8_BIT -> showString "SAMPLE_COUNT_8_BIT"
SAMPLE_COUNT_16_BIT -> showString "SAMPLE_COUNT_16_BIT"
SAMPLE_COUNT_32_BIT -> showString "SAMPLE_COUNT_32_BIT"
SAMPLE_COUNT_64_BIT -> showString "SAMPLE_COUNT_64_BIT"
SampleCountFlagBits x -> showParen (p >= 11) (showString "SampleCountFlagBits 0x" . showHex x)
instance Read SampleCountFlagBits where
readPrec = parens (choose [("SAMPLE_COUNT_1_BIT", pure SAMPLE_COUNT_1_BIT)
, ("SAMPLE_COUNT_2_BIT", pure SAMPLE_COUNT_2_BIT)
, ("SAMPLE_COUNT_4_BIT", pure SAMPLE_COUNT_4_BIT)
, ("SAMPLE_COUNT_8_BIT", pure SAMPLE_COUNT_8_BIT)
, ("SAMPLE_COUNT_16_BIT", pure SAMPLE_COUNT_16_BIT)
, ("SAMPLE_COUNT_32_BIT", pure SAMPLE_COUNT_32_BIT)
, ("SAMPLE_COUNT_64_BIT", pure SAMPLE_COUNT_64_BIT)]
+++
prec 10 (do
expectP (Ident "SampleCountFlagBits")
v <- step readPrec
pure (SampleCountFlagBits v)))