{-# language CPP #-}
-- No documentation found for Chapter "Promoted_From_VK_KHR_maintenance6AdditionalFunctionality'"
module Vulkan.Core14.Promoted_From_VK_KHR_maintenance6AdditionalFunctionality'  ( cmdBindDescriptorSets2
                                                                                , cmdPushConstants2
                                                                                , cmdPushDescriptorSet2
                                                                                , cmdPushDescriptorSetWithTemplate2
                                                                                , PhysicalDeviceMaintenance6Features(..)
                                                                                , PhysicalDeviceMaintenance6Properties(..)
                                                                                , BindMemoryStatus(..)
                                                                                , BindDescriptorSetsInfo(..)
                                                                                , PushConstantsInfo(..)
                                                                                , PushDescriptorSetInfo(..)
                                                                                , PushDescriptorSetWithTemplateInfo(..)
                                                                                , StructureType(..)
                                                                                ) where

import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytes)
import GHC.IO (throwIO)
import GHC.Ptr (castPtr)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import qualified Data.Vector (null)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.Type.Equality ((:~:)(Refl))
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.CStruct.Extends (peekSomeCStruct)
import Vulkan.CStruct.Extends (pokeSomeCStruct)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.CStruct.Extends (Chain)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer(CommandBuffer))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Core10.Handles (DescriptorSet)
import Vulkan.Core11.Handles (DescriptorUpdateTemplate)
import Vulkan.Dynamic (DeviceCmds(pVkCmdBindDescriptorSets2))
import Vulkan.Dynamic (DeviceCmds(pVkCmdPushConstants2))
import Vulkan.Dynamic (DeviceCmds(pVkCmdPushDescriptorSet2))
import Vulkan.Dynamic (DeviceCmds(pVkCmdPushDescriptorSetWithTemplate2))
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PeekChain(..))
import Vulkan.Core10.Handles (PipelineLayout)
import {-# SOURCE #-} Vulkan.Core10.PipelineLayout (PipelineLayoutCreateInfo)
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import {-# SOURCE #-} Vulkan.Extensions.VK_NV_push_constant_bank (PushConstantBankInfoNV)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlags)
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.DescriptorSet (WriteDescriptorSet)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BIND_MEMORY_STATUS))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PUSH_CONSTANTS_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdBindDescriptorSets2
  :: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ()

-- | vkCmdBindDescriptorSets2 - Binds descriptor sets to a command buffer
--
-- == Valid Usage
--
-- -   #VUID-vkCmdBindDescriptorSets2-commandBuffer-11295# If
--     @commandBuffer@ is a secondary command buffer, it /must/ have begun
--     with
--     'Vulkan.Extensions.VK_EXT_descriptor_heap.CommandBufferInheritanceDescriptorHeapInfoEXT'::@pSamplerHeapBindInfo@
--     equal to @NULL@
--
-- -   #VUID-vkCmdBindDescriptorSets2-commandBuffer-11296# If
--     @commandBuffer@ is a secondary command buffer, it /must/ have begun
--     with
--     'Vulkan.Extensions.VK_EXT_descriptor_heap.CommandBufferInheritanceDescriptorHeapInfoEXT'::@pResourceHeapBindInfo@
--     equal to @NULL@
--
-- -   #VUID-vkCmdBindDescriptorSets2-pBindDescriptorSetsInfo-09467# Each
--     bit in @pBindDescriptorSetsInfo->stageFlags@ /must/ be a stage
--     supported by the @commandBuffer@’s parent
--     'Vulkan.Core10.Handles.CommandPool'’s queue family
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdBindDescriptorSets2-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdBindDescriptorSets2-pBindDescriptorSetsInfo-parameter#
--     @pBindDescriptorSetsInfo@ /must/ be a valid pointer to a valid
--     'BindDescriptorSetsInfo' structure
--
-- -   #VUID-vkCmdBindDescriptorSets2-commandBuffer-recording#
--     @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdBindDescriptorSets2-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_COMPUTE_BIT', or
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT' operations
--
-- -   #VUID-vkCmdBindDescriptorSets2-videocoding# This command /must/ only
--     be called outside of a video coding scope
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Both                                                                                                                   | Outside                                                                                                                     | VK_QUEUE_COMPUTE_BIT                                                                                                  | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             | VK_QUEUE_GRAPHICS_BIT                                                                                                 |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- == Conditional Rendering
--
-- vkCmdBindDescriptorSets2 is not affected by
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#drawing-conditional-rendering conditional rendering>
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'BindDescriptorSetsInfo', 'Vulkan.Core10.Handles.CommandBuffer'
cmdBindDescriptorSets2 :: forall a io
                        . ( Extendss BindDescriptorSetsInfo a
                          , PokeChain a
                          , MonadIO io )
                       => -- | @commandBuffer@ is the command buffer that the descriptor sets will be
                          -- bound to.
                          CommandBuffer
                       -> -- | @pBindDescriptorSetsInfo@ is a pointer to a 'BindDescriptorSetsInfo'
                          -- structure.
                          (BindDescriptorSetsInfo a)
                       -> io ()
cmdBindDescriptorSets2 :: forall (a :: [*]) (io :: * -> *).
(Extendss BindDescriptorSetsInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> BindDescriptorSetsInfo a -> io ()
cmdBindDescriptorSets2 CommandBuffer
commandBuffer
                         BindDescriptorSetsInfo a
bindDescriptorSetsInfo = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdBindDescriptorSets2Ptr :: FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ())
vkCmdBindDescriptorSets2Ptr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ())
pVkCmdBindDescriptorSets2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ())
vkCmdBindDescriptorSets2Ptr FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdBindDescriptorSets2 is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdBindDescriptorSets2' :: Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ()
vkCmdBindDescriptorSets2' = FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ())
-> Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorSetsInfo)
-> IO ()
mkVkCmdBindDescriptorSets2 FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ())
vkCmdBindDescriptorSets2Ptr
  pBindDescriptorSetsInfo <- ((Ptr (BindDescriptorSetsInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (BindDescriptorSetsInfo a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (BindDescriptorSetsInfo a) -> IO ()) -> IO ())
 -> ContT () IO (Ptr (BindDescriptorSetsInfo a)))
-> ((Ptr (BindDescriptorSetsInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (BindDescriptorSetsInfo a))
forall a b. (a -> b) -> a -> b
$ BindDescriptorSetsInfo a
-> (Ptr (BindDescriptorSetsInfo a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
BindDescriptorSetsInfo a
-> (Ptr (BindDescriptorSetsInfo a) -> IO b) -> IO b
withCStruct (BindDescriptorSetsInfo a
bindDescriptorSetsInfo)
  lift $ traceAroundEvent "vkCmdBindDescriptorSets2" (vkCmdBindDescriptorSets2'
                                                        (commandBufferHandle (commandBuffer))
                                                        (forgetExtensions pBindDescriptorSetsInfo))
  pure $ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdPushConstants2
  :: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct PushConstantsInfo) -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct PushConstantsInfo) -> IO ()

-- | vkCmdPushConstants2 - Update the values of push constants
--
-- == Valid Usage
--
-- -   #VUID-vkCmdPushConstants2-commandBuffer-11295# If @commandBuffer@ is
--     a secondary command buffer, it /must/ have begun with
--     'Vulkan.Extensions.VK_EXT_descriptor_heap.CommandBufferInheritanceDescriptorHeapInfoEXT'::@pSamplerHeapBindInfo@
--     equal to @NULL@
--
-- -   #VUID-vkCmdPushConstants2-commandBuffer-11296# If @commandBuffer@ is
--     a secondary command buffer, it /must/ have begun with
--     'Vulkan.Extensions.VK_EXT_descriptor_heap.CommandBufferInheritanceDescriptorHeapInfoEXT'::@pResourceHeapBindInfo@
--     equal to @NULL@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdPushConstants2-commandBuffer-parameter# @commandBuffer@
--     /must/ be a valid 'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdPushConstants2-pPushConstantsInfo-parameter#
--     @pPushConstantsInfo@ /must/ be a valid pointer to a valid
--     'PushConstantsInfo' structure
--
-- -   #VUID-vkCmdPushConstants2-commandBuffer-recording# @commandBuffer@
--     /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdPushConstants2-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_COMPUTE_BIT', or
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT' operations
--
-- -   #VUID-vkCmdPushConstants2-videocoding# This command /must/ only be
--     called outside of a video coding scope
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Both                                                                                                                   | Outside                                                                                                                     | VK_QUEUE_COMPUTE_BIT                                                                                                  | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             | VK_QUEUE_GRAPHICS_BIT                                                                                                 |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- == Conditional Rendering
--
-- vkCmdPushConstants2 is not affected by
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#drawing-conditional-rendering conditional rendering>
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.Handles.CommandBuffer', 'PushConstantsInfo'
cmdPushConstants2 :: forall a io
                   . (Extendss PushConstantsInfo a, PokeChain a, MonadIO io)
                  => -- | @commandBuffer@ is the command buffer in which the push constant update
                     -- will be recorded.
                     CommandBuffer
                  -> -- | @pPushConstantsInfo@ is a pointer to a 'PushConstantsInfo' structure.
                     (PushConstantsInfo a)
                  -> io ()
cmdPushConstants2 :: forall (a :: [*]) (io :: * -> *).
(Extendss PushConstantsInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> PushConstantsInfo a -> io ()
cmdPushConstants2 CommandBuffer
commandBuffer PushConstantsInfo a
pushConstantsInfo = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdPushConstants2Ptr :: FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushConstantsInfo) -> IO ())
vkCmdPushConstants2Ptr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct PushConstantsInfo) -> IO ())
pVkCmdPushConstants2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushConstantsInfo) -> IO ())
vkCmdPushConstants2Ptr FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushConstantsInfo) -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct PushConstantsInfo) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushConstantsInfo) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdPushConstants2 is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdPushConstants2' :: Ptr CommandBuffer_T -> Ptr (SomeStruct PushConstantsInfo) -> IO ()
vkCmdPushConstants2' = FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushConstantsInfo) -> IO ())
-> Ptr CommandBuffer_T
-> Ptr (SomeStruct PushConstantsInfo)
-> IO ()
mkVkCmdPushConstants2 FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushConstantsInfo) -> IO ())
vkCmdPushConstants2Ptr
  pPushConstantsInfo <- ((Ptr (PushConstantsInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushConstantsInfo a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (PushConstantsInfo a) -> IO ()) -> IO ())
 -> ContT () IO (Ptr (PushConstantsInfo a)))
