{-# 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_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT
                                                                       , BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT
                                                                       , BUFFER_CREATE_PROTECTED_BIT
                                                                       , ..
                                                                       )
                                                 ) where

import Data.Bits (Bits)
import Data.Bits (FiniteBits)
import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import GHC.Show (showString)
import Numeric (showHex)
import Vulkan.Zero (Zero)
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://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#sparsememory-sparseresourcefeatures Sparse Resource Features>
-- and
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features Physical Device Features>
-- for details of the sparse memory features supported on a device.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_0 VK_VERSION_1_0>,
-- 'BufferCreateFlags'
newtype BufferCreateFlagBits = BufferCreateFlagBits Flags
  deriving newtype (BufferCreateFlagBits -> BufferCreateFlagBits -> Bool
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
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
Ord, Ptr BufferCreateFlagBits -> IO BufferCreateFlagBits
Ptr BufferCreateFlagBits -> Int -> IO BufferCreateFlagBits
Ptr BufferCreateFlagBits -> Int -> BufferCreateFlagBits -> IO ()
Ptr BufferCreateFlagBits -> BufferCreateFlagBits -> IO ()
BufferCreateFlagBits -> Int
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 :: forall b. Ptr b -> Int -> BufferCreateFlagBits -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> BufferCreateFlagBits -> IO ()
peekByteOff :: forall b. 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
forall a. a -> Zero a
zero :: BufferCreateFlagBits
$czero :: BufferCreateFlagBits
Zero, Eq BufferCreateFlagBits
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
Bits, Bits 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
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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> r) -> r
BUFFER_CREATE_SPARSE_ALIASED_BIT = BufferCreateFlagBits 0x00000004

-- | 'BUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT' specifies that
-- the buffer /can/ be used with descriptor buffers when capturing and
-- replaying (e.g. for trace capture and replay), see
-- 'Vulkan.Extensions.VK_EXT_descriptor_buffer.OpaqueCaptureDescriptorDataCreateInfoEXT'
-- for more detail.
pattern $bBUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT :: BufferCreateFlagBits
$mBUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT :: forall {r}.
BufferCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
BUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = BufferCreateFlagBits 0x00000020

-- | '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 -> ((# #) -> r) -> ((# #) -> 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 -> ((# #) -> r) -> ((# #) -> r) -> r
BUFFER_CREATE_PROTECTED_BIT = BufferCreateFlagBits 0x00000008

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

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

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

instance Show BufferCreateFlagBits where
  showsPrec :: Int -> BufferCreateFlagBits -> ShowS
showsPrec =
    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 Flags
x) -> Flags
x)
      (\Flags
x -> String -> ShowS
showString String
"0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex Flags
x)

instance Read BufferCreateFlagBits where
  readPrec :: ReadPrec BufferCreateFlagBits
readPrec =
    forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixBufferCreateFlagBits
      [(BufferCreateFlagBits, String)]
showTableBufferCreateFlagBits
      String
conNameBufferCreateFlagBits
      Flags -> BufferCreateFlagBits
BufferCreateFlagBits