{-# language CPP #-}
module Vulkan.Core10.Enums.BufferCreateFlagBits  ( BufferCreateFlagBits( BUFFER_CREATE_SPARSE_BINDING_BIT
                                                                       , BUFFER_CREATE_SPARSE_RESIDENCY_BIT
                                                                       , BUFFER_CREATE_SPARSE_ALIASED_BIT
                                                                       , BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT
                                                                       , BUFFER_CREATE_PROTECTED_BIT
                                                                       , ..
                                                                       )
                                                 , BufferCreateFlags
                                                 ) 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)
-- | VkBufferCreateFlagBits - Bitmask specifying additional parameters of a
-- buffer
--
-- = Description
--
-- See
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#sparsememory-sparseresourcefeatures Sparse Resource Features>
-- and
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features Physical Device Features>
-- for details of the sparse memory features supported on a device.
--
-- = See Also
--
-- 'BufferCreateFlags'
newtype BufferCreateFlagBits = BufferCreateFlagBits Flags
  deriving newtype (BufferCreateFlagBits -> BufferCreateFlagBits -> Bool
(BufferCreateFlagBits -> BufferCreateFlagBits -> Bool)
-> (BufferCreateFlagBits -> BufferCreateFlagBits -> Bool)
-> Eq BufferCreateFlagBits
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BufferCreateFlagBits -> BufferCreateFlagBits -> Bool
$c/= :: BufferCreateFlagBits -> BufferCreateFlagBits -> Bool
== :: BufferCreateFlagBits -> BufferCreateFlagBits -> Bool
$c== :: BufferCreateFlagBits -> BufferCreateFlagBits -> Bool
Eq, Eq BufferCreateFlagBits
Eq BufferCreateFlagBits =>
(BufferCreateFlagBits -> BufferCreateFlagBits -> Ordering)
-> (BufferCreateFlagBits -> BufferCreateFlagBits -> Bool)
-> (BufferCreateFlagBits -> BufferCreateFlagBits -> Bool)
-> (BufferCreateFlagBits -> BufferCreateFlagBits -> Bool)
-> (BufferCreateFlagBits -> BufferCreateFlagBits -> Bool)
-> (BufferCreateFlagBits
    -> BufferCreateFlagBits -> BufferCreateFlagBits)
-> (BufferCreateFlagBits
    -> BufferCreateFlagBits -> BufferCreateFlagBits)
-> Ord BufferCreateFlagBits
BufferCreateFlagBits -> BufferCreateFlagBits -> Bool
BufferCreateFlagBits -> BufferCreateFlagBits -> Ordering
BufferCreateFlagBits
-> BufferCreateFlagBits -> BufferCreateFlagBits
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 :: BufferCreateFlagBits
-> BufferCreateFlagBits -> BufferCreateFlagBits
$cmin :: BufferCreateFlagBits
-> BufferCreateFlagBits -> BufferCreateFlagBits
max :: BufferCreateFlagBits
-> BufferCreateFlagBits -> BufferCreateFlagBits
$cmax :: BufferCreateFlagBits
-> BufferCreateFlagBits -> BufferCreateFlagBits
>= :: BufferCreateFlagBits -> BufferCreateFlagBits -> Bool
$c>= :: BufferCreateFlagBits -> BufferCreateFlagBits -> Bool
> :: BufferCreateFlagBits -> BufferCreateFlagBits -> Bool
$c> :: BufferCreateFlagBits -> BufferCreateFlagBits -> Bool
<= :: BufferCreateFlagBits -> BufferCreateFlagBits -> Bool
$c<= :: BufferCreateFlagBits -> BufferCreateFlagBits -> Bool
< :: BufferCreateFlagBits -> BufferCreateFlagBits -> Bool
$c< :: BufferCreateFlagBits -> BufferCreateFlagBits -> Bool
compare :: BufferCreateFlagBits -> BufferCreateFlagBits -> Ordering
$ccompare :: BufferCreateFlagBits -> BufferCreateFlagBits -> Ordering
$cp1Ord :: Eq BufferCreateFlagBits
Ord, Ptr b -> Int -> IO BufferCreateFlagBits
Ptr b -> Int -> BufferCreateFlagBits -> IO ()
Ptr BufferCreateFlagBits -> IO BufferCreateFlagBits
Ptr BufferCreateFlagBits -> Int -> IO BufferCreateFlagBits
Ptr BufferCreateFlagBits -> Int -> BufferCreateFlagBits -> IO ()
Ptr BufferCreateFlagBits -> BufferCreateFlagBits -> IO ()
BufferCreateFlagBits -> Int
(BufferCreateFlagBits -> Int)
-> (BufferCreateFlagBits -> Int)
-> (Ptr BufferCreateFlagBits -> Int -> IO BufferCreateFlagBits)
-> (Ptr BufferCreateFlagBits
    -> Int -> BufferCreateFlagBits -> IO ())
-> (forall b. Ptr b -> Int -> IO BufferCreateFlagBits)
-> (forall b. Ptr b -> Int -> BufferCreateFlagBits -> IO ())
-> (Ptr BufferCreateFlagBits -> IO BufferCreateFlagBits)
-> (Ptr BufferCreateFlagBits -> BufferCreateFlagBits -> IO ())
-> Storable BufferCreateFlagBits
forall b. Ptr b -> Int -> IO BufferCreateFlagBits
forall b. Ptr b -> Int -> BufferCreateFlagBits -> 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 BufferCreateFlagBits -> BufferCreateFlagBits -> IO ()
$cpoke :: Ptr BufferCreateFlagBits -> BufferCreateFlagBits -> IO ()
peek :: Ptr BufferCreateFlagBits -> IO BufferCreateFlagBits
$cpeek :: Ptr BufferCreateFlagBits -> IO BufferCreateFlagBits
pokeByteOff :: Ptr b -> Int -> BufferCreateFlagBits -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> BufferCreateFlagBits -> IO ()
peekByteOff :: Ptr b -> Int -> IO BufferCreateFlagBits
$cpeekByteOff :: forall b. Ptr b -> Int -> IO BufferCreateFlagBits
pokeElemOff :: Ptr BufferCreateFlagBits -> Int -> BufferCreateFlagBits -> IO ()
$cpokeElemOff :: Ptr BufferCreateFlagBits -> Int -> BufferCreateFlagBits -> IO ()
peekElemOff :: Ptr BufferCreateFlagBits -> Int -> IO BufferCreateFlagBits
$cpeekElemOff :: Ptr BufferCreateFlagBits -> Int -> IO BufferCreateFlagBits
alignment :: BufferCreateFlagBits -> Int
$calignment :: BufferCreateFlagBits -> Int
sizeOf :: BufferCreateFlagBits -> Int
$csizeOf :: BufferCreateFlagBits -> Int
Storable, BufferCreateFlagBits
BufferCreateFlagBits -> Zero BufferCreateFlagBits
forall a. a -> Zero a
zero :: BufferCreateFlagBits
$czero :: BufferCreateFlagBits
Zero, Eq BufferCreateFlagBits
BufferCreateFlagBits
Eq BufferCreateFlagBits =>
(BufferCreateFlagBits
 -> BufferCreateFlagBits -> BufferCreateFlagBits)
-> (BufferCreateFlagBits
    -> BufferCreateFlagBits -> BufferCreateFlagBits)
-> (BufferCreateFlagBits
    -> BufferCreateFlagBits -> BufferCreateFlagBits)
-> (BufferCreateFlagBits -> BufferCreateFlagBits)
-> (BufferCreateFlagBits -> Int -> BufferCreateFlagBits)
-> (BufferCreateFlagBits -> Int -> BufferCreateFlagBits)
-> BufferCreateFlagBits
-> (Int -> BufferCreateFlagBits)
-> (BufferCreateFlagBits -> Int -> BufferCreateFlagBits)
-> (BufferCreateFlagBits -> Int -> BufferCreateFlagBits)
-> (BufferCreateFlagBits -> Int -> BufferCreateFlagBits)
-> (BufferCreateFlagBits -> Int -> Bool)
-> (BufferCreateFlagBits -> Maybe Int)
-> (BufferCreateFlagBits -> Int)
-> (BufferCreateFlagBits -> Bool)
-> (BufferCreateFlagBits -> Int -> BufferCreateFlagBits)
-> (BufferCreateFlagBits -> Int -> BufferCreateFlagBits)
-> (BufferCreateFlagBits -> Int -> BufferCreateFlagBits)
-> (BufferCreateFlagBits -> Int -> BufferCreateFlagBits)
-> (BufferCreateFlagBits -> Int -> BufferCreateFlagBits)
-> (BufferCreateFlagBits -> Int -> BufferCreateFlagBits)
-> (BufferCreateFlagBits -> Int)
-> Bits BufferCreateFlagBits
Int -> BufferCreateFlagBits
BufferCreateFlagBits -> Bool
BufferCreateFlagBits -> Int
BufferCreateFlagBits -> Maybe Int
BufferCreateFlagBits -> BufferCreateFlagBits
BufferCreateFlagBits -> Int -> Bool
BufferCreateFlagBits -> Int -> BufferCreateFlagBits
BufferCreateFlagBits
-> BufferCreateFlagBits -> BufferCreateFlagBits
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 :: BufferCreateFlagBits -> Int
$cpopCount :: BufferCreateFlagBits -> Int
rotateR :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
$crotateR :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
rotateL :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
$crotateL :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
unsafeShiftR :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
$cunsafeShiftR :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
shiftR :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
$cshiftR :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
unsafeShiftL :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
$cunsafeShiftL :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
shiftL :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
$cshiftL :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
isSigned :: BufferCreateFlagBits -> Bool
$cisSigned :: BufferCreateFlagBits -> Bool
bitSize :: BufferCreateFlagBits -> Int
$cbitSize :: BufferCreateFlagBits -> Int
bitSizeMaybe :: BufferCreateFlagBits -> Maybe Int
$cbitSizeMaybe :: BufferCreateFlagBits -> Maybe Int
testBit :: BufferCreateFlagBits -> Int -> Bool
$ctestBit :: BufferCreateFlagBits -> Int -> Bool
complementBit :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
$ccomplementBit :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
clearBit :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
$cclearBit :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
setBit :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
$csetBit :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
bit :: Int -> BufferCreateFlagBits
$cbit :: Int -> BufferCreateFlagBits
zeroBits :: BufferCreateFlagBits
$czeroBits :: BufferCreateFlagBits
rotate :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
$crotate :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
shift :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
$cshift :: BufferCreateFlagBits -> Int -> BufferCreateFlagBits
complement :: BufferCreateFlagBits -> BufferCreateFlagBits
$ccomplement :: BufferCreateFlagBits -> BufferCreateFlagBits
xor :: BufferCreateFlagBits
-> BufferCreateFlagBits -> BufferCreateFlagBits
$cxor :: BufferCreateFlagBits
-> BufferCreateFlagBits -> BufferCreateFlagBits
.|. :: BufferCreateFlagBits
-> BufferCreateFlagBits -> BufferCreateFlagBits
$c.|. :: BufferCreateFlagBits
-> BufferCreateFlagBits -> BufferCreateFlagBits
.&. :: BufferCreateFlagBits
-> BufferCreateFlagBits -> BufferCreateFlagBits
$c.&. :: BufferCreateFlagBits
-> BufferCreateFlagBits -> BufferCreateFlagBits
$cp1Bits :: Eq BufferCreateFlagBits
Bits)

-- | 'BUFFER_CREATE_SPARSE_BINDING_BIT' specifies that the buffer will be
-- backed using sparse memory binding.
pattern $bBUFFER_CREATE_SPARSE_BINDING_BIT :: BufferCreateFlagBits
$mBUFFER_CREATE_SPARSE_BINDING_BIT :: forall r. BufferCreateFlagBits -> (Void# -> r) -> (Void# -> r) -> r
BUFFER_CREATE_SPARSE_BINDING_BIT = BufferCreateFlagBits 0x00000001
-- | 'BUFFER_CREATE_SPARSE_RESIDENCY_BIT' specifies that the buffer /can/ be
-- partially backed using sparse memory binding. Buffers created with this
-- flag /must/ also be created with the 'BUFFER_CREATE_SPARSE_BINDING_BIT'
-- flag.
pattern $bBUFFER_CREATE_SPARSE_RESIDENCY_BIT :: BufferCreateFlagBits
$mBUFFER_CREATE_SPARSE_RESIDENCY_BIT :: forall r. BufferCreateFlagBits -> (Void# -> r) -> (Void# -> r) -> r
BUFFER_CREATE_SPARSE_RESIDENCY_BIT = BufferCreateFlagBits 0x00000002
-- | 'BUFFER_CREATE_SPARSE_ALIASED_BIT' specifies that the buffer will be
-- backed using sparse memory binding with memory ranges that might also
-- simultaneously be backing another buffer (or another portion of the same
-- buffer). Buffers created with this flag /must/ also be created with the
-- 'BUFFER_CREATE_SPARSE_BINDING_BIT' flag.
pattern $bBUFFER_CREATE_SPARSE_ALIASED_BIT :: BufferCreateFlagBits
$mBUFFER_CREATE_SPARSE_ALIASED_BIT :: forall r. BufferCreateFlagBits -> (Void# -> r) -> (Void# -> r) -> r
BUFFER_CREATE_SPARSE_ALIASED_BIT = BufferCreateFlagBits 0x00000004
-- | 'BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT' specifies that the
-- buffer’s address /can/ be saved and reused on a subsequent run (e.g. for
-- trace capture and replay), see
-- 'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.BufferOpaqueCaptureAddressCreateInfo'
-- for more detail.
pattern $bBUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT :: BufferCreateFlagBits
$mBUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT :: forall r. BufferCreateFlagBits -> (Void# -> r) -> (Void# -> r) -> r
BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT = BufferCreateFlagBits 0x00000010
-- | 'BUFFER_CREATE_PROTECTED_BIT' specifies that the buffer is a protected
-- buffer.
pattern $bBUFFER_CREATE_PROTECTED_BIT :: BufferCreateFlagBits
$mBUFFER_CREATE_PROTECTED_BIT :: forall r. BufferCreateFlagBits -> (Void# -> r) -> (Void# -> r) -> r
BUFFER_CREATE_PROTECTED_BIT = BufferCreateFlagBits 0x00000008

type BufferCreateFlags = BufferCreateFlagBits

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