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

-- | 'DEPENDENCY_BY_REGION_BIT' specifies that dependencies will be
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-framebuffer-regions framebuffer-local>.
pattern $bDEPENDENCY_BY_REGION_BIT :: DependencyFlagBits
$mDEPENDENCY_BY_REGION_BIT :: forall r. DependencyFlagBits -> (Void# -> r) -> (Void# -> r) -> r
DEPENDENCY_BY_REGION_BIT = DependencyFlagBits 0x00000001
-- | 'DEPENDENCY_VIEW_LOCAL_BIT' specifies that a
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-barriers-subpass-self-dependencies subpass has more than one view>.
pattern $bDEPENDENCY_VIEW_LOCAL_BIT :: DependencyFlagBits
$mDEPENDENCY_VIEW_LOCAL_BIT :: forall r. DependencyFlagBits -> (Void# -> r) -> (Void# -> r) -> r
DEPENDENCY_VIEW_LOCAL_BIT = DependencyFlagBits 0x00000002
-- | 'DEPENDENCY_DEVICE_GROUP_BIT' specifies that dependencies are
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-device-local-dependencies non-device-local dependency>.
pattern $bDEPENDENCY_DEVICE_GROUP_BIT :: DependencyFlagBits
$mDEPENDENCY_DEVICE_GROUP_BIT :: forall r. DependencyFlagBits -> (Void# -> r) -> (Void# -> r) -> r
DEPENDENCY_DEVICE_GROUP_BIT = DependencyFlagBits 0x00000004

type DependencyFlags = DependencyFlagBits

instance Show DependencyFlagBits where
  showsPrec :: Int -> DependencyFlagBits -> ShowS
showsPrec p :: Int
p = \case
    DEPENDENCY_BY_REGION_BIT -> String -> ShowS
showString "DEPENDENCY_BY_REGION_BIT"
    DEPENDENCY_VIEW_LOCAL_BIT -> String -> ShowS
showString "DEPENDENCY_VIEW_LOCAL_BIT"
    DEPENDENCY_DEVICE_GROUP_BIT -> String -> ShowS
showString "DEPENDENCY_DEVICE_GROUP_BIT"
    DependencyFlagBits x :: Flags
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "DependencyFlagBits 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 DependencyFlagBits where
  readPrec :: ReadPrec DependencyFlagBits
readPrec = ReadPrec DependencyFlagBits -> ReadPrec DependencyFlagBits
forall a. ReadPrec a -> ReadPrec a
parens ([(String, ReadPrec DependencyFlagBits)]
-> ReadPrec DependencyFlagBits
forall a. [(String, ReadPrec a)] -> ReadPrec a
choose [("DEPENDENCY_BY_REGION_BIT", DependencyFlagBits -> ReadPrec DependencyFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure DependencyFlagBits
DEPENDENCY_BY_REGION_BIT)
                            , ("DEPENDENCY_VIEW_LOCAL_BIT", DependencyFlagBits -> ReadPrec DependencyFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure DependencyFlagBits
DEPENDENCY_VIEW_LOCAL_BIT)
                            , ("DEPENDENCY_DEVICE_GROUP_BIT", DependencyFlagBits -> ReadPrec DependencyFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure DependencyFlagBits
DEPENDENCY_DEVICE_GROUP_BIT)]
                     ReadPrec DependencyFlagBits
-> ReadPrec DependencyFlagBits -> ReadPrec DependencyFlagBits
forall a. ReadPrec a -> ReadPrec a -> ReadPrec a
+++
                     Int -> ReadPrec DependencyFlagBits -> ReadPrec DependencyFlagBits
forall a. Int -> ReadPrec a -> ReadPrec a
prec 10 (do
                       Lexeme -> ReadPrec ()
expectP (String -> Lexeme
Ident "DependencyFlagBits")
                       Flags
v <- ReadPrec Flags -> ReadPrec Flags
forall a. ReadPrec a -> ReadPrec a
step ReadPrec Flags
forall a. Read a => ReadPrec a
readPrec
                       DependencyFlagBits -> ReadPrec DependencyFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Flags -> DependencyFlagBits
DependencyFlagBits Flags
v)))