{-# language CPP #-}
-- No documentation found for Chapter "DescriptorBindingFlagBits"
module Vulkan.Core12.Enums.DescriptorBindingFlagBits  ( DescriptorBindingFlags
                                                      , DescriptorBindingFlagBits( DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT
                                                                                 , DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT
                                                                                 , DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT
                                                                                 , DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_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 DescriptorBindingFlags = DescriptorBindingFlagBits

-- | VkDescriptorBindingFlagBits - Bitmask specifying descriptor set layout
-- binding properties
--
-- = Description
--
-- Note
--
-- Note that while 'DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT' and
-- 'DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT' both involve
-- updates to descriptor sets after they are bound,
-- 'DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT' is a weaker
-- requirement since it is only about descriptors that are not used,
-- whereas 'DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT' requires the
-- implementation to observe updates to descriptors that are used.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_indexing VK_EXT_descriptor_indexing>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'DescriptorBindingFlags'
newtype DescriptorBindingFlagBits = DescriptorBindingFlagBits Flags
  deriving newtype (DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> Bool
$c/= :: DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> Bool
== :: DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> Bool
$c== :: DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> Bool
Eq, Eq DescriptorBindingFlagBits
DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> Bool
DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> Ordering
DescriptorBindingFlagBits
-> DescriptorBindingFlagBits -> DescriptorBindingFlagBits
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 :: DescriptorBindingFlagBits
-> DescriptorBindingFlagBits -> DescriptorBindingFlagBits
$cmin :: DescriptorBindingFlagBits
-> DescriptorBindingFlagBits -> DescriptorBindingFlagBits
max :: DescriptorBindingFlagBits
-> DescriptorBindingFlagBits -> DescriptorBindingFlagBits
$cmax :: DescriptorBindingFlagBits
-> DescriptorBindingFlagBits -> DescriptorBindingFlagBits
>= :: DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> Bool
$c>= :: DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> Bool
> :: DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> Bool
$c> :: DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> Bool
<= :: DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> Bool
$c<= :: DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> Bool
< :: DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> Bool
$c< :: DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> Bool
compare :: DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> Ordering
$ccompare :: DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> Ordering
Ord, Ptr DescriptorBindingFlagBits -> IO DescriptorBindingFlagBits
Ptr DescriptorBindingFlagBits
-> Int -> IO DescriptorBindingFlagBits
Ptr DescriptorBindingFlagBits
-> Int -> DescriptorBindingFlagBits -> IO ()
Ptr DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> IO ()
DescriptorBindingFlagBits -> Int
forall b. Ptr b -> Int -> IO DescriptorBindingFlagBits
forall b. Ptr b -> Int -> DescriptorBindingFlagBits -> 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 DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> IO ()
$cpoke :: Ptr DescriptorBindingFlagBits -> DescriptorBindingFlagBits -> IO ()
peek :: Ptr DescriptorBindingFlagBits -> IO DescriptorBindingFlagBits
$cpeek :: Ptr DescriptorBindingFlagBits -> IO DescriptorBindingFlagBits
pokeByteOff :: forall b. Ptr b -> Int -> DescriptorBindingFlagBits -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> DescriptorBindingFlagBits -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO DescriptorBindingFlagBits
$cpeekByteOff :: forall b. Ptr b -> Int -> IO DescriptorBindingFlagBits
pokeElemOff :: Ptr DescriptorBindingFlagBits
-> Int -> DescriptorBindingFlagBits -> IO ()
$cpokeElemOff :: Ptr DescriptorBindingFlagBits
-> Int -> DescriptorBindingFlagBits -> IO ()
peekElemOff :: Ptr DescriptorBindingFlagBits
-> Int -> IO DescriptorBindingFlagBits
$cpeekElemOff :: Ptr DescriptorBindingFlagBits
-> Int -> IO DescriptorBindingFlagBits
alignment :: DescriptorBindingFlagBits -> Int
$calignment :: DescriptorBindingFlagBits -> Int
sizeOf :: DescriptorBindingFlagBits -> Int
$csizeOf :: DescriptorBindingFlagBits -> Int
Storable, DescriptorBindingFlagBits
forall a. a -> Zero a
zero :: DescriptorBindingFlagBits
$czero :: DescriptorBindingFlagBits
Zero, Eq DescriptorBindingFlagBits
DescriptorBindingFlagBits
Int -> DescriptorBindingFlagBits
DescriptorBindingFlagBits -> Bool
DescriptorBindingFlagBits -> Int
DescriptorBindingFlagBits -> Maybe Int
DescriptorBindingFlagBits -> DescriptorBindingFlagBits
DescriptorBindingFlagBits -> Int -> Bool
DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
DescriptorBindingFlagBits
-> DescriptorBindingFlagBits -> DescriptorBindingFlagBits
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 :: DescriptorBindingFlagBits -> Int
$cpopCount :: DescriptorBindingFlagBits -> Int
rotateR :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
$crotateR :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
rotateL :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
$crotateL :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
unsafeShiftR :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
$cunsafeShiftR :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
shiftR :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
$cshiftR :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
unsafeShiftL :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
$cunsafeShiftL :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
shiftL :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
$cshiftL :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
isSigned :: DescriptorBindingFlagBits -> Bool
$cisSigned :: DescriptorBindingFlagBits -> Bool
bitSize :: DescriptorBindingFlagBits -> Int
$cbitSize :: DescriptorBindingFlagBits -> Int
bitSizeMaybe :: DescriptorBindingFlagBits -> Maybe Int
$cbitSizeMaybe :: DescriptorBindingFlagBits -> Maybe Int
testBit :: DescriptorBindingFlagBits -> Int -> Bool
$ctestBit :: DescriptorBindingFlagBits -> Int -> Bool
complementBit :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
$ccomplementBit :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
clearBit :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
$cclearBit :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
setBit :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
$csetBit :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
bit :: Int -> DescriptorBindingFlagBits
$cbit :: Int -> DescriptorBindingFlagBits
zeroBits :: DescriptorBindingFlagBits
$czeroBits :: DescriptorBindingFlagBits
rotate :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
$crotate :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
shift :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
$cshift :: DescriptorBindingFlagBits -> Int -> DescriptorBindingFlagBits
complement :: DescriptorBindingFlagBits -> DescriptorBindingFlagBits
$ccomplement :: DescriptorBindingFlagBits -> DescriptorBindingFlagBits
xor :: DescriptorBindingFlagBits
-> DescriptorBindingFlagBits -> DescriptorBindingFlagBits
$cxor :: DescriptorBindingFlagBits
-> DescriptorBindingFlagBits -> DescriptorBindingFlagBits
.|. :: DescriptorBindingFlagBits
-> DescriptorBindingFlagBits -> DescriptorBindingFlagBits
$c.|. :: DescriptorBindingFlagBits
-> DescriptorBindingFlagBits -> DescriptorBindingFlagBits
.&. :: DescriptorBindingFlagBits
-> DescriptorBindingFlagBits -> DescriptorBindingFlagBits
$c.&. :: DescriptorBindingFlagBits
-> DescriptorBindingFlagBits -> DescriptorBindingFlagBits
Bits, Bits DescriptorBindingFlagBits
DescriptorBindingFlagBits -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: DescriptorBindingFlagBits -> Int
$ccountTrailingZeros :: DescriptorBindingFlagBits -> Int
countLeadingZeros :: DescriptorBindingFlagBits -> Int
$ccountLeadingZeros :: DescriptorBindingFlagBits -> Int
finiteBitSize :: DescriptorBindingFlagBits -> Int
$cfiniteBitSize :: DescriptorBindingFlagBits -> Int
FiniteBits)

-- | 'DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT' indicates that if descriptors
-- in this binding are updated between when the descriptor set is bound in
-- a command buffer and when that command buffer is submitted to a queue,
-- then the submission will use the most recently set descriptors for this
-- binding and the updates do not invalidate the command buffer. Descriptor
-- bindings created with this flag are also partially exempt from the
-- external synchronization requirement in
-- 'Vulkan.Extensions.VK_KHR_descriptor_update_template.updateDescriptorSetWithTemplateKHR'
-- and 'Vulkan.Core10.DescriptorSet.updateDescriptorSets'. Multiple
-- descriptors with this flag set /can/ be updated concurrently in
-- different threads, though the same descriptor /must/ not be updated
-- concurrently by two threads. Descriptors with this flag set /can/ be
-- updated concurrently with the set being bound to a command buffer in
-- another thread, but not concurrently with the set being reset or freed.
pattern $bDESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT :: DescriptorBindingFlagBits
$mDESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT :: forall {r}.
DescriptorBindingFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT = DescriptorBindingFlagBits 0x00000001

-- | 'DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT' indicates that
-- descriptors in this binding /can/ be updated after a command buffer has
-- bound this descriptor set, or while a command buffer that uses this
-- descriptor set is pending execution, as long as the descriptors that are
-- updated are not used by those command buffers. Descriptor bindings
-- created with this flag are also partially exempt from the external
-- synchronization requirement in
-- 'Vulkan.Extensions.VK_KHR_descriptor_update_template.updateDescriptorSetWithTemplateKHR'
-- and 'Vulkan.Core10.DescriptorSet.updateDescriptorSets' in the same way
-- as for 'DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT'. If
-- 'DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT' is also set, then descriptors
-- /can/ be updated as long as they are not dynamically used by any shader
-- invocations. If 'DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT' is not set,
-- then descriptors /can/ be updated as long as they are not statically
-- used by any shader invocations.
pattern $bDESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT :: DescriptorBindingFlagBits
$mDESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT :: forall {r}.
DescriptorBindingFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT = DescriptorBindingFlagBits 0x00000002

-- | 'DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT' indicates that descriptors in
-- this binding that are not /dynamically used/ need not contain valid
-- descriptors at the time the descriptors are consumed. A descriptor is
-- dynamically used if any shader invocation executes an instruction that
-- performs any memory access using the descriptor. If a descriptor is not
-- dynamically used, any resource referenced by the descriptor is not
-- considered to be referenced during command execution.
pattern $bDESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT :: DescriptorBindingFlagBits
$mDESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT :: forall {r}.
DescriptorBindingFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT = DescriptorBindingFlagBits 0x00000004

-- | 'DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT' indicates that this
-- is a /variable-sized descriptor binding/ whose size will be specified
-- when a descriptor set is allocated using this layout. The value of
-- @descriptorCount@ is treated as an upper bound on the size of the
-- binding. This /must/ only be used for the last binding in the descriptor
-- set layout (i.e. the binding with the largest value of @binding@). For
-- the purposes of counting against limits such as @maxDescriptorSet@* and
-- @maxPerStageDescriptor@*, the full value of @descriptorCount@ is
-- counted, except for descriptor bindings with a descriptor type of
-- 'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK',
-- when
-- 'Vulkan.Core10.DescriptorSet.DescriptorSetLayoutCreateInfo'::@flags@
-- does not contain
-- 'Vulkan.Core10.Enums.DescriptorSetLayoutCreateFlagBits.DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT'.
-- In this case, @descriptorCount@ specifies the upper bound on the byte
-- size of the binding; thus it counts against the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#limits-maxInlineUniformBlockSize maxInlineUniformBlockSize>
-- and
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#limits-maxInlineUniformTotalSize maxInlineUniformTotalSize>
-- limits instead.
pattern $bDESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT :: DescriptorBindingFlagBits
$mDESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT :: forall {r}.
DescriptorBindingFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT = DescriptorBindingFlagBits 0x00000008

conNameDescriptorBindingFlagBits :: String
conNameDescriptorBindingFlagBits :: String
conNameDescriptorBindingFlagBits = String
"DescriptorBindingFlagBits"

enumPrefixDescriptorBindingFlagBits :: String
enumPrefixDescriptorBindingFlagBits :: String
enumPrefixDescriptorBindingFlagBits = String
"DESCRIPTOR_BINDING_"

showTableDescriptorBindingFlagBits :: [(DescriptorBindingFlagBits, String)]
showTableDescriptorBindingFlagBits :: [(DescriptorBindingFlagBits, String)]
showTableDescriptorBindingFlagBits =
  [
    ( DescriptorBindingFlagBits
DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT
    , String
"UPDATE_AFTER_BIND_BIT"
    )
  ,
    ( DescriptorBindingFlagBits
DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT
    , String
"UPDATE_UNUSED_WHILE_PENDING_BIT"
    )
  ,
    ( DescriptorBindingFlagBits
DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT
    , String
"PARTIALLY_BOUND_BIT"
    )
  ,
    ( DescriptorBindingFlagBits
DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT
    , String
"VARIABLE_DESCRIPTOR_COUNT_BIT"
    )
  ]

instance Show DescriptorBindingFlagBits where
  showsPrec :: Int -> DescriptorBindingFlagBits -> ShowS
showsPrec =
    forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixDescriptorBindingFlagBits
      [(DescriptorBindingFlagBits, String)]
showTableDescriptorBindingFlagBits
      String
conNameDescriptorBindingFlagBits
      (\(DescriptorBindingFlagBits 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 DescriptorBindingFlagBits where
  readPrec :: ReadPrec DescriptorBindingFlagBits
readPrec =
    forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixDescriptorBindingFlagBits
      [(DescriptorBindingFlagBits, String)]
showTableDescriptorBindingFlagBits
      String
conNameDescriptorBindingFlagBits
      Flags -> DescriptorBindingFlagBits
DescriptorBindingFlagBits