-> ((Ptr (PushConstantsInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushConstantsInfo a))
forall a b. (a -> b) -> a -> b
$ PushConstantsInfo a
-> (Ptr (PushConstantsInfo a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PushConstantsInfo a -> (Ptr (PushConstantsInfo a) -> IO b) -> IO b
withCStruct (PushConstantsInfo a
pushConstantsInfo)
  lift $ traceAroundEvent "vkCmdPushConstants2" (vkCmdPushConstants2'
                                                   (commandBufferHandle (commandBuffer))
                                                   (forgetExtensions pPushConstantsInfo))
  pure $ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdPushDescriptorSet2
  :: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ()

-- | vkCmdPushDescriptorSet2 - Pushes descriptor updates into a command
-- buffer
--
-- == Valid Usage
--
-- -   #VUID-vkCmdPushDescriptorSet2-commandBuffer-11295# If
--     @commandBuffer@ is a secondary command buffer, it /must/ have begun
--     with
--     'Vulkan.Extensions.VK_EXT_descriptor_heap.CommandBufferInheritanceDescriptorHeapInfoEXT'::@pSamplerHeapBindInfo@
--     equal to @NULL@
--
-- -   #VUID-vkCmdPushDescriptorSet2-commandBuffer-11296# If
--     @commandBuffer@ is a secondary command buffer, it /must/ have begun
--     with
--     'Vulkan.Extensions.VK_EXT_descriptor_heap.CommandBufferInheritanceDescriptorHeapInfoEXT'::@pResourceHeapBindInfo@
--     equal to @NULL@
--
-- -   #VUID-vkCmdPushDescriptorSet2-pPushDescriptorSetInfo-09468# Each bit
--     in @pPushDescriptorSetInfo->stageFlags@ /must/ be a stage supported
--     by the @commandBuffer@’s parent
--     'Vulkan.Core10.Handles.CommandPool'’s queue family
--
-- -   #VUID-vkCmdPushDescriptorSet2-None-10357# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_push_descriptor VK_KHR_push_descriptor>
--     extension is not enabled,
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-pushDescriptor pushDescriptor>
--     /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdPushDescriptorSet2-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdPushDescriptorSet2-pPushDescriptorSetInfo-parameter#
--     @pPushDescriptorSetInfo@ /must/ be a valid pointer to a valid
--     'PushDescriptorSetInfo' structure
--
-- -   #VUID-vkCmdPushDescriptorSet2-commandBuffer-recording#
--     @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdPushDescriptorSet2-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_COMPUTE_BIT', or
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT' operations
--
-- -   #VUID-vkCmdPushDescriptorSet2-videocoding# This command /must/ only
--     be called outside of a video coding scope
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Both                                                                                                                   | Outside                                                                                                                     | VK_QUEUE_COMPUTE_BIT                                                                                                  | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             | VK_QUEUE_GRAPHICS_BIT                                                                                                 |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- == Conditional Rendering
--
-- vkCmdPushDescriptorSet2 is not affected by
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#drawing-conditional-rendering conditional rendering>
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_push_descriptor VK_KHR_push_descriptor>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.Handles.CommandBuffer', 'PushDescriptorSetInfo'
cmdPushDescriptorSet2 :: forall a io
                       . ( Extendss PushDescriptorSetInfo a
                         , PokeChain a
                         , MonadIO io )
                      => -- | @commandBuffer@ is the command buffer that the descriptors will be
                         -- recorded in.
                         CommandBuffer
                      -> -- | @pPushDescriptorSetInfo@ is a pointer to a 'PushDescriptorSetInfo'
                         -- structure.
                         (PushDescriptorSetInfo a)
                      -> io ()
cmdPushDescriptorSet2 :: forall (a :: [*]) (io :: * -> *).
(Extendss PushDescriptorSetInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> PushDescriptorSetInfo a -> io ()
cmdPushDescriptorSet2 CommandBuffer
commandBuffer
                        PushDescriptorSetInfo a
pushDescriptorSetInfo = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdPushDescriptorSet2Ptr :: FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ())
vkCmdPushDescriptorSet2Ptr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ())
pVkCmdPushDescriptorSet2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ())
vkCmdPushDescriptorSet2Ptr FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdPushDescriptorSet2 is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdPushDescriptorSet2' :: Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ()
vkCmdPushDescriptorSet2' = FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ())
-> Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetInfo)
-> IO ()
mkVkCmdPushDescriptorSet2 FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ())
vkCmdPushDescriptorSet2Ptr
  pPushDescriptorSetInfo <- ((Ptr (PushDescriptorSetInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushDescriptorSetInfo a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (PushDescriptorSetInfo a) -> IO ()) -> IO ())
 -> ContT () IO (Ptr (PushDescriptorSetInfo a)))
-> ((Ptr (PushDescriptorSetInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushDescriptorSetInfo a))
forall a b. (a -> b) -> a -> b
$ PushDescriptorSetInfo a
-> (Ptr (PushDescriptorSetInfo a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PushDescriptorSetInfo a
-> (Ptr (PushDescriptorSetInfo a) -> IO b) -> IO b
withCStruct (PushDescriptorSetInfo a
pushDescriptorSetInfo)
  lift $ traceAroundEvent "vkCmdPushDescriptorSet2" (vkCmdPushDescriptorSet2'
                                                       (commandBufferHandle (commandBuffer))
                                                       (forgetExtensions pPushDescriptorSetInfo))
  pure $ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdPushDescriptorSetWithTemplate2
  :: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ()

-- | vkCmdPushDescriptorSetWithTemplate2 - Pushes descriptor updates into a
-- command buffer using a descriptor update template
--
-- == Valid Usage
--
-- -   #VUID-vkCmdPushDescriptorSetWithTemplate2-commandBuffer-11295# If
--     @commandBuffer@ is a secondary command buffer, it /must/ have begun
--     with
--     'Vulkan.Extensions.VK_EXT_descriptor_heap.CommandBufferInheritanceDescriptorHeapInfoEXT'::@pSamplerHeapBindInfo@
--     equal to @NULL@
--
-- -   #VUID-vkCmdPushDescriptorSetWithTemplate2-commandBuffer-11296# If
--     @commandBuffer@ is a secondary command buffer, it /must/ have begun
--     with
--     'Vulkan.Extensions.VK_EXT_descriptor_heap.CommandBufferInheritanceDescriptorHeapInfoEXT'::@pResourceHeapBindInfo@
--     equal to @NULL@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdPushDescriptorSetWithTemplate2-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdPushDescriptorSetWithTemplate2-pPushDescriptorSetWithTemplateInfo-parameter#
--     @pPushDescriptorSetWithTemplateInfo@ /must/ be a valid pointer to a
--     valid 'PushDescriptorSetWithTemplateInfo' structure
--
-- -   #VUID-vkCmdPushDescriptorSetWithTemplate2-commandBuffer-recording#
--     @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdPushDescriptorSetWithTemplate2-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_COMPUTE_BIT', or
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT' operations
--
-- -   #VUID-vkCmdPushDescriptorSetWithTemplate2-videocoding# This command
--     /must/ only be called outside of a video coding scope
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Both                                                                                                                   | Outside                                                                                                                     | VK_QUEUE_COMPUTE_BIT                                                                                                  | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             | VK_QUEUE_GRAPHICS_BIT                                                                                                 |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- == Conditional Rendering
--
-- vkCmdPushDescriptorSetWithTemplate2 is not affected by
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#drawing-conditional-rendering conditional rendering>
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_push_descriptor VK_KHR_push_descriptor>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.Handles.CommandBuffer',
-- 'PushDescriptorSetWithTemplateInfo'
cmdPushDescriptorSetWithTemplate2 :: forall a io
                                   . ( Extendss PushDescriptorSetWithTemplateInfo a
                                     , PokeChain a
                                     , MonadIO io )
                                  => -- | @commandBuffer@ is the command buffer that the descriptors will be
                                     -- recorded in.
                                     CommandBuffer
                                  -> -- | @pPushDescriptorSetWithTemplateInfo@ is a pointer to a
                                     -- 'PushDescriptorSetWithTemplateInfo' structure.
                                     (PushDescriptorSetWithTemplateInfo a)
                                  -> io ()
cmdPushDescriptorSetWithTemplate2 :: forall (a :: [*]) (io :: * -> *).
(Extendss PushDescriptorSetWithTemplateInfo a, PokeChain a,
 MonadIO io) =>
CommandBuffer -> PushDescriptorSetWithTemplateInfo a -> io ()
cmdPushDescriptorSetWithTemplate2 CommandBuffer
commandBuffer
                                    PushDescriptorSetWithTemplateInfo a
pushDescriptorSetWithTemplateInfo = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdPushDescriptorSetWithTemplate2Ptr :: FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ())
vkCmdPushDescriptorSetWithTemplate2Ptr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ())
pVkCmdPushDescriptorSetWithTemplate2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ())
vkCmdPushDescriptorSetWithTemplate2Ptr FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdPushDescriptorSetWithTemplate2 is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdPushDescriptorSetWithTemplate2' :: Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ()
vkCmdPushDescriptorSetWithTemplate2' = FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ())
-> Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo)
-> IO ()
mkVkCmdPushDescriptorSetWithTemplate2 FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ())
vkCmdPushDescriptorSetWithTemplate2Ptr
  pPushDescriptorSetWithTemplateInfo <- ((Ptr (PushDescriptorSetWithTemplateInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushDescriptorSetWithTemplateInfo a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (PushDescriptorSetWithTemplateInfo a) -> IO ()) -> IO ())
 -> ContT () IO (Ptr (PushDescriptorSetWithTemplateInfo a)))
-> ((Ptr (PushDescriptorSetWithTemplateInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushDescriptorSetWithTemplateInfo a))
forall a b. (a -> b) -> a -> b
$ PushDescriptorSetWithTemplateInfo a
-> (Ptr (PushDescriptorSetWithTemplateInfo a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PushDescriptorSetWithTemplateInfo a
-> (Ptr (PushDescriptorSetWithTemplateInfo a) -> IO b) -> IO b
withCStruct (PushDescriptorSetWithTemplateInfo a
pushDescriptorSetWithTemplateInfo)
  lift $ traceAroundEvent "vkCmdPushDescriptorSetWithTemplate2" (vkCmdPushDescriptorSetWithTemplate2'
                                                                   (commandBufferHandle (commandBuffer))
                                                                   (forgetExtensions pPushDescriptorSetWithTemplateInfo))
  pure $ ()


-- | VkPhysicalDeviceMaintenance6Features - Structure describing whether the
-- implementation supports maintenance6 functionality
--
-- = Members
--
-- This structure describes the following feature:
--
-- = Description
--
-- If the 'PhysicalDeviceMaintenance6Features' structure is included in the
-- @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2',
-- it is filled in to indicate whether each corresponding feature is
-- supported. If the application wishes to use a
-- 'Vulkan.Core10.Handles.Device' with any features described by
-- 'PhysicalDeviceMaintenance6Features', it /must/ add an instance of the
-- structure, with the desired feature members set to
-- 'Vulkan.Core10.FundamentalTypes.TRUE', to the @pNext@ chain of
-- 'Vulkan.Core10.Device.DeviceCreateInfo' when creating the
-- 'Vulkan.Core10.Handles.Device'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceMaintenance6Features = PhysicalDeviceMaintenance6Features
  { -- | #extension-features-maintenance6# @maintenance6@ indicates that the
    -- implementation supports the following:
    --
    -- -   'Vulkan.Core10.APIConstants.NULL_HANDLE' /can/ be used when binding
    --     an index buffer
    --
    -- -   'BindMemoryStatus' /can/ be included in the @pNext@ chain of the
    --     'Vulkan.Core11.Promoted_From_VK_KHR_bind_memory2.BindBufferMemoryInfo'
    --     and
    --     'Vulkan.Core11.Promoted_From_VK_KHR_bind_memory2.BindImageMemoryInfo'
    --     structures, enabling applications to retrieve
    --     'Vulkan.Core10.Enums.Result.Result' values for individual memory
    --     binding operations.
    --
    -- -   'PhysicalDeviceMaintenance6Properties'::@blockTexelViewCompatibleMultipleLayers@
    --     property to indicate that the implementation supports creating image
    --     views with
    --     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT'
    --     where the @layerCount@ member of @subresourceRange@ is greater than
    --     @1@.
    --
    -- -   'PhysicalDeviceMaintenance6Properties'::@maxCombinedImageSamplerDescriptorCount@
    --     property which indicates the maximum descriptor size required for
    --     any
    --     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion format that requires a sampler Y′CBCR conversion>
    --     supported by the implementation.
    --
    -- -   A
    --     'PhysicalDeviceMaintenance6Properties'::@fragmentShadingRateClampCombinerInputs@
    --     property which indicates whether the implementation clamps the
    --     inputs to fragment shading rate combiner operations.
    PhysicalDeviceMaintenance6Features -> Bool
maintenance6 :: Bool }
  deriving (Typeable, PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> Bool
(PhysicalDeviceMaintenance6Features
 -> PhysicalDeviceMaintenance6Features -> Bool)
-> (PhysicalDeviceMaintenance6Features
    -> PhysicalDeviceMaintenance6Features -> Bool)
-> Eq PhysicalDeviceMaintenance6Features
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> Bool
== :: PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> Bool
$c/= :: PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> Bool
/= :: PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceMaintenance6Features)
#endif
deriving instance Show PhysicalDeviceMaintenance6Features

instance ToCStruct PhysicalDeviceMaintenance6Features where
  withCStruct :: forall b.
PhysicalDeviceMaintenance6Features
-> (Ptr PhysicalDeviceMaintenance6Features -> IO b) -> IO b
withCStruct PhysicalDeviceMaintenance6Features
x Ptr PhysicalDeviceMaintenance6Features -> IO b
f = Int -> (Ptr PhysicalDeviceMaintenance6Features -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceMaintenance6Features -> IO b) -> IO b)
-> (Ptr PhysicalDeviceMaintenance6Features -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceMaintenance6Features
p -> Ptr PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> IO b -> IO b
forall b.
Ptr PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance6Features
p PhysicalDeviceMaintenance6Features
x (Ptr PhysicalDeviceMaintenance6Features -> IO b
f Ptr PhysicalDeviceMaintenance6Features
p)
  pokeCStruct :: forall b.
Ptr PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance6Features
p PhysicalDeviceMaintenance6Features{Bool
maintenance6 :: PhysicalDeviceMaintenance6Features -> Bool
maintenance6 :: Bool
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Features
p Ptr PhysicalDeviceMaintenance6Features -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Features
p Ptr PhysicalDeviceMaintenance6Features -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Features
p Ptr PhysicalDeviceMaintenance6Features -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
maintenance6))
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PhysicalDeviceMaintenance6Features -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceMaintenance6Features
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Features
p Ptr PhysicalDeviceMaintenance6Features -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Features
p Ptr PhysicalDeviceMaintenance6Features -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Features
p Ptr PhysicalDeviceMaintenance6Features -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct PhysicalDeviceMaintenance6Features where
  peekCStruct :: Ptr PhysicalDeviceMaintenance6Features
-> IO PhysicalDeviceMaintenance6Features
peekCStruct Ptr PhysicalDeviceMaintenance6Features
p = do
    maintenance6 <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceMaintenance6Features
p Ptr PhysicalDeviceMaintenance6Features -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    pure $ PhysicalDeviceMaintenance6Features
             (bool32ToBool maintenance6)

instance Storable PhysicalDeviceMaintenance6Features where
  sizeOf :: PhysicalDeviceMaintenance6Features -> Int
sizeOf ~PhysicalDeviceMaintenance6Features
_ = Int
24
  alignment :: PhysicalDeviceMaintenance6Features -> Int
alignment ~PhysicalDeviceMaintenance6Features
_ = Int
8
  peek :: Ptr PhysicalDeviceMaintenance6Features
-> IO PhysicalDeviceMaintenance6Features
peek = Ptr PhysicalDeviceMaintenance6Features
-> IO PhysicalDeviceMaintenance6Features
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> IO ()
poke Ptr PhysicalDeviceMaintenance6Features
ptr PhysicalDeviceMaintenance6Features
poked = Ptr PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> IO () -> IO ()
forall b.
Ptr PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance6Features
ptr PhysicalDeviceMaintenance6Features
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero PhysicalDeviceMaintenance6Features where
  zero :: PhysicalDeviceMaintenance6Features
zero = Bool -> PhysicalDeviceMaintenance6Features
PhysicalDeviceMaintenance6Features
           Bool
forall a. Zero a => a
zero


-- | VkPhysicalDeviceMaintenance6Properties - Structure describing various
-- implementation-defined properties introduced with VK_KHR_maintenance6
--
-- = Description
--
-- If the 'PhysicalDeviceMaintenance6Properties' structure is included in
-- the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceProperties2',
-- it is filled in with each corresponding implementation-dependent
-- property.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceMaintenance6Properties = PhysicalDeviceMaintenance6Properties
  { -- | @blockTexelViewCompatibleMultipleLayers@ is a boolean value indicating
    -- that an implementation supports creating image views with
    -- 'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT'
    -- where the @layerCount@ member of @subresourceRange@ is greater than @1@.
    PhysicalDeviceMaintenance6Properties -> Bool
blockTexelViewCompatibleMultipleLayers :: Bool
  , -- | @maxCombinedImageSamplerDescriptorCount@ is the maximum number of
    -- combined image sampler descriptors that the implementation uses to
    -- access any of the
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion formats that require a sampler Y′CBCR conversion>
    -- supported by the implementation.
    PhysicalDeviceMaintenance6Properties -> Word32
maxCombinedImageSamplerDescriptorCount :: Word32
  , -- | @fragmentShadingRateClampCombinerInputs@ is a boolean value indicating
    -- that an implementation clamps the inputs to
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#primsrast-fragment-shading-rate-combining combiner operations>.
    PhysicalDeviceMaintenance6Properties -> Bool
fragmentShadingRateClampCombinerInputs :: Bool
  }
  deriving (Typeable, PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> Bool
(PhysicalDeviceMaintenance6Properties
 -> PhysicalDeviceMaintenance6Properties -> Bool)
-> (PhysicalDeviceMaintenance6Properties
    -> PhysicalDeviceMaintenance6Properties -> Bool)
-> Eq PhysicalDeviceMaintenance6Properties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> Bool
== :: PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> Bool
$c/= :: PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> Bool
/= :: PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceMaintenance6Properties)
#endif
deriving instance Show PhysicalDeviceMaintenance6Properties

instance ToCStruct PhysicalDeviceMaintenance6Properties where
  withCStruct :: forall b.
PhysicalDeviceMaintenance6Properties
-> (Ptr PhysicalDeviceMaintenance6Properties -> IO b) -> IO b
withCStruct PhysicalDeviceMaintenance6Properties
x Ptr PhysicalDeviceMaintenance6Properties -> IO b
f = Int -> (Ptr PhysicalDeviceMaintenance6Properties -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr PhysicalDeviceMaintenance6Properties -> IO b) -> IO b)
-> (Ptr PhysicalDeviceMaintenance6Properties -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceMaintenance6Properties
p -> Ptr PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> IO b -> IO b
forall b.
Ptr PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance6Properties
p PhysicalDeviceMaintenance6Properties
x (Ptr PhysicalDeviceMaintenance6Properties -> IO b
f Ptr PhysicalDeviceMaintenance6Properties
p)
  pokeCStruct :: forall b.
Ptr PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance6Properties
p PhysicalDeviceMaintenance6Properties{Bool
Word32
blockTexelViewCompatibleMultipleLayers :: PhysicalDeviceMaintenance6Properties -> Bool
maxCombinedImageSamplerDescriptorCount :: PhysicalDeviceMaintenance6Properties -> Word32
fragmentShadingRateClampCombinerInputs :: PhysicalDeviceMaintenance6Properties -> Bool
blockTexelViewCompatibleMultipleLayers :: Bool
maxCombinedImageSamplerDescriptorCount :: Word32
fragmentShadingRateClampCombinerInputs :: Bool
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
blockTexelViewCompatibleMultipleLayers))
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (Word32
maxCombinedImageSamplerDescriptorCount)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentShadingRateClampCombinerInputs))
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PhysicalDeviceMaintenance6Properties -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceMaintenance6Properties
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct PhysicalDeviceMaintenance6Properties where
  peekCStruct :: Ptr PhysicalDeviceMaintenance6Properties
-> IO PhysicalDeviceMaintenance6Properties
peekCStruct Ptr PhysicalDeviceMaintenance6Properties
p = do
    blockTexelViewCompatibleMultipleLayers <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    maxCombinedImageSamplerDescriptorCount <- peek @Word32 ((p `plusPtr` 20 :: Ptr Word32))
    fragmentShadingRateClampCombinerInputs <- peek @Bool32 ((p `plusPtr` 24 :: Ptr Bool32))
    pure $ PhysicalDeviceMaintenance6Properties
             (bool32ToBool blockTexelViewCompatibleMultipleLayers)
             maxCombinedImageSamplerDescriptorCount
             (bool32ToBool fragmentShadingRateClampCombinerInputs)

instance Storable PhysicalDeviceMaintenance6Properties where
  sizeOf :: PhysicalDeviceMaintenance6Properties -> Int
sizeOf ~PhysicalDeviceMaintenance6Properties
_ = Int
32
  alignment :: PhysicalDeviceMaintenance6Properties -> Int
alignment ~PhysicalDeviceMaintenance6Properties
_ = Int
8
  peek :: Ptr PhysicalDeviceMaintenance6Properties
-> IO PhysicalDeviceMaintenance6Properties
peek = Ptr PhysicalDeviceMaintenance6Properties
-> IO PhysicalDeviceMaintenance6Properties
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> IO ()
poke Ptr PhysicalDeviceMaintenance6Properties
ptr PhysicalDeviceMaintenance6Properties
poked = Ptr PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> IO () -> IO ()
forall b.
Ptr PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance6Properties
ptr PhysicalDeviceMaintenance6Properties
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero PhysicalDeviceMaintenance6Properties where
  zero :: PhysicalDeviceMaintenance6Properties
zero = Bool -> Word32 -> Bool -> PhysicalDeviceMaintenance6Properties
PhysicalDeviceMaintenance6Properties
           Bool
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero


-- | VkBindMemoryStatus - Structure specifying where to return memory binding
-- status
--
-- = Description
--
-- If the @pNext@ chain of
-- 'Vulkan.Core11.Promoted_From_VK_KHR_bind_memory2.BindBufferMemoryInfo'
-- or 'Vulkan.Core11.Promoted_From_VK_KHR_bind_memory2.BindImageMemoryInfo'
-- includes a 'BindMemoryStatus' structure, then the
-- 'BindMemoryStatus'::@pResult@ will be populated with a value describing
-- the result of the corresponding memory binding operation.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.Enums.Result.Result',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data BindMemoryStatus = BindMemoryStatus
  { -- | @pResult@ is a pointer to a 'Vulkan.Core10.Enums.Result.Result' value.
    --
    -- #VUID-VkBindMemoryStatus-pResult-parameter# @pResult@ /must/ be a valid
    -- pointer to a 'Vulkan.Core10.Enums.Result.Result' value
    BindMemoryStatus -> Ptr Result
result :: Ptr Result }
  deriving (Typeable, BindMemoryStatus -> BindMemoryStatus -> Bool
(BindMemoryStatus -> BindMemoryStatus -> Bool)
-> (BindMemoryStatus -> BindMemoryStatus -> Bool)
-> Eq BindMemoryStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BindMemoryStatus -> BindMemoryStatus -> Bool
== :: BindMemoryStatus -> BindMemoryStatus -> Bool
$c/= :: BindMemoryStatus -> BindMemoryStatus -> Bool
/= :: BindMemoryStatus -> BindMemoryStatus -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BindMemoryStatus)
#endif
deriving instance Show BindMemoryStatus

instance ToCStruct BindMemoryStatus where
  withCStruct :: forall b.
BindMemoryStatus -> (Ptr BindMemoryStatus -> IO b) -> IO b
withCStruct BindMemoryStatus
x Ptr BindMemoryStatus -> IO b
f = Int -> (Ptr BindMemoryStatus -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr BindMemoryStatus -> IO b) -> IO b)
-> (Ptr BindMemoryStatus -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr BindMemoryStatus
p -> Ptr BindMemoryStatus -> BindMemoryStatus -> IO b -> IO b
forall b. Ptr BindMemoryStatus -> BindMemoryStatus -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindMemoryStatus
p BindMemoryStatus
x (Ptr BindMemoryStatus -> IO b
f Ptr BindMemoryStatus
p)
  pokeCStruct :: forall b. Ptr BindMemoryStatus -> BindMemoryStatus -> IO b -> IO b
pokeCStruct Ptr BindMemoryStatus
p BindMemoryStatus{Ptr Result
result :: BindMemoryStatus -> Ptr Result
result :: Ptr Result
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindMemoryStatus
p Ptr BindMemoryStatus -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_MEMORY_STATUS)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindMemoryStatus
p Ptr BindMemoryStatus -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr (Ptr Result) -> Ptr Result -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindMemoryStatus
p Ptr BindMemoryStatus -> Int -> Ptr (Ptr Result)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Result))) (Ptr Result
result)
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr BindMemoryStatus -> IO b -> IO b
pokeZeroCStruct Ptr BindMemoryStatus
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindMemoryStatus
p Ptr BindMemoryStatus -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_MEMORY_STATUS)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindMemoryStatus
p Ptr BindMemoryStatus -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr (Ptr Result) -> Ptr Result -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindMemoryStatus
p Ptr BindMemoryStatus -> Int -> Ptr (Ptr Result)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Result))) (Ptr Result
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct BindMemoryStatus where
  peekCStruct :: Ptr BindMemoryStatus -> IO BindMemoryStatus
peekCStruct Ptr BindMemoryStatus
p = do
    pResult <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Result) ((Ptr BindMemoryStatus
p Ptr BindMemoryStatus -> Int -> Ptr (Ptr Result)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Result)))
    pure $ BindMemoryStatus
             pResult

instance Storable BindMemoryStatus where
  sizeOf :: BindMemoryStatus -> Int
sizeOf ~BindMemoryStatus
_ = Int
24
  alignment :: BindMemoryStatus -> Int
alignment ~BindMemoryStatus
_ = Int
8
  peek :: Ptr BindMemoryStatus -> IO BindMemoryStatus
peek = Ptr BindMemoryStatus -> IO BindMemoryStatus
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr BindMemoryStatus -> BindMemoryStatus -> IO ()
poke Ptr BindMemoryStatus
ptr BindMemoryStatus
poked = Ptr BindMemoryStatus -> BindMemoryStatus -> IO () -> IO ()
forall b. Ptr BindMemoryStatus -> BindMemoryStatus -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindMemoryStatus
ptr BindMemoryStatus
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero BindMemoryStatus where
  zero :: BindMemoryStatus
zero = Ptr Result -> BindMemoryStatus
BindMemoryStatus
           Ptr Result
forall a. Zero a => a
zero


-- | VkBindDescriptorSetsInfo - Structure specifying a descriptor set binding
-- operation
--
-- = Description
--
-- If @stageFlags@ specifies a subset of all stages corresponding to one or
-- more pipeline bind points, the binding operation still affects all
-- stages corresponding to the given pipeline bind point(s) as if the
-- equivalent original version of this command had been called with the
-- same parameters. For example, specifying a @stageFlags@ value of
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.SHADER_STAGE_VERTEX_BIT' |
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.SHADER_STAGE_FRAGMENT_BIT' |
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.SHADER_STAGE_COMPUTE_BIT' is
-- equivalent to calling the original version of this command once with
-- 'Vulkan.Core10.Enums.PipelineBindPoint.PIPELINE_BIND_POINT_GRAPHICS' and
-- once with
-- 'Vulkan.Core10.Enums.PipelineBindPoint.PIPELINE_BIND_POINT_COMPUTE'.
--
-- == Valid Usage
--
-- -   #VUID-VkBindDescriptorSetsInfo-pDescriptorSets-00358# Each element
--     of @pDescriptorSets@ that is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE' /must/ have been allocated
--     with a 'Vulkan.Core10.Handles.DescriptorSetLayout' that matches (is
--     the same as, or identically defined as) the
--     'Vulkan.Core10.Handles.DescriptorSetLayout' at set /n/ in @layout@,
--     where /n/ is the sum of @firstSet@ and the index into
--     @pDescriptorSets@
--
-- -   #VUID-VkBindDescriptorSetsInfo-dynamicOffsetCount-00359#
--     @dynamicOffsetCount@ /must/ be equal to the total number of dynamic
--     descriptors in @pDescriptorSets@
--
-- -   #VUID-VkBindDescriptorSetsInfo-firstSet-00360# The sum of @firstSet@
--     and @descriptorSetCount@ /must/ be less than or equal to
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo'::@setLayoutCount@
--     provided when @layout@ was created
--
-- -   #VUID-VkBindDescriptorSetsInfo-pDynamicOffsets-01971# Each element
--     of @pDynamicOffsets@ which corresponds to a descriptor binding with
--     type
--     'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC'
--     /must/ be a multiple of
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@minUniformBufferOffsetAlignment@
--
-- -   #VUID-VkBindDescriptorSetsInfo-pDynamicOffsets-01972# Each element
--     of @pDynamicOffsets@ which corresponds to a descriptor binding with
--     type
--     'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC'
--     /must/ be a multiple of
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@minStorageBufferOffsetAlignment@
--
-- -   #VUID-VkBindDescriptorSetsInfo-pDescriptorSets-01979# For each
--     dynamic uniform or storage buffer binding in @pDescriptorSets@, the
--     sum of the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#dynamic-effective-offset effective offset>
--     and the range of the binding /must/ be less than or equal to the
--     size of the buffer
--
-- -   #VUID-VkBindDescriptorSetsInfo-pDescriptorSets-06715# For each
--     dynamic uniform or storage buffer binding in @pDescriptorSets@, if
--     the range was set with 'Vulkan.Core10.APIConstants.WHOLE_SIZE' then
--     @pDynamicOffsets@ which corresponds to the descriptor binding /must/
--     be 0
--
-- -   #VUID-VkBindDescriptorSetsInfo-pDescriptorSets-04616# Each element
--     of @pDescriptorSets@ /must/ not have been allocated from a
--     'Vulkan.Core10.Handles.DescriptorPool' with the
--     'Vulkan.Core10.Enums.DescriptorPoolCreateFlagBits.DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT'
--     flag set
--
-- -   #VUID-VkBindDescriptorSetsInfo-pDescriptorSets-06563# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-graphicsPipelineLibrary graphicsPipelineLibrary>
--     feature is not enabled, each element of @pDescriptorSets@ /must/ be
--     a valid 'Vulkan.Core10.Handles.DescriptorSet'
--
-- -   #VUID-VkBindDescriptorSetsInfo-pDescriptorSets-08010# Each element
--     of @pDescriptorSets@ /must/ have been allocated with a
--     'Vulkan.Core10.Handles.DescriptorSetLayout' which was not created
--     with
--     'Vulkan.Core10.Enums.DescriptorSetLayoutCreateFlagBits.DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT'
--
-- -   #VUID-VkBindDescriptorSetsInfo-pDescriptorSets-09914# If any element
--     of @pDescriptorSets@ was allocated from a descriptor pool created
--     with a 'Vulkan.Core10.DescriptorSet.DescriptorPoolCreateInfo'
--     structure that had a
--     'Vulkan.Extensions.VK_ARM_data_graph.DataGraphProcessingEngineCreateInfoARM'
--     structure specifying foreign data processing engines in its @pNext@
--     chain, then the command pool from which @commandBuffer@ was
--     allocated /must/ have been created with a
--     'Vulkan.Core10.CommandPool.CommandPoolCreateInfo' structure that had
--     a
--     'Vulkan.Extensions.VK_ARM_data_graph.DataGraphProcessingEngineCreateInfoARM'
--     structure in its @pNext@ chain specifying a superset of all the
--     foreign data processing engines specified when creating the
--     descriptor pools from which the elements of @pDescriptorSets@ were
--     allocated
--
-- -   #VUID-VkBindDescriptorSetsInfo-pDescriptorSets-09915# If none of the
--     elements of @pDescriptorSets@ were allocated from a descriptor pool
--     created with a
--     'Vulkan.Core10.DescriptorSet.DescriptorPoolCreateInfo' structure
--     that had a
--     'Vulkan.Extensions.VK_ARM_data_graph.DataGraphProcessingEngineCreateInfoARM'
--     structure specifying foreign data processing engines in its @pNext@
--     chain, then the command pool from which @commandBuffer@ was
--     allocated /must/ not have been created with a
--     'Vulkan.Core10.CommandPool.CommandPoolCreateInfo' structure that had
--     a
--     'Vulkan.Extensions.VK_ARM_data_graph.DataGraphProcessingEngineCreateInfoARM'
--     structure in its @pNext@ chain
--
-- -   #VUID-VkBindDescriptorSetsInfo-None-09495# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-dynamicPipelineLayout dynamicPipelineLayout>
--     feature is not enabled, @layout@ /must/ be a valid
--     'Vulkan.Core10.Handles.PipelineLayout' handle
--
-- -   #VUID-VkBindDescriptorSetsInfo-layout-09496# If @layout@ is
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', the @pNext@ chain /must/
--     include a valid
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo' structure
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkBindDescriptorSetsInfo-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO'
--
-- -   #VUID-VkBindDescriptorSetsInfo-pNext-pNext# @pNext@ /must/ be @NULL@
--     or a pointer to a valid instance of
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo'
--
-- -   #VUID-VkBindDescriptorSetsInfo-sType-unique# The @sType@ value of
--     each structure in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkBindDescriptorSetsInfo-stageFlags-parameter# @stageFlags@
--     /must/ be a valid combination of
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlagBits' values
--
-- -   #VUID-VkBindDescriptorSetsInfo-stageFlags-requiredbitmask#
--     @stageFlags@ /must/ not be @0@
--
-- -   #VUID-VkBindDescriptorSetsInfo-layout-parameter# If @layout@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @layout@ /must/ be a valid
--     'Vulkan.Core10.Handles.PipelineLayout' handle
--
-- -   #VUID-VkBindDescriptorSetsInfo-pDescriptorSets-parameter#
--     @pDescriptorSets@ /must/ be a valid pointer to an array of
--     @descriptorSetCount@ valid 'Vulkan.Core10.Handles.DescriptorSet'
--     handles
--
-- -   #VUID-VkBindDescriptorSetsInfo-pDynamicOffsets-parameter# If
--     @dynamicOffsetCount@ is not @0@, and @pDynamicOffsets@ is not
--     @NULL@, @pDynamicOffsets@ /must/ be a valid pointer to an array of
--     @dynamicOffsetCount@ or 'Vulkan.Core10.APIConstants.NULL_HANDLE'
--     @uint32_t@ values
--
-- -   #VUID-VkBindDescriptorSetsInfo-descriptorSetCount-arraylength#
--     @descriptorSetCount@ /must/ be greater than @0@
--
-- -   #VUID-VkBindDescriptorSetsInfo-commonparent# Both of @layout@, and
--     the elements of @pDescriptorSets@ that are valid handles of
--     non-ignored parameters /must/ have been created, allocated, or
--     retrieved from the same 'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.Handles.DescriptorSet',
-- 'Vulkan.Core10.Handles.PipelineLayout',
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlags',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdBindDescriptorSets2', 'cmdBindDescriptorSets2'
data BindDescriptorSetsInfo (es :: [Type]) = BindDescriptorSetsInfo
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). BindDescriptorSetsInfo es -> Chain es
next :: Chain es
  , -- | @stageFlags@ is a bitmask of
    -- 'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlagBits' specifying
    -- the shader stages the descriptor sets will be bound to.
    forall (es :: [*]). BindDescriptorSetsInfo es -> ShaderStageFlags
stageFlags :: ShaderStageFlags
  , -- | @layout@ is a 'Vulkan.Core10.Handles.PipelineLayout' object used to
    -- program the bindings. If the
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-dynamicPipelineLayout dynamicPipelineLayout>
    -- feature is enabled, @layout@ /can/ be
    -- 'Vulkan.Core10.APIConstants.NULL_HANDLE' and the layout /must/ be
    -- specified by chaining the
    -- 'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo' structure off
    -- the @pNext@
    forall (es :: [*]). BindDescriptorSetsInfo es -> PipelineLayout
layout :: PipelineLayout
  , -- | @firstSet@ is the set number of the first descriptor set to be bound.
    forall (es :: [*]). BindDescriptorSetsInfo es -> Word32
firstSet :: Word32
  , -- | @pDescriptorSets@ is a pointer to an array of handles to
    -- 'Vulkan.Core10.Handles.DescriptorSet' objects describing the descriptor
    -- sets to bind to.
    forall (es :: [*]).
BindDescriptorSetsInfo es -> Vector DescriptorSet
descriptorSets :: Vector DescriptorSet
  , -- | @dynamicOffsetCount@ is the number of dynamic offsets in the
    -- @pDynamicOffsets@ array.
    forall (es :: [*]). BindDescriptorSetsInfo es -> Word32
dynamicOffsetCount :: Word32
  , -- | @pDynamicOffsets@ is a pointer to an array of @uint32_t@ values
    -- specifying dynamic offsets.
    forall (es :: [*]). BindDescriptorSetsInfo es -> Vector Word32
dynamicOffsets :: Vector Word32
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BindDescriptorSetsInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (BindDescriptorSetsInfo es)

instance Extensible BindDescriptorSetsInfo where
  extensibleTypeName :: String
extensibleTypeName = String
"BindDescriptorSetsInfo"
  setNext :: forall (ds :: [*]) (es :: [*]).
BindDescriptorSetsInfo ds -> Chain es -> BindDescriptorSetsInfo es
setNext BindDescriptorSetsInfo{Word32
Vector Word32
Vector DescriptorSet
ShaderStageFlags
PipelineLayout
Chain ds
next :: forall (es :: [*]). BindDescriptorSetsInfo es -> Chain es
stageFlags :: forall (es :: [*]). BindDescriptorSetsInfo es -> ShaderStageFlags
layout :: forall (es :: [*]). BindDescriptorSetsInfo es -> PipelineLayout
firstSet :: forall (es :: [*]). BindDescriptorSetsInfo es -> Word32
descriptorSets :: forall (es :: [*]).
BindDescriptorSetsInfo es -> Vector DescriptorSet
dynamicOffsetCount :: forall (es :: [*]). BindDescriptorSetsInfo es -> Word32
dynamicOffsets :: forall (es :: [*]). BindDescriptorSetsInfo es -> Vector Word32
next :: Chain ds
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
firstSet :: Word32
descriptorSets :: Vector DescriptorSet
dynamicOffsetCount :: Word32
dynamicOffsets :: Vector Word32
..} Chain es
next' = BindDescriptorSetsInfo{next :: Chain es
next = Chain es
next', Word32
Vector Word32
Vector DescriptorSet
ShaderStageFlags
PipelineLayout
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
firstSet :: Word32
descriptorSets :: Vector DescriptorSet
dynamicOffsetCount :: Word32
dynamicOffsets :: Vector Word32
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
firstSet :: Word32
descriptorSets :: Vector DescriptorSet
dynamicOffsetCount :: Word32
dynamicOffsets :: Vector Word32
..}
  getNext :: forall (es :: [*]). BindDescriptorSetsInfo es -> Chain es
getNext BindDescriptorSetsInfo{Word32
Vector Word32
Vector DescriptorSet
ShaderStageFlags
PipelineLayout
Chain es
next :: forall (es :: [*]). BindDescriptorSetsInfo es -> Chain es
stageFlags :: forall (es :: [*]). BindDescriptorSetsInfo es -> ShaderStageFlags
layout :: forall (es :: [*]). BindDescriptorSetsInfo es -> PipelineLayout
firstSet :: forall (es :: [*]). BindDescriptorSetsInfo es -> Word32
descriptorSets :: forall (es :: [*]).
BindDescriptorSetsInfo es -> Vector DescriptorSet
dynamicOffsetCount :: forall (es :: [*]). BindDescriptorSetsInfo es -> Word32
dynamicOffsets :: forall (es :: [*]). BindDescriptorSetsInfo es -> Vector Word32
next :: Chain es
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
firstSet :: Word32
descriptorSets :: Vector DescriptorSet
dynamicOffsetCount :: Word32
dynamicOffsets :: Vector Word32
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends BindDescriptorSetsInfo e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends BindDescriptorSetsInfo e => b) -> Maybe b
extends proxy e
_ Extends BindDescriptorSetsInfo e => b
f
    | Just e :~: PipelineLayoutCreateInfo
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @PipelineLayoutCreateInfo = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends BindDescriptorSetsInfo e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss BindDescriptorSetsInfo es
         , PokeChain es ) => ToCStruct (BindDescriptorSetsInfo es) where
  withCStruct :: forall b.
BindDescriptorSetsInfo es
-> (Ptr (BindDescriptorSetsInfo es) -> IO b) -> IO b
withCStruct BindDescriptorSetsInfo es
x Ptr (BindDescriptorSetsInfo es) -> IO b
f = Int -> (Ptr (BindDescriptorSetsInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
64 ((Ptr (BindDescriptorSetsInfo es) -> IO b) -> IO b)
-> (Ptr (BindDescriptorSetsInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (BindDescriptorSetsInfo es)
p -> Ptr (BindDescriptorSetsInfo es)
-> BindDescriptorSetsInfo es -> IO b -> IO b
forall b.
Ptr (BindDescriptorSetsInfo es)
-> BindDescriptorSetsInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (BindDescriptorSetsInfo es)
p BindDescriptorSetsInfo es
x (Ptr (BindDescriptorSetsInfo es) -> IO b
f Ptr (BindDescriptorSetsInfo es)
p)
  pokeCStruct :: forall b.
Ptr (BindDescriptorSetsInfo es)
-> BindDescriptorSetsInfo es -> IO b -> IO b
pokeCStruct Ptr (BindDescriptorSetsInfo es)
p BindDescriptorSetsInfo{Word32
Vector Word32
Vector DescriptorSet
ShaderStageFlags
PipelineLayout
Chain es
next :: forall (es :: [*]). BindDescriptorSetsInfo es -> Chain es
stageFlags :: forall (es :: [*]). BindDescriptorSetsInfo es -> ShaderStageFlags
layout :: forall (es :: [*]). BindDescriptorSetsInfo es -> PipelineLayout
firstSet :: forall (es :: [*]). BindDescriptorSetsInfo es -> Word32
descriptorSets :: forall (es :: [*]).
BindDescriptorSetsInfo es -> Vector DescriptorSet
dynamicOffsetCount :: forall (es :: [*]). BindDescriptorSetsInfo es -> Word32
dynamicOffsets :: forall (es :: [*]). BindDescriptorSetsInfo es -> Vector Word32
next :: Chain es
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
firstSet :: Word32
descriptorSets :: Vector DescriptorSet
dynamicOffsetCount :: Word32
dynamicOffsets :: Vector Word32
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorSetsInfo es)
p Ptr (BindDescriptorSetsInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO)
    pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
forall a. Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext''
    lift $ poke ((p `plusPtr` 16 :: Ptr ShaderStageFlags)) (stageFlags)
    lift $ poke ((p `plusPtr` 24 :: Ptr PipelineLayout)) (layout)
    lift $ poke ((p `plusPtr` 32 :: Ptr Word32)) (firstSet)
    lift $ poke ((p `plusPtr` 36 :: Ptr Word32)) ((fromIntegral (Data.Vector.length $ (descriptorSets)) :: Word32))
    pPDescriptorSets' <- ContT $ allocaBytes @DescriptorSet ((Data.Vector.length (descriptorSets)) * 8)
    lift $ Data.Vector.imapM_ (\Int
i DescriptorSet
e -> Ptr DescriptorSet -> DescriptorSet -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DescriptorSet
pPDescriptorSets' Ptr DescriptorSet -> Int -> Ptr DescriptorSet
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DescriptorSet) (DescriptorSet
e)) (descriptorSets)
    lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr DescriptorSet))) (pPDescriptorSets')
    let pDynamicOffsetsLength = Vector Word32 -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Word32 -> Int) -> Vector Word32 -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Word32
dynamicOffsets)
    dynamicOffsetCount'' <- lift $ if (dynamicOffsetCount) == 0
      then pure $ fromIntegral pDynamicOffsetsLength
      else do
        unless (fromIntegral pDynamicOffsetsLength == (dynamicOffsetCount) || pDynamicOffsetsLength == 0) $
          throwIO $ IOError Nothing InvalidArgument "" "pDynamicOffsets must be empty or have 'dynamicOffsetCount' elements" Nothing Nothing
        pure (dynamicOffsetCount)
    lift $ poke ((p `plusPtr` 48 :: Ptr Word32)) (dynamicOffsetCount'')
    pDynamicOffsets'' <- if Data.Vector.null (dynamicOffsets)
      then pure nullPtr
      else do
        pPDynamicOffsets <- ContT $ allocaBytes @Word32 (((Data.Vector.length (dynamicOffsets))) * 4)
        lift $ Data.Vector.imapM_ (\Int
i Word32
e -> Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word32
pPDynamicOffsets Ptr Word32 -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) (Word32
e)) ((dynamicOffsets))
        pure $ pPDynamicOffsets
    lift $ poke ((p `plusPtr` 56 :: Ptr (Ptr Word32))) pDynamicOffsets''
    lift $ f
  cStructSize :: Int
cStructSize = Int
64
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (BindDescriptorSetsInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (BindDescriptorSetsInfo es)
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorSetsInfo es)
p Ptr (BindDescriptorSetsInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO)
    pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext'
    lift $ poke ((p `plusPtr` 16 :: Ptr ShaderStageFlags)) (zero)
    lift $ f

instance ( Extendss BindDescriptorSetsInfo es
         , PeekChain es ) => FromCStruct (BindDescriptorSetsInfo es) where
  peekCStruct :: Ptr (BindDescriptorSetsInfo es) -> IO (BindDescriptorSetsInfo es)
peekCStruct Ptr (BindDescriptorSetsInfo es)
p = do
    pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (BindDescriptorSetsInfo es)
p Ptr (BindDescriptorSetsInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    next <- peekChain (castPtr pNext)
    stageFlags <- peek @ShaderStageFlags ((p `plusPtr` 16 :: Ptr ShaderStageFlags))
    layout <- peek @PipelineLayout ((p `plusPtr` 24 :: Ptr PipelineLayout))
    firstSet <- peek @Word32 ((p `plusPtr` 32 :: Ptr Word32))
    descriptorSetCount <- peek @Word32 ((p `plusPtr` 36 :: Ptr Word32))
    pDescriptorSets <- peek @(Ptr DescriptorSet) ((p `plusPtr` 40 :: Ptr (Ptr DescriptorSet)))
    pDescriptorSets' <- generateM (fromIntegral descriptorSetCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @DescriptorSet ((Ptr DescriptorSet
pDescriptorSets Ptr DescriptorSet -> Int -> Ptr DescriptorSet
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DescriptorSet)))
    dynamicOffsetCount <- peek @Word32 ((p `plusPtr` 48 :: Ptr Word32))
    pDynamicOffsets <- peek @(Ptr Word32) ((p `plusPtr` 56 :: Ptr (Ptr Word32)))
    let pDynamicOffsetsLength = if Ptr Word32
pDynamicOffsets Ptr Word32 -> Ptr Word32 -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Word32
forall a. Ptr a
nullPtr then Int
0 else (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
dynamicOffsetCount)
    pDynamicOffsets' <- generateM pDynamicOffsetsLength (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr Word32
pDynamicOffsets Ptr Word32 -> Int -> Ptr Word32
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
    pure $ BindDescriptorSetsInfo
             next
             stageFlags
             layout
             firstSet
             pDescriptorSets'
             dynamicOffsetCount
             pDynamicOffsets'

instance es ~ '[] => Zero (BindDescriptorSetsInfo es) where
  zero :: BindDescriptorSetsInfo es
zero = Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector DescriptorSet
-> Word32
-> Vector Word32
-> BindDescriptorSetsInfo es
forall (es :: [*]).
Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector DescriptorSet
-> Word32
-> Vector Word32
-> BindDescriptorSetsInfo es
BindDescriptorSetsInfo
           ()
           ShaderStageFlags
forall a. Zero a => a
zero
           PipelineLayout
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Vector DescriptorSet
forall a. Monoid a => a
mempty
           Word32
forall a. Zero a => a
zero
           Vector Word32
forall a. Monoid a => a
mempty


-- | VkPushConstantsInfo - Structure specifying a push constant update
-- operation
--
-- == Valid Usage
--
-- -   #VUID-VkPushConstantsInfo-offset-01795# For each byte in the range
--     specified by @offset@ and @size@ and for each shader stage in
--     @stageFlags@, there /must/ be a push constant range in @layout@ that
--     includes that byte and that stage
--
-- -   #VUID-VkPushConstantsInfo-offset-01796# For each byte in the range
--     specified by @offset@ and @size@ and for each push constant range
--     that overlaps that byte, @stageFlags@ /must/ include all stages in
--     that push constant range’s
--     'Vulkan.Core10.PipelineLayout.PushConstantRange'::@stageFlags@
--
-- -   #VUID-VkPushConstantsInfo-offset-00368# @offset@ /must/ be a
--     multiple of @4@
--
-- -   #VUID-VkPushConstantsInfo-size-00369# @size@ /must/ be a multiple of
--     @4@
--
-- -   #VUID-VkPushConstantsInfo-offset-00370# @offset@ /must/ be less than
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@maxPushConstantsSize@
--
-- -   #VUID-VkPushConstantsInfo-size-00371# @size@ /must/ be less than or
--     equal to
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@maxPushConstantsSize@
--     minus @offset@
--
-- -   #VUID-VkPushConstantsInfo-None-09495# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-dynamicPipelineLayout dynamicPipelineLayout>
--     feature is not enabled, @layout@ /must/ be a valid
--     'Vulkan.Core10.Handles.PipelineLayout' handle
--
-- -   #VUID-VkPushConstantsInfo-layout-09496# If @layout@ is
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', the @pNext@ chain /must/
--     include a valid
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo' structure
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkPushConstantsInfo-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PUSH_CONSTANTS_INFO'
--
-- -   #VUID-VkPushConstantsInfo-pNext-pNext# Each @pNext@ member of any
--     structure (including this one) in the @pNext@ chain /must/ be either
--     @NULL@ or a pointer to a valid instance of
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo' or
--     'Vulkan.Extensions.VK_NV_push_constant_bank.PushConstantBankInfoNV'
--
-- -   #VUID-VkPushConstantsInfo-sType-unique# The @sType@ value of each
--     structure in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkPushConstantsInfo-layout-parameter# If @layout@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @layout@ /must/ be a valid
--     'Vulkan.Core10.Handles.PipelineLayout' handle
--
-- -   #VUID-VkPushConstantsInfo-stageFlags-parameter# @stageFlags@ /must/
--     be a valid combination of
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlagBits' values
--
-- -   #VUID-VkPushConstantsInfo-stageFlags-requiredbitmask# @stageFlags@
--     /must/ not be @0@
--
-- -   #VUID-VkPushConstantsInfo-pValues-parameter# @pValues@ /must/ be a
--     valid pointer to an array of @size@ bytes
--
-- -   #VUID-VkPushConstantsInfo-size-arraylength# @size@ /must/ be greater
--     than @0@
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.Handles.PipelineLayout',
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlags',
-- 'Vulkan.Core10.Enums.StructureType.StructureType', 'cmdPushConstants2',
-- 'cmdPushConstants2'
data PushConstantsInfo (es :: [Type]) = PushConstantsInfo
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). PushConstantsInfo es -> Chain es
next :: Chain es
  , -- | @layout@ is the pipeline layout used to program the push constant
    -- updates. If the
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-dynamicPipelineLayout dynamicPipelineLayout>
    -- feature is enabled, @layout@ /can/ be
    -- 'Vulkan.Core10.APIConstants.NULL_HANDLE' and the layout /must/ be
    -- specified by chaining
    -- 'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo' structure off
    -- the @pNext@
    forall (es :: [*]). PushConstantsInfo es -> PipelineLayout
layout :: PipelineLayout
  , -- | @stageFlags@ is a bitmask of
    -- 'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlagBits' specifying
    -- the shader stages that will use the push constants in the updated range.
    forall (es :: [*]). PushConstantsInfo es -> ShaderStageFlags
stageFlags :: ShaderStageFlags
  , -- | @offset@ is the start offset of the push constant range to update, in
    -- units of bytes.
    forall (es :: [*]). PushConstantsInfo es -> Word32
offset :: Word32
  , -- | @size@ is the size of the push constant range to update, in units of
    -- bytes.
    forall (es :: [*]). PushConstantsInfo es -> Word32
size :: Word32
  , -- | @pValues@ is a pointer to an array of @size@ bytes containing the new
    -- push constant values.
    forall (es :: [*]). PushConstantsInfo es -> Ptr ()
values :: Ptr ()
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PushConstantsInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (PushConstantsInfo es)

instance Extensible PushConstantsInfo where
  extensibleTypeName :: String
extensibleTypeName = String
"PushConstantsInfo"
  setNext :: forall (ds :: [*]) (es :: [*]).
PushConstantsInfo ds -> Chain es -> PushConstantsInfo es
setNext PushConstantsInfo{Word32
Ptr ()
ShaderStageFlags
PipelineLayout
Chain ds
next :: forall (es :: [*]). PushConstantsInfo es -> Chain es
layout :: forall (es :: [*]). PushConstantsInfo es -> PipelineLayout
stageFlags :: forall (es :: [*]). PushConstantsInfo es -> ShaderStageFlags
offset :: forall (es :: [*]). PushConstantsInfo es -> Word32
size :: forall (es :: [*]). PushConstantsInfo es -> Word32
values :: forall (es :: [*]). PushConstantsInfo es -> Ptr ()
next :: Chain ds
layout :: PipelineLayout
stageFlags :: ShaderStageFlags
offset :: Word32
size :: Word32
values :: Ptr ()
..} Chain es
next' = PushConstantsInfo{next :: Chain es
next = Chain es
next', Word32
Ptr ()
ShaderStageFlags
PipelineLayout
layout :: PipelineLayout
stageFlags :: ShaderStageFlags
offset :: Word32
size :: Word32
values :: Ptr ()
layout :: PipelineLayout
stageFlags :: ShaderStageFlags
offset :: Word32
size :: Word32
values :: Ptr ()
..}
  getNext :: forall (es :: [*]). PushConstantsInfo es -> Chain es
getNext PushConstantsInfo{Word32
Ptr ()
ShaderStageFlags
PipelineLayout
Chain es
next :: forall (es :: [*]). PushConstantsInfo es -> Chain es
layout :: forall (es :: [*]). PushConstantsInfo es -> PipelineLayout
stageFlags :: forall (es :: [*]). PushConstantsInfo es -> ShaderStageFlags
offset :: forall (es :: [*]). PushConstantsInfo es -> Word32
size :: forall (es :: [*]). PushConstantsInfo es -> Word32
values :: forall (es :: [*]). PushConstantsInfo es -> Ptr ()
next :: Chain es
layout :: PipelineLayout
stageFlags :: ShaderStageFlags
offset :: Word32
size :: Word32
values :: Ptr ()
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends PushConstantsInfo e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends PushConstantsInfo e => b) -> Maybe b
extends proxy e
_ Extends PushConstantsInfo e => b
f
    | Just e :~: PushConstantBankInfoNV
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @PushConstantBankInfoNV = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PushConstantsInfo e => b
f
    | Just e :~: PipelineLayoutCreateInfo
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @PipelineLayoutCreateInfo = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PushConstantsInfo e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss PushConstantsInfo es
         , PokeChain es ) => ToCStruct (PushConstantsInfo es) where
  withCStruct :: forall b.
PushConstantsInfo es
-> (Ptr (PushConstantsInfo es) -> IO b) -> IO b
withCStruct PushConstantsInfo es
x Ptr (PushConstantsInfo es) -> IO b
f = Int -> (Ptr (PushConstantsInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr (PushConstantsInfo es) -> IO b) -> IO b)
-> (Ptr (PushConstantsInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (PushConstantsInfo es)
p -> Ptr (PushConstantsInfo es) -> PushConstantsInfo es -> IO b -> IO b
forall b.
Ptr (PushConstantsInfo es) -> PushConstantsInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (PushConstantsInfo es)
p PushConstantsInfo es
x (Ptr (PushConstantsInfo es) -> IO b
f Ptr (PushConstantsInfo es)
p)
  pokeCStruct :: forall b.
Ptr (PushConstantsInfo es) -> PushConstantsInfo es -> IO b -> IO b
pokeCStruct Ptr (PushConstantsInfo es)
p PushConstantsInfo{Word32
Ptr ()
ShaderStageFlags
PipelineLayout
Chain es
next :: forall (es :: [*]). PushConstantsInfo es -> Chain es
layout :: forall (es :: [*]). PushConstantsInfo es -> PipelineLayout
stageFlags :: forall (es :: [*]). PushConstantsInfo es -> ShaderStageFlags
offset :: forall (es :: [*]). PushConstantsInfo es -> Word32
size :: forall (es :: [*]). PushConstantsInfo es -> Word32
values :: forall (es :: [*]). PushConstantsInfo es -> Ptr ()
next :: Chain es
layout :: PipelineLayout
stageFlags :: ShaderStageFlags
offset :: Word32
size :: Word32
values :: Ptr ()
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushConstantsInfo es)
p Ptr (PushConstantsInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PUSH_CONSTANTS_INFO)
    pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
forall a. Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext''
    lift $ poke ((p `plusPtr` 16 :: Ptr PipelineLayout)) (layout)
    lift $ poke ((p `plusPtr` 24 :: Ptr ShaderStageFlags)) (stageFlags)
    lift $ poke ((p `plusPtr` 28 :: Ptr Word32)) (offset)
    lift $ poke ((p `plusPtr` 32 :: Ptr Word32)) (size)
    lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr ()))) (values)
    lift $ f
  cStructSize :: Int
cStructSize = Int
48
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (PushConstantsInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PushConstantsInfo es)
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushConstantsInfo es)
p Ptr (PushConstantsInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PUSH_CONSTANTS_INFO)
    pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext'
    lift $ poke ((p `plusPtr` 24 :: Ptr ShaderStageFlags)) (zero)
    lift $ poke ((p `plusPtr` 32 :: Ptr Word32)) (zero)
    lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr ()))) (zero)
    lift $ f

instance ( Extendss PushConstantsInfo es
         , PeekChain es ) => FromCStruct (PushConstantsInfo es) where
  peekCStruct :: Ptr (PushConstantsInfo es) -> IO (PushConstantsInfo es)
peekCStruct Ptr (PushConstantsInfo es)
p = do
    pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PushConstantsInfo es)
p Ptr (PushConstantsInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    next <- peekChain (castPtr pNext)
    layout <- peek @PipelineLayout ((p `plusPtr` 16 :: Ptr PipelineLayout))
    stageFlags <- peek @ShaderStageFlags ((p `plusPtr` 24 :: Ptr ShaderStageFlags))
    offset <- peek @Word32 ((p `plusPtr` 28 :: Ptr Word32))
    size <- peek @Word32 ((p `plusPtr` 32 :: Ptr Word32))
    pValues <- peek @(Ptr ()) ((p `plusPtr` 40 :: Ptr (Ptr ())))
    pure $ PushConstantsInfo
             next layout stageFlags offset size pValues

instance es ~ '[] => Zero (PushConstantsInfo es) where
  zero :: PushConstantsInfo es
zero = Chain es
-> PipelineLayout
-> ShaderStageFlags
-> Word32
-> Word32
-> Ptr ()
-> PushConstantsInfo es
forall (es :: [*]).
Chain es
-> PipelineLayout
-> ShaderStageFlags
-> Word32
-> Word32
-> Ptr ()
-> PushConstantsInfo es
PushConstantsInfo
           ()
           PipelineLayout
forall a. Zero a => a
zero
           ShaderStageFlags
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Ptr ()
forall a. Zero a => a
zero


-- | VkPushDescriptorSetInfo - Structure specifying a descriptor set push
-- operation
--
-- = Description
--
-- If @stageFlags@ specifies a subset of all stages corresponding to one or
-- more pipeline bind points, the binding operation still affects all
-- stages corresponding to the given pipeline bind point(s) as if the
-- equivalent original version of this command had been called with the
-- same parameters. For example, specifying a @stageFlags@ value of
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.SHADER_STAGE_VERTEX_BIT' |
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.SHADER_STAGE_FRAGMENT_BIT' |
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.SHADER_STAGE_COMPUTE_BIT' is
-- equivalent to calling the original version of this command once with
-- 'Vulkan.Core10.Enums.PipelineBindPoint.PIPELINE_BIND_POINT_GRAPHICS' and
-- once with
-- 'Vulkan.Core10.Enums.PipelineBindPoint.PIPELINE_BIND_POINT_COMPUTE'.
--
-- == Valid Usage
--
-- -   #VUID-VkPushDescriptorSetInfo-set-00364# @set@ /must/ be less than
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo'::@setLayoutCount@
--     provided when @layout@ was created
--
-- -   #VUID-VkPushDescriptorSetInfo-set-00365# @set@ /must/ be the unique
--     set number in the pipeline layout that uses a descriptor set layout
--     that was created with
--     'Vulkan.Core10.Enums.DescriptorSetLayoutCreateFlagBits.DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT'
--
-- -   #VUID-VkPushDescriptorSetInfo-pDescriptorWrites-06494# For each
--     element i where @pDescriptorWrites@[i].@descriptorType@ is
--     'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_SAMPLER',
--     'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER',
--     'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_SAMPLED_IMAGE',
--     'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_STORAGE_IMAGE',
--     or
--     'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_INPUT_ATTACHMENT',
--     @pDescriptorWrites@[i].@pImageInfo@ /must/ be a valid pointer to an
--     array of @pDescriptorWrites@[i].@descriptorCount@ valid
--     'Vulkan.Core10.DescriptorSet.DescriptorImageInfo' structures
--
-- -   #VUID-VkPushDescriptorSetInfo-None-09495# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-dynamicPipelineLayout dynamicPipelineLayout>
--     feature is not enabled, @layout@ /must/ be a valid
--     'Vulkan.Core10.Handles.PipelineLayout' handle
--
-- -   #VUID-VkPushDescriptorSetInfo-layout-09496# If @layout@ is
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', the @pNext@ chain /must/
--     include a valid
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo' structure
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkPushDescriptorSetInfo-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO'
--
-- -   #VUID-VkPushDescriptorSetInfo-pNext-pNext# @pNext@ /must/ be @NULL@
--     or a pointer to a valid instance of
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo'
--
-- -   #VUID-VkPushDescriptorSetInfo-sType-unique# The @sType@ value of
--     each structure in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkPushDescriptorSetInfo-stageFlags-parameter# @stageFlags@
--     /must/ be a valid combination of
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlagBits' values
--
-- -   #VUID-VkPushDescriptorSetInfo-stageFlags-requiredbitmask#
--     @stageFlags@ /must/ not be @0@
--
-- -   #VUID-VkPushDescriptorSetInfo-layout-parameter# If @layout@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @layout@ /must/ be a valid
--     'Vulkan.Core10.Handles.PipelineLayout' handle
--
-- -   #VUID-VkPushDescriptorSetInfo-pDescriptorWrites-parameter#
--     @pDescriptorWrites@ /must/ be a valid pointer to an array of
--     @descriptorWriteCount@ valid
--     'Vulkan.Core10.DescriptorSet.WriteDescriptorSet' structures
--
-- -   #VUID-VkPushDescriptorSetInfo-descriptorWriteCount-arraylength#
--     @descriptorWriteCount@ /must/ be greater than @0@
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_push_descriptor VK_KHR_push_descriptor>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.Handles.PipelineLayout',
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlags',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Core10.DescriptorSet.WriteDescriptorSet',
-- 'cmdPushDescriptorSet2', 'cmdPushDescriptorSet2'
data PushDescriptorSetInfo (es :: [Type]) = PushDescriptorSetInfo
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). PushDescriptorSetInfo es -> Chain es
next :: Chain es
  , -- | @stageFlags@ is a bitmask of
    -- 'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlagBits' specifying
    -- the shader stages that will use the descriptors.
    forall (es :: [*]). PushDescriptorSetInfo es -> ShaderStageFlags
stageFlags :: ShaderStageFlags
  , -- | @layout@ is a 'Vulkan.Core10.Handles.PipelineLayout' object used to
    -- program the bindings. If the
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-dynamicPipelineLayout dynamicPipelineLayout>
    -- feature is enabled, @layout@ /can/ be
    -- 'Vulkan.Core10.APIConstants.NULL_HANDLE' and the layout /must/ be
    -- specified by chaining
    -- 'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo' structure off
    -- the @pNext@
    forall (es :: [*]). PushDescriptorSetInfo es -> PipelineLayout
layout :: PipelineLayout
  , -- | @set@ is the set number of the descriptor set in the pipeline layout
    -- that will be updated.
    forall (es :: [*]). PushDescriptorSetInfo es -> Word32
set :: Word32
  , -- | @pDescriptorWrites@ is a pointer to an array of
    -- 'Vulkan.Core10.DescriptorSet.WriteDescriptorSet' structures describing
    -- the descriptors to be updated.
    forall (es :: [*]).
PushDescriptorSetInfo es -> Vector (SomeStruct WriteDescriptorSet)
descriptorWrites :: Vector (SomeStruct WriteDescriptorSet)
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PushDescriptorSetInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (PushDescriptorSetInfo es)

instance Extensible PushDescriptorSetInfo where
  extensibleTypeName :: String
extensibleTypeName = String
"PushDescriptorSetInfo"
  setNext :: forall (ds :: [*]) (es :: [*]).
PushDescriptorSetInfo ds -> Chain es -> PushDescriptorSetInfo es
setNext PushDescriptorSetInfo{Word32
Vector (SomeStruct WriteDescriptorSet)
ShaderStageFlags
PipelineLayout
Chain ds
next :: forall (es :: [*]). PushDescriptorSetInfo es -> Chain es
stageFlags :: forall (es :: [*]). PushDescriptorSetInfo es -> ShaderStageFlags
layout :: forall (es :: [*]). PushDescriptorSetInfo es -> PipelineLayout
set :: forall (es :: [*]). PushDescriptorSetInfo es -> Word32
descriptorWrites :: forall (es :: [*]).
PushDescriptorSetInfo es -> Vector (SomeStruct WriteDescriptorSet)
next :: Chain ds
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
set :: Word32
descriptorWrites :: Vector (SomeStruct WriteDescriptorSet)
..} Chain es
next' = PushDescriptorSetInfo{next :: Chain es
next = Chain es
next', Word32
Vector (SomeStruct WriteDescriptorSet)
ShaderStageFlags
PipelineLayout
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
set :: Word32
descriptorWrites :: Vector (SomeStruct WriteDescriptorSet)
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
set :: Word32
descriptorWrites :: Vector (SomeStruct WriteDescriptorSet)
..}
  getNext :: forall (es :: [*]). PushDescriptorSetInfo es -> Chain es
getNext PushDescriptorSetInfo{Word32
Vector (SomeStruct WriteDescriptorSet)
ShaderStageFlags
PipelineLayout
Chain es
next :: forall (es :: [*]). PushDescriptorSetInfo es -> Chain es
stageFlags :: forall (es :: [*]). PushDescriptorSetInfo es -> ShaderStageFlags
layout :: forall (es :: [*]). PushDescriptorSetInfo es -> PipelineLayout
set :: forall (es :: [*]). PushDescriptorSetInfo es -> Word32
descriptorWrites :: forall (es :: [*]).
PushDescriptorSetInfo es -> Vector (SomeStruct WriteDescriptorSet)
next :: Chain es
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
set :: Word32
descriptorWrites :: Vector (SomeStruct WriteDescriptorSet)
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends PushDescriptorSetInfo e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends PushDescriptorSetInfo e => b) -> Maybe b
extends proxy e
_ Extends PushDescriptorSetInfo e => b
f
    | Just e :~: PipelineLayoutCreateInfo
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @PipelineLayoutCreateInfo = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PushDescriptorSetInfo e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss PushDescriptorSetInfo es
         , PokeChain es ) => ToCStruct (PushDescriptorSetInfo es) where
  withCStruct :: forall b.
PushDescriptorSetInfo es
-> (Ptr (PushDescriptorSetInfo es) -> IO b) -> IO b
withCStruct PushDescriptorSetInfo es
x Ptr (PushDescriptorSetInfo es) -> IO b
f = Int -> (Ptr (PushDescriptorSetInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr (PushDescriptorSetInfo es) -> IO b) -> IO b)
-> (Ptr (PushDescriptorSetInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (PushDescriptorSetInfo es)
p -> Ptr (PushDescriptorSetInfo es)
-> PushDescriptorSetInfo es -> IO b -> IO b
forall b.
Ptr (PushDescriptorSetInfo es)
-> PushDescriptorSetInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (PushDescriptorSetInfo es)
p PushDescriptorSetInfo es
x (Ptr (PushDescriptorSetInfo es) -> IO b
f Ptr (PushDescriptorSetInfo es)
p)
  pokeCStruct :: forall b.
Ptr (PushDescriptorSetInfo es)
-> PushDescriptorSetInfo es -> IO b -> IO b
pokeCStruct Ptr (PushDescriptorSetInfo es)
p PushDescriptorSetInfo{Word32
Vector (SomeStruct WriteDescriptorSet)
ShaderStageFlags
PipelineLayout
Chain es
next :: forall (es :: [*]). PushDescriptorSetInfo es -> Chain es
stageFlags :: forall (es :: [*]). PushDescriptorSetInfo es -> ShaderStageFlags
layout :: forall (es :: [*]). PushDescriptorSetInfo es -> PipelineLayout
set :: forall (es :: [*]). PushDescriptorSetInfo es -> Word32
descriptorWrites :: forall (es :: [*]).
PushDescriptorSetInfo es -> Vector (SomeStruct WriteDescriptorSet)
next :: Chain es
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
set :: Word32
descriptorWrites :: Vector (SomeStruct WriteDescriptorSet)
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetInfo es)
p Ptr (PushDescriptorSetInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO)
    pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
forall a. Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext''
    lift $ poke ((p `plusPtr` 16 :: Ptr ShaderStageFlags)) (stageFlags)
    lift $ poke ((p `plusPtr` 24 :: Ptr PipelineLayout)) (layout)
    lift $ poke ((p `plusPtr` 32 :: Ptr Word32)) (set)
    lift $ poke ((p `plusPtr` 36 :: Ptr Word32)) ((fromIntegral (Data.Vector.length $ (descriptorWrites)) :: Word32))
    pPDescriptorWrites' <- ContT $ allocaBytes @(WriteDescriptorSet _) ((Data.Vector.length (descriptorWrites)) * 64)
    Data.Vector.imapM_ (\Int
i SomeStruct WriteDescriptorSet
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (SomeStruct WriteDescriptorSet)
-> SomeStruct WriteDescriptorSet -> IO b -> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (WriteDescriptorSet (ZonkAny 1))
-> Ptr (SomeStruct WriteDescriptorSet)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (WriteDescriptorSet (ZonkAny 0))
pPDescriptorWrites' Ptr (WriteDescriptorSet (ZonkAny 0))
-> Int -> Ptr (WriteDescriptorSet w)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
64 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (WriteDescriptorSet _))) (SomeStruct WriteDescriptorSet
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) (descriptorWrites)
    lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr (WriteDescriptorSet _)))) (pPDescriptorWrites')
    lift $ f
  cStructSize :: Int
cStructSize = Int
48
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (PushDescriptorSetInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PushDescriptorSetInfo es)
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetInfo es)
p Ptr (PushDescriptorSetInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO)
    pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext'
    lift $ poke ((p `plusPtr` 16 :: Ptr ShaderStageFlags)) (zero)
    lift $ f

instance ( Extendss PushDescriptorSetInfo es
         , PeekChain es ) => FromCStruct (PushDescriptorSetInfo es) where
  peekCStruct :: Ptr (PushDescriptorSetInfo es) -> IO (PushDescriptorSetInfo es)
peekCStruct Ptr (PushDescriptorSetInfo es)
p = do
    pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PushDescriptorSetInfo es)
p Ptr (PushDescriptorSetInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    next <- peekChain (castPtr pNext)
    stageFlags <- peek @ShaderStageFlags ((p `plusPtr` 16 :: Ptr ShaderStageFlags))
    layout <- peek @PipelineLayout ((p `plusPtr` 24 :: Ptr PipelineLayout))
    set <- peek @Word32 ((p `plusPtr` 32 :: Ptr Word32))
    descriptorWriteCount <- peek @Word32 ((p `plusPtr` 36 :: Ptr Word32))
    pDescriptorWrites <- peek @(Ptr (WriteDescriptorSet _)) ((p `plusPtr` 40 :: Ptr (Ptr (WriteDescriptorSet _))))
    pDescriptorWrites' <- generateM (fromIntegral descriptorWriteCount) (\Int
i -> Ptr (SomeStruct WriteDescriptorSet)
-> IO (SomeStruct WriteDescriptorSet)
forall (a :: [*] -> *).
(Extensible a,
 forall (es :: [*]).
 (Extendss a es, PeekChain es) =>
 FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (WriteDescriptorSet (ZonkAny 2))
-> Ptr (SomeStruct WriteDescriptorSet)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (WriteDescriptorSet (ZonkAny 2))
pDescriptorWrites Ptr (WriteDescriptorSet (ZonkAny 2))
-> Int -> Ptr (WriteDescriptorSet (ZonkAny 2))
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
64 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (WriteDescriptorSet _)))))
    pure $ PushDescriptorSetInfo
             next stageFlags layout set pDescriptorWrites'

instance es ~ '[] => Zero (PushDescriptorSetInfo es) where
  zero :: PushDescriptorSetInfo es
zero = Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector (SomeStruct WriteDescriptorSet)
-> PushDescriptorSetInfo es
forall (es :: [*]).
Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector (SomeStruct WriteDescriptorSet)
-> PushDescriptorSetInfo es
PushDescriptorSetInfo
           ()
           ShaderStageFlags
forall a. Zero a => a
zero
           PipelineLayout
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Vector (SomeStruct WriteDescriptorSet)
forall a. Monoid a => a
mempty


-- | VkPushDescriptorSetWithTemplateInfo - Structure specifying a descriptor
-- set push operation using a descriptor update template
--
-- == Valid Usage
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-commandBuffer-00366# The
--     @pipelineBindPoint@ specified during the creation of the descriptor
--     update template /must/ be supported by the @commandBuffer@’s parent
--     'Vulkan.Core10.Handles.CommandPool'’s queue family
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-pData-01686# @pData@
--     /must/ be a valid pointer to a memory containing one or more valid
--     instances of 'Vulkan.Core10.DescriptorSet.DescriptorImageInfo',
--     'Vulkan.Core10.DescriptorSet.DescriptorBufferInfo', or
--     'Vulkan.Core10.Handles.BufferView' in a layout defined by
--     @descriptorUpdateTemplate@ when it was created with
--     'Vulkan.Core11.Promoted_From_VK_KHR_descriptor_update_template.createDescriptorUpdateTemplate'
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-layout-07993# @layout@
--     /must/ be compatible with the layout used to create
--     @descriptorUpdateTemplate@
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-descriptorUpdateTemplate-07994#
--     @descriptorUpdateTemplate@ /must/ have been created with a
--     @templateType@ of
--     'Vulkan.Core11.Enums.DescriptorUpdateTemplateType.DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS'
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-set-07995# @set@ /must/ be
--     the same value used to create @descriptorUpdateTemplate@
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-set-07304# @set@ /must/ be
--     less than
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo'::@setLayoutCount@
--     provided when @layout@ was created
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-set-11854# @set@ /must/
--     reference a valid 'Vulkan.Core10.Handles.DescriptorSetLayout' handle
--     in @layout@
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-set-07305# @set@ /must/ be
--     the unique set number in the pipeline layout that uses a descriptor
--     set layout that was created with
--     'Vulkan.Core10.Enums.DescriptorSetLayoutCreateFlagBits.DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT'
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-None-09495# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-dynamicPipelineLayout dynamicPipelineLayout>
--     feature is not enabled, @layout@ /must/ be a valid
--     'Vulkan.Core10.Handles.PipelineLayout' handle
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-layout-09496# If @layout@
--     is 'Vulkan.Core10.APIConstants.NULL_HANDLE', the @pNext@ chain
--     /must/ include a valid
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo' structure
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-None-10359# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_push_descriptor VK_KHR_push_descriptor>
--     extension is not enabled,
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-pushDescriptor pushDescriptor>
--     /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-sType-sType# @sType@
--     /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO'
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-pNext-pNext# @pNext@
--     /must/ be @NULL@ or a pointer to a valid instance of
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo'
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-sType-unique# The @sType@
--     value of each structure in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-descriptorUpdateTemplate-parameter#
--     @descriptorUpdateTemplate@ /must/ be a valid
--     'Vulkan.Core11.Handles.DescriptorUpdateTemplate' handle
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-layout-parameter# If
--     @layout@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @layout@
--     /must/ be a valid 'Vulkan.Core10.Handles.PipelineLayout' handle
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-pData-parameter# @pData@
--     /must/ be a pointer value
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfo-commonparent# Both of
--     @descriptorUpdateTemplate@, and @layout@ that are valid handles of
--     non-ignored parameters /must/ have been created, allocated, or
--     retrieved from the same 'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_push_descriptor VK_KHR_push_descriptor>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core11.Handles.DescriptorUpdateTemplate',
-- 'Vulkan.Core10.Handles.PipelineLayout',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdPushDescriptorSetWithTemplate2', 'cmdPushDescriptorSetWithTemplate2'
data PushDescriptorSetWithTemplateInfo (es :: [Type]) = PushDescriptorSetWithTemplateInfo
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> Chain es
next :: Chain es
  , -- | @descriptorUpdateTemplate@ is a descriptor update template defining how
    -- to interpret the descriptor information in @pData@.
    forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> DescriptorUpdateTemplate
descriptorUpdateTemplate :: DescriptorUpdateTemplate
  , -- | @layout@ is a 'Vulkan.Core10.Handles.PipelineLayout' object used to
    -- program the bindings. It /must/ be compatible with the layout used to
    -- create the @descriptorUpdateTemplate@ handle. If the
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-dynamicPipelineLayout dynamicPipelineLayout>
    -- feature is enabled, @layout@ /can/ be
    -- 'Vulkan.Core10.APIConstants.NULL_HANDLE' and the layout /must/ be
    -- specified by chaining
    -- 'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo' structure off
    -- the @pNext@
    forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> PipelineLayout
layout :: PipelineLayout
  , -- | @set@ is the set number of the descriptor set in the pipeline layout
    -- that will be updated. This /must/ be the same number used to create the
    -- @descriptorUpdateTemplate@ handle.
    forall (es :: [*]). PushDescriptorSetWithTemplateInfo es -> Word32
set :: Word32
  , -- | @pData@ is a pointer to memory containing descriptors for the templated
    -- update.
    forall (es :: [*]). PushDescriptorSetWithTemplateInfo es -> Ptr ()
data' :: Ptr ()
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PushDescriptorSetWithTemplateInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (PushDescriptorSetWithTemplateInfo es)

instance Extensible PushDescriptorSetWithTemplateInfo where
  extensibleTypeName :: String
extensibleTypeName = String
"PushDescriptorSetWithTemplateInfo"
  setNext :: forall (ds :: [*]) (es :: [*]).
PushDescriptorSetWithTemplateInfo ds
-> Chain es -> PushDescriptorSetWithTemplateInfo es
setNext PushDescriptorSetWithTemplateInfo{Word32
Ptr ()
DescriptorUpdateTemplate
PipelineLayout
Chain ds
next :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> Chain es
descriptorUpdateTemplate :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> DescriptorUpdateTemplate
layout :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> PipelineLayout
set :: forall (es :: [*]). PushDescriptorSetWithTemplateInfo es -> Word32
data' :: forall (es :: [*]). PushDescriptorSetWithTemplateInfo es -> Ptr ()
next :: Chain ds
descriptorUpdateTemplate :: DescriptorUpdateTemplate
layout :: PipelineLayout
set :: Word32
data' :: Ptr ()
..} Chain es
next' = PushDescriptorSetWithTemplateInfo{next :: Chain es
next = Chain es
next', Word32
Ptr ()
DescriptorUpdateTemplate
PipelineLayout
descriptorUpdateTemplate :: DescriptorUpdateTemplate
layout :: PipelineLayout
set :: Word32
data' :: Ptr ()
descriptorUpdateTemplate :: DescriptorUpdateTemplate
layout :: PipelineLayout
set :: Word32
data' :: Ptr ()
..}
  getNext :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> Chain es
getNext PushDescriptorSetWithTemplateInfo{Word32
Ptr ()
DescriptorUpdateTemplate
PipelineLayout
Chain es
next :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> Chain es
descriptorUpdateTemplate :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> DescriptorUpdateTemplate
layout :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> PipelineLayout
set :: forall (es :: [*]). PushDescriptorSetWithTemplateInfo es -> Word32
data' :: forall (es :: [*]). PushDescriptorSetWithTemplateInfo es -> Ptr ()
next :: Chain es
descriptorUpdateTemplate :: DescriptorUpdateTemplate
layout :: PipelineLayout
set :: Word32
data' :: Ptr ()
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends PushDescriptorSetWithTemplateInfo e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e
-> (Extends PushDescriptorSetWithTemplateInfo e => b) -> Maybe b
extends proxy e
_ Extends PushDescriptorSetWithTemplateInfo e => b
f
    | Just e :~: PipelineLayoutCreateInfo
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @PipelineLayoutCreateInfo = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PushDescriptorSetWithTemplateInfo e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss PushDescriptorSetWithTemplateInfo es
         , PokeChain es ) => ToCStruct (PushDescriptorSetWithTemplateInfo es) where
  withCStruct :: forall b.
PushDescriptorSetWithTemplateInfo es
-> (Ptr (PushDescriptorSetWithTemplateInfo es) -> IO b) -> IO b
withCStruct PushDescriptorSetWithTemplateInfo es
x Ptr (PushDescriptorSetWithTemplateInfo es) -> IO b
f = Int -> (Ptr (PushDescriptorSetWithTemplateInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr (PushDescriptorSetWithTemplateInfo es) -> IO b) -> IO b)
-> (Ptr (PushDescriptorSetWithTemplateInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (PushDescriptorSetWithTemplateInfo es)
p -> Ptr (PushDescriptorSetWithTemplateInfo es)
-> PushDescriptorSetWithTemplateInfo es -> IO b -> IO b
forall b.
Ptr (PushDescriptorSetWithTemplateInfo es)
-> PushDescriptorSetWithTemplateInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (PushDescriptorSetWithTemplateInfo es)
p PushDescriptorSetWithTemplateInfo es
x (Ptr (PushDescriptorSetWithTemplateInfo es) -> IO b
f Ptr (PushDescriptorSetWithTemplateInfo es)
p)
  pokeCStruct :: forall b.
Ptr (PushDescriptorSetWithTemplateInfo es)
-> PushDescriptorSetWithTemplateInfo es -> IO b -> IO b
pokeCStruct Ptr (PushDescriptorSetWithTemplateInfo es)
p PushDescriptorSetWithTemplateInfo{Word32
Ptr ()
DescriptorUpdateTemplate
PipelineLayout
Chain es
next :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> Chain es
descriptorUpdateTemplate :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> DescriptorUpdateTemplate
layout :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> PipelineLayout
set :: forall (es :: [*]). PushDescriptorSetWithTemplateInfo es -> Word32
data' :: forall (es :: [*]). PushDescriptorSetWithTemplateInfo es -> Ptr ()
next :: Chain es
descriptorUpdateTemplate :: DescriptorUpdateTemplate
layout :: PipelineLayout
set :: Word32
data' :: Ptr ()
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetWithTemplateInfo es)
p Ptr (PushDescriptorSetWithTemplateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO)
    pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
forall a. Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext''
    lift $ poke ((p `plusPtr` 16 :: Ptr DescriptorUpdateTemplate)) (descriptorUpdateTemplate)
    lift $ poke ((p `plusPtr` 24 :: Ptr PipelineLayout)) (layout)
    lift $ poke ((p `plusPtr` 32 :: Ptr Word32)) (set)
    lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr ()))) (data')
    lift $ f
  cStructSize :: Int
cStructSize = Int
48
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr (PushDescriptorSetWithTemplateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PushDescriptorSetWithTemplateInfo es)
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetWithTemplateInfo es)
p Ptr (PushDescriptorSetWithTemplateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO)
    pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext'
    lift $ poke ((p `plusPtr` 16 :: Ptr DescriptorUpdateTemplate)) (zero)
    lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr ()))) (zero)
    lift $ f

instance ( Extendss PushDescriptorSetWithTemplateInfo es
         , PeekChain es ) => FromCStruct (PushDescriptorSetWithTemplateInfo es) where
  peekCStruct :: Ptr (PushDescriptorSetWithTemplateInfo es)
-> IO (PushDescriptorSetWithTemplateInfo es)
peekCStruct Ptr (PushDescriptorSetWithTemplateInfo es)
p = do
    pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PushDescriptorSetWithTemplateInfo es)
p Ptr (PushDescriptorSetWithTemplateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    next <- peekChain (castPtr pNext)
    descriptorUpdateTemplate <- peek @DescriptorUpdateTemplate ((p `plusPtr` 16 :: Ptr DescriptorUpdateTemplate))
    layout <- peek @PipelineLayout ((p `plusPtr` 24 :: Ptr PipelineLayout))
    set <- peek @Word32 ((p `plusPtr` 32 :: Ptr Word32))
    pData <- peek @(Ptr ()) ((p `plusPtr` 40 :: Ptr (Ptr ())))
    pure $ PushDescriptorSetWithTemplateInfo
             next descriptorUpdateTemplate layout set pData

instance es ~ '[] => Zero (PushDescriptorSetWithTemplateInfo es) where
  zero :: PushDescriptorSetWithTemplateInfo es
zero = Chain es
-> DescriptorUpdateTemplate
-> PipelineLayout
-> Word32
-> Ptr ()
-> PushDescriptorSetWithTemplateInfo es
forall (es :: [*]).
Chain es
-> DescriptorUpdateTemplate
-> PipelineLayout
-> Word32
-> Ptr ()
-> PushDescriptorSetWithTemplateInfo es
PushDescriptorSetWithTemplateInfo
           ()
           DescriptorUpdateTemplate
forall a. Zero a => a
zero
           PipelineLayout
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Ptr ()
forall a. Zero a => a
zero