{-# language CPP #-}
module Graphics.Vulkan.Core10.Enums.SparseImageFormatFlagBits ( SparseImageFormatFlagBits( SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT
, SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT
, SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT
, ..
)
, SparseImageFormatFlags
) 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 SparseImageFormatFlagBits = SparseImageFormatFlagBits Flags
deriving newtype (Eq, Ord, Storable, Zero, Bits)
pattern SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = SparseImageFormatFlagBits 0x00000001
pattern SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT = SparseImageFormatFlagBits 0x00000002
pattern SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = SparseImageFormatFlagBits 0x00000004
type SparseImageFormatFlags = SparseImageFormatFlagBits
instance Show SparseImageFormatFlagBits where
showsPrec p = \case
SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT -> showString "SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT"
SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT -> showString "SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT"
SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT -> showString "SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT"
SparseImageFormatFlagBits x -> showParen (p >= 11) (showString "SparseImageFormatFlagBits 0x" . showHex x)
instance Read SparseImageFormatFlagBits where
readPrec = parens (choose [("SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT", pure SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT)
, ("SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT", pure SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT)
, ("SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT", pure SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT)]
+++
prec 10 (do
expectP (Ident "SparseImageFormatFlagBits")
v <- step readPrec
pure (SparseImageFormatFlagBits v)))