{-# language CPP #-}
module Vulkan.Core10.Enums.MemoryHeapFlagBits  ( MemoryHeapFlagBits( MEMORY_HEAP_DEVICE_LOCAL_BIT
                                                                   , MEMORY_HEAP_MULTI_INSTANCE_BIT
                                                                   , ..
                                                                   )
                                               , MemoryHeapFlags
                                               ) 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 Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.Zero (Zero)
-- | VkMemoryHeapFlagBits - Bitmask specifying attribute flags for a heap
--
-- = See Also
--
-- 'MemoryHeapFlags'
newtype MemoryHeapFlagBits = MemoryHeapFlagBits Flags
  deriving newtype (MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool
(MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool)
-> (MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool)
-> Eq MemoryHeapFlagBits
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool
$c/= :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool
== :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool
$c== :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool
Eq, Eq MemoryHeapFlagBits
Eq MemoryHeapFlagBits =>
(MemoryHeapFlagBits -> MemoryHeapFlagBits -> Ordering)
-> (MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool)
-> (MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool)
-> (MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool)
-> (MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool)
-> (MemoryHeapFlagBits -> MemoryHeapFlagBits -> MemoryHeapFlagBits)
-> (MemoryHeapFlagBits -> MemoryHeapFlagBits -> MemoryHeapFlagBits)
-> Ord MemoryHeapFlagBits
MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool
MemoryHeapFlagBits -> MemoryHeapFlagBits -> Ordering
MemoryHeapFlagBits -> MemoryHeapFlagBits -> MemoryHeapFlagBits
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> MemoryHeapFlagBits
$cmin :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> MemoryHeapFlagBits
max :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> MemoryHeapFlagBits
$cmax :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> MemoryHeapFlagBits
>= :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool
$c>= :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool
> :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool
$c> :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool
<= :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool
$c<= :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool
< :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool
$c< :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> Bool
compare :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> Ordering
$ccompare :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> Ordering
$cp1Ord :: Eq MemoryHeapFlagBits
Ord, Ptr b -> Int -> IO MemoryHeapFlagBits
Ptr b -> Int -> MemoryHeapFlagBits -> IO ()
Ptr MemoryHeapFlagBits -> IO MemoryHeapFlagBits
Ptr MemoryHeapFlagBits -> Int -> IO MemoryHeapFlagBits
Ptr MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits -> IO ()
Ptr MemoryHeapFlagBits -> MemoryHeapFlagBits -> IO ()
MemoryHeapFlagBits -> Int
(MemoryHeapFlagBits -> Int)
-> (MemoryHeapFlagBits -> Int)
-> (Ptr MemoryHeapFlagBits -> Int -> IO MemoryHeapFlagBits)
-> (Ptr MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits -> IO ())
-> (forall b. Ptr b -> Int -> IO MemoryHeapFlagBits)
-> (forall b. Ptr b -> Int -> MemoryHeapFlagBits -> IO ())
-> (Ptr MemoryHeapFlagBits -> IO MemoryHeapFlagBits)
-> (Ptr MemoryHeapFlagBits -> MemoryHeapFlagBits -> IO ())
-> Storable MemoryHeapFlagBits
forall b. Ptr b -> Int -> IO MemoryHeapFlagBits
forall b. Ptr b -> Int -> MemoryHeapFlagBits -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr MemoryHeapFlagBits -> MemoryHeapFlagBits -> IO ()
$cpoke :: Ptr MemoryHeapFlagBits -> MemoryHeapFlagBits -> IO ()
peek :: Ptr MemoryHeapFlagBits -> IO MemoryHeapFlagBits
$cpeek :: Ptr MemoryHeapFlagBits -> IO MemoryHeapFlagBits
pokeByteOff :: Ptr b -> Int -> MemoryHeapFlagBits -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> MemoryHeapFlagBits -> IO ()
peekByteOff :: Ptr b -> Int -> IO MemoryHeapFlagBits
$cpeekByteOff :: forall b. Ptr b -> Int -> IO MemoryHeapFlagBits
pokeElemOff :: Ptr MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits -> IO ()
$cpokeElemOff :: Ptr MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits -> IO ()
peekElemOff :: Ptr MemoryHeapFlagBits -> Int -> IO MemoryHeapFlagBits
$cpeekElemOff :: Ptr MemoryHeapFlagBits -> Int -> IO MemoryHeapFlagBits
alignment :: MemoryHeapFlagBits -> Int
$calignment :: MemoryHeapFlagBits -> Int
sizeOf :: MemoryHeapFlagBits -> Int
$csizeOf :: MemoryHeapFlagBits -> Int
Storable, MemoryHeapFlagBits
MemoryHeapFlagBits -> Zero MemoryHeapFlagBits
forall a. a -> Zero a
zero :: MemoryHeapFlagBits
$czero :: MemoryHeapFlagBits
Zero, Eq MemoryHeapFlagBits
MemoryHeapFlagBits
Eq MemoryHeapFlagBits =>
(MemoryHeapFlagBits -> MemoryHeapFlagBits -> MemoryHeapFlagBits)
-> (MemoryHeapFlagBits -> MemoryHeapFlagBits -> MemoryHeapFlagBits)
-> (MemoryHeapFlagBits -> MemoryHeapFlagBits -> MemoryHeapFlagBits)
-> (MemoryHeapFlagBits -> MemoryHeapFlagBits)
-> (MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits)
-> (MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits)
-> MemoryHeapFlagBits
-> (Int -> MemoryHeapFlagBits)
-> (MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits)
-> (MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits)
-> (MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits)
-> (MemoryHeapFlagBits -> Int -> Bool)
-> (MemoryHeapFlagBits -> Maybe Int)
-> (MemoryHeapFlagBits -> Int)
-> (MemoryHeapFlagBits -> Bool)
-> (MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits)
-> (MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits)
-> (MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits)
-> (MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits)
-> (MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits)
-> (MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits)
-> (MemoryHeapFlagBits -> Int)
-> Bits MemoryHeapFlagBits
Int -> MemoryHeapFlagBits
MemoryHeapFlagBits -> Bool
MemoryHeapFlagBits -> Int
MemoryHeapFlagBits -> Maybe Int
MemoryHeapFlagBits -> MemoryHeapFlagBits
MemoryHeapFlagBits -> Int -> Bool
MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
MemoryHeapFlagBits -> MemoryHeapFlagBits -> MemoryHeapFlagBits
forall a.
Eq a =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: MemoryHeapFlagBits -> Int
$cpopCount :: MemoryHeapFlagBits -> Int
rotateR :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
$crotateR :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
rotateL :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
$crotateL :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
unsafeShiftR :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
$cunsafeShiftR :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
shiftR :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
$cshiftR :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
unsafeShiftL :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
$cunsafeShiftL :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
shiftL :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
$cshiftL :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
isSigned :: MemoryHeapFlagBits -> Bool
$cisSigned :: MemoryHeapFlagBits -> Bool
bitSize :: MemoryHeapFlagBits -> Int
$cbitSize :: MemoryHeapFlagBits -> Int
bitSizeMaybe :: MemoryHeapFlagBits -> Maybe Int
$cbitSizeMaybe :: MemoryHeapFlagBits -> Maybe Int
testBit :: MemoryHeapFlagBits -> Int -> Bool
$ctestBit :: MemoryHeapFlagBits -> Int -> Bool
complementBit :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
$ccomplementBit :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
clearBit :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
$cclearBit :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
setBit :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
$csetBit :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
bit :: Int -> MemoryHeapFlagBits
$cbit :: Int -> MemoryHeapFlagBits
zeroBits :: MemoryHeapFlagBits
$czeroBits :: MemoryHeapFlagBits
rotate :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
$crotate :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
shift :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
$cshift :: MemoryHeapFlagBits -> Int -> MemoryHeapFlagBits
complement :: MemoryHeapFlagBits -> MemoryHeapFlagBits
$ccomplement :: MemoryHeapFlagBits -> MemoryHeapFlagBits
xor :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> MemoryHeapFlagBits
$cxor :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> MemoryHeapFlagBits
.|. :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> MemoryHeapFlagBits
$c.|. :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> MemoryHeapFlagBits
.&. :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> MemoryHeapFlagBits
$c.&. :: MemoryHeapFlagBits -> MemoryHeapFlagBits -> MemoryHeapFlagBits
$cp1Bits :: Eq MemoryHeapFlagBits
Bits)

-- | 'MEMORY_HEAP_DEVICE_LOCAL_BIT' specifies that the heap corresponds to
-- device local memory. Device local memory /may/ have different
-- performance characteristics than host local memory, and /may/ support
-- different memory property flags.
pattern $bMEMORY_HEAP_DEVICE_LOCAL_BIT :: MemoryHeapFlagBits
$mMEMORY_HEAP_DEVICE_LOCAL_BIT :: forall r. MemoryHeapFlagBits -> (Void# -> r) -> (Void# -> r) -> r
MEMORY_HEAP_DEVICE_LOCAL_BIT = MemoryHeapFlagBits 0x00000001
-- | 'MEMORY_HEAP_MULTI_INSTANCE_BIT' specifies that in a logical device
-- representing more than one physical device, there is a per-physical
-- device instance of the heap memory. By default, an allocation from such
-- a heap will be replicated to each physical device’s instance of the
-- heap.
pattern $bMEMORY_HEAP_MULTI_INSTANCE_BIT :: MemoryHeapFlagBits
$mMEMORY_HEAP_MULTI_INSTANCE_BIT :: forall r. MemoryHeapFlagBits -> (Void# -> r) -> (Void# -> r) -> r
MEMORY_HEAP_MULTI_INSTANCE_BIT = MemoryHeapFlagBits 0x00000002

type MemoryHeapFlags = MemoryHeapFlagBits

instance Show MemoryHeapFlagBits where
  showsPrec :: Int -> MemoryHeapFlagBits -> ShowS
showsPrec p :: Int
p = \case
    MEMORY_HEAP_DEVICE_LOCAL_BIT -> String -> ShowS
showString "MEMORY_HEAP_DEVICE_LOCAL_BIT"
    MEMORY_HEAP_MULTI_INSTANCE_BIT -> String -> ShowS
showString "MEMORY_HEAP_MULTI_INSTANCE_BIT"
    MemoryHeapFlagBits x :: Flags
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "MemoryHeapFlagBits 0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Flags -> ShowS
forall a. (Integral a, Show a) => a -> ShowS
showHex Flags
x)

instance Read MemoryHeapFlagBits where
  readPrec :: ReadPrec MemoryHeapFlagBits
readPrec = ReadPrec MemoryHeapFlagBits -> ReadPrec MemoryHeapFlagBits
forall a. ReadPrec a -> ReadPrec a
parens ([(String, ReadPrec MemoryHeapFlagBits)]
-> ReadPrec MemoryHeapFlagBits
forall a. [(String, ReadPrec a)] -> ReadPrec a
choose [("MEMORY_HEAP_DEVICE_LOCAL_BIT", MemoryHeapFlagBits -> ReadPrec MemoryHeapFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure MemoryHeapFlagBits
MEMORY_HEAP_DEVICE_LOCAL_BIT)
                            , ("MEMORY_HEAP_MULTI_INSTANCE_BIT", MemoryHeapFlagBits -> ReadPrec MemoryHeapFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure MemoryHeapFlagBits
MEMORY_HEAP_MULTI_INSTANCE_BIT)]
                     ReadPrec MemoryHeapFlagBits
-> ReadPrec MemoryHeapFlagBits -> ReadPrec MemoryHeapFlagBits
forall a. ReadPrec a -> ReadPrec a -> ReadPrec a
+++
                     Int -> ReadPrec MemoryHeapFlagBits -> ReadPrec MemoryHeapFlagBits
forall a. Int -> ReadPrec a -> ReadPrec a
prec 10 (do
                       Lexeme -> ReadPrec ()
expectP (String -> Lexeme
Ident "MemoryHeapFlagBits")
                       Flags
v <- ReadPrec Flags -> ReadPrec Flags
forall a. ReadPrec a -> ReadPrec a
step ReadPrec Flags
forall a. Read a => ReadPrec a
readPrec
                       MemoryHeapFlagBits -> ReadPrec MemoryHeapFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Flags -> MemoryHeapFlagBits
MemoryHeapFlagBits Flags
v)))