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