{-# language CPP #-}
-- No documentation found for Chapter "BufferCreateFlagBits"
module Vulkan.Core10.Enums.BufferCreateFlagBits  ( BufferCreateFlags
                                                 , 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
                                                                       , ..
                                                                       )
                                                 ) where

import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import GHC.Show (showString)
import Numeric (showHex)
import Vulkan.Zero (Zero)
import Data.Bits (Bits)
import Data.Bits (FiniteBits)
import Foreign.Storable (Storable)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Vulkan.Core10.FundamentalTypes (Flags)
type BufferCreateFlags = BufferCreateFlagBits

-- | 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, Bits BufferCreateFlagBits
Bits BufferCreateFlagBits =>
(BufferCreateFlagBits -> Int)
-> (BufferCreateFlagBits -> Int)
-> (BufferCreateFlagBits -> Int)
-> FiniteBits BufferCreateFlagBits
BufferCreateFlagBits -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: BufferCreateFlagBits -> Int
$ccountTrailingZeros :: BufferCreateFlagBits -> Int
countLeadingZeros :: BufferCreateFlagBits -> Int
$ccountLeadingZeros :: BufferCreateFlagBits -> Int
finiteBitSize :: BufferCreateFlagBits -> Int
$cfiniteBitSize :: BufferCreateFlagBits -> Int
$cp1FiniteBits :: Bits BufferCreateFlagBits
FiniteBits)

-- | '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

conNameBufferCreateFlagBits :: String
conNameBufferCreateFlagBits :: String
conNameBufferCreateFlagBits = "BufferCreateFlagBits"

enumPrefixBufferCreateFlagBits :: String
enumPrefixBufferCreateFlagBits :: String
enumPrefixBufferCreateFlagBits = "BUFFER_CREATE_"

showTableBufferCreateFlagBits :: [(BufferCreateFlagBits, String)]
showTableBufferCreateFlagBits :: [(BufferCreateFlagBits, String)]
showTableBufferCreateFlagBits =
  [ (BufferCreateFlagBits
BUFFER_CREATE_SPARSE_BINDING_BIT               , "SPARSE_BINDING_BIT")
  , (BufferCreateFlagBits
BUFFER_CREATE_SPARSE_RESIDENCY_BIT             , "SPARSE_RESIDENCY_BIT")
  , (BufferCreateFlagBits
BUFFER_CREATE_SPARSE_ALIASED_BIT               , "SPARSE_ALIASED_BIT")
  , (BufferCreateFlagBits
BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT, "DEVICE_ADDRESS_CAPTURE_REPLAY_BIT")
  , (BufferCreateFlagBits
BUFFER_CREATE_PROTECTED_BIT                    , "PROTECTED_BIT")
  ]

instance Show BufferCreateFlagBits where
  showsPrec :: Int -> BufferCreateFlagBits -> ShowS
showsPrec = String
-> [(BufferCreateFlagBits, String)]
-> String
-> (BufferCreateFlagBits -> Flags)
-> (Flags -> ShowS)
-> Int
-> BufferCreateFlagBits
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixBufferCreateFlagBits
                            [(BufferCreateFlagBits, String)]
showTableBufferCreateFlagBits
                            String
conNameBufferCreateFlagBits
                            (\(BufferCreateFlagBits x :: Flags
x) -> Flags
x)
                            (\x :: Flags
x -> String -> ShowS
showString "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 = String
-> [(BufferCreateFlagBits, String)]
-> String
-> (Flags -> BufferCreateFlagBits)
-> ReadPrec BufferCreateFlagBits
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixBufferCreateFlagBits
                          [(BufferCreateFlagBits, String)]
showTableBufferCreateFlagBits
                          String
conNameBufferCreateFlagBits
                          Flags -> BufferCreateFlagBits
BufferCreateFlagBits