{-# language CPP #-}
-- | = Name
--
-- VK_KHR_maintenance6 - device extension
--
-- = VK_KHR_maintenance6
--
-- [__Name String__]
--     @VK_KHR_maintenance6@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     546
--
-- [__Revision__]
--     1
--
-- [__Ratification Status__]
--     Ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.1 Vulkan Version 1.1>
--
-- [__API Interactions__]
--
--     -   Interacts with VK_EXT_descriptor_buffer
--
--     -   Interacts with VK_KHR_push_descriptor
--
-- [__Contact__]
--
--     -   Jon Leech
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_KHR_maintenance6] @oddhack%0A*Here describe the issue or question you have about the VK_KHR_maintenance6 extension* >
--
-- [__Extension Proposal__]
--     <https://github.com/KhronosGroup/Vulkan-Docs/tree/main/proposals/VK_KHR_maintenance6.adoc VK_KHR_maintenance6>
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2023-08-03
--
-- [__Interactions and External Dependencies__]
--
--     -   Interacts with @VK_EXT_robustness2@
--
-- [__Contributors__]
--
--     -   Jon Leech, Khronos
--
--     -   Stu Smith, AMD
--
--     -   Mike Blumenkrantz, Valve
--
--     -   Ralph Potter, Samsung
--
--     -   James Fitzpatrick, Imagination Technologies
--
--     -   Piers Daniell, NVIDIA
--
--     -   Daniel Story, Nintendo
--
-- == Description
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>
-- adds a collection of minor features, none of which would warrant an
-- entire extension of their own.
--
-- The new features are as follows:
--
-- -   'BindMemoryStatusKHR' may be included in the @pNext@ chain of
--     'Vulkan.Core11.Promoted_From_VK_KHR_bind_memory2.BindBufferMemoryInfo'
--     and
--     'Vulkan.Core11.Promoted_From_VK_KHR_bind_memory2.BindImageMemoryInfo',
--     allowing applications to identify individual resources for which
--     memory binding failed during calls to
--     'Vulkan.Core11.Promoted_From_VK_KHR_bind_memory2.bindBufferMemory2'
--     and
--     'Vulkan.Core11.Promoted_From_VK_KHR_bind_memory2.bindImageMemory2'.
--
-- -   A new property @fragmentShadingRateClampCombinerInputs@ to indicate
--     if an implementation clamps the inputs to fragment shading rate
--     combiner operations.
--
-- -   'Vulkan.Core10.APIConstants.NULL_HANDLE' is allowed to be used when
--     binding an index buffer, instead of a valid
--     'Vulkan.Core10.Handles.Buffer' handle. When the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-nullDescriptor nullDescriptor>
--     feature is enabled, every index fetched results in a value of zero.
--
-- -   A new property @maxCombinedImageSamplerDescriptorCount@ to indicate
--     the maximum number of descriptors needed for any of the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion formats that require a sampler Y′CBCR conversion>
--     supported by the implementation.
--
-- -   A new property @blockTexelViewCompatibleMultipleLayers@ indicating
--     whether
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT'
--     is allowed to be used with @layerCount@ > 1
--
-- -   @pNext@ extensible *2 versions of all descriptor binding commands.
--
-- == New Commands
--
-- -   'cmdBindDescriptorSets2KHR'
--
-- -   'cmdPushConstants2KHR'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_buffer VK_EXT_descriptor_buffer>
-- is supported:
--
-- -   'cmdBindDescriptorBufferEmbeddedSamplers2EXT'
--
-- -   'cmdSetDescriptorBufferOffsets2EXT'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_push_descriptor VK_KHR_push_descriptor>
-- is supported:
--
-- -   'cmdPushDescriptorSet2KHR'
--
-- -   'cmdPushDescriptorSetWithTemplate2KHR'
--
-- == New Structures
--
-- -   'BindDescriptorSetsInfoKHR'
--
-- -   'PushConstantsInfoKHR'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_bind_memory2.BindBufferMemoryInfo',
--     'Vulkan.Core11.Promoted_From_VK_KHR_bind_memory2.BindImageMemoryInfo':
--
--     -   'BindMemoryStatusKHR'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceMaintenance6FeaturesKHR'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2':
--
--     -   'PhysicalDeviceMaintenance6PropertiesKHR'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_buffer VK_EXT_descriptor_buffer>
-- is supported:
--
-- -   'BindDescriptorBufferEmbeddedSamplersInfoEXT'
--
-- -   'SetDescriptorBufferOffsetsInfoEXT'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_push_descriptor VK_KHR_push_descriptor>
-- is supported:
--
-- -   'PushDescriptorSetInfoKHR'
--
-- -   'PushDescriptorSetWithTemplateInfoKHR'
--
-- == New Enum Constants
--
-- -   'KHR_MAINTENANCE_6_EXTENSION_NAME'
--
-- -   'KHR_MAINTENANCE_6_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BIND_MEMORY_STATUS_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PUSH_CONSTANTS_INFO_KHR'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_buffer VK_EXT_descriptor_buffer>
-- is supported:
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BIND_DESCRIPTOR_BUFFER_EMBEDDED_SAMPLERS_INFO_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SET_DESCRIPTOR_BUFFER_OFFSETS_INFO_EXT'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_push_descriptor VK_KHR_push_descriptor>
-- is supported:
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO_KHR'
--
-- == Issues
--
-- None.
--
-- == Version History
--
-- -   Revision 1, 2023-08-01 (Jon Leech)
--
--     -   Initial revision
--
-- == See Also
--
-- No cross-references are available
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_KHR_maintenance6 Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_KHR_maintenance6  ( cmdBindDescriptorSets2KHR
                                              , cmdPushConstants2KHR
                                              , cmdPushDescriptorSet2KHR
                                              , cmdPushDescriptorSetWithTemplate2KHR
                                              , cmdSetDescriptorBufferOffsets2EXT
                                              , cmdBindDescriptorBufferEmbeddedSamplers2EXT
                                              , PhysicalDeviceMaintenance6FeaturesKHR(..)
                                              , PhysicalDeviceMaintenance6PropertiesKHR(..)
                                              , BindMemoryStatusKHR(..)
                                              , BindDescriptorSetsInfoKHR(..)
                                              , PushConstantsInfoKHR(..)
                                              , PushDescriptorSetInfoKHR(..)
                                              , PushDescriptorSetWithTemplateInfoKHR(..)
                                              , SetDescriptorBufferOffsetsInfoEXT(..)
                                              , BindDescriptorBufferEmbeddedSamplersInfoEXT(..)
                                              , KHR_MAINTENANCE_6_SPEC_VERSION
                                              , pattern KHR_MAINTENANCE_6_SPEC_VERSION
                                              , KHR_MAINTENANCE_6_EXTENSION_NAME
                                              , pattern KHR_MAINTENANCE_6_EXTENSION_NAME
                                              ) 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.String (IsString)
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(pVkCmdBindDescriptorBufferEmbeddedSamplers2EXT))
import Vulkan.Dynamic (DeviceCmds(pVkCmdBindDescriptorSets2KHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdPushConstants2KHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdPushDescriptorSet2KHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdPushDescriptorSetWithTemplate2KHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdSetDescriptorBufferOffsets2EXT))
import Vulkan.Core10.FundamentalTypes (DeviceSize)
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 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_BUFFER_EMBEDDED_SAMPLERS_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BIND_MEMORY_STATUS_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PUSH_CONSTANTS_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SET_DESCRIPTOR_BUFFER_OFFSETS_INFO_EXT))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdBindDescriptorSets2KHR
  :: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct BindDescriptorSetsInfoKHR) -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct BindDescriptorSetsInfoKHR) -> IO ()

-- | vkCmdBindDescriptorSets2KHR - Binds descriptor sets to a command buffer
--
-- == Valid Usage
--
-- -   #VUID-vkCmdBindDescriptorSets2KHR-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-vkCmdBindDescriptorSets2KHR-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdBindDescriptorSets2KHR-pBindDescriptorSetsInfo-parameter#
--     @pBindDescriptorSetsInfo@ /must/ be a valid pointer to a valid
--     'BindDescriptorSetsInfoKHR' structure
--
-- -   #VUID-vkCmdBindDescriptorSets2KHR-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-vkCmdBindDescriptorSets2KHR-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics, or compute operations
--
-- -   #VUID-vkCmdBindDescriptorSets2KHR-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                                                                                                                     | Graphics                                                                                                              | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             | Compute                                                                                                               |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- 'BindDescriptorSetsInfoKHR', 'Vulkan.Core10.Handles.CommandBuffer'
cmdBindDescriptorSets2KHR :: forall a io
                           . ( Extendss BindDescriptorSetsInfoKHR 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 'BindDescriptorSetsInfoKHR'
                             -- structure.
                             (BindDescriptorSetsInfoKHR a)
                          -> io ()
cmdBindDescriptorSets2KHR :: forall (a :: [*]) (io :: * -> *).
(Extendss BindDescriptorSetsInfoKHR a, PokeChain a, MonadIO io) =>
CommandBuffer -> BindDescriptorSetsInfoKHR a -> io ()
cmdBindDescriptorSets2KHR CommandBuffer
commandBuffer
                            BindDescriptorSetsInfoKHR 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 vkCmdBindDescriptorSets2KHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct BindDescriptorSetsInfoKHR) -> IO ())
vkCmdBindDescriptorSets2KHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct BindDescriptorSetsInfoKHR) -> IO ())
pVkCmdBindDescriptorSets2KHR (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:CommandBuffer :: 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 BindDescriptorSetsInfoKHR) -> IO ())
vkCmdBindDescriptorSets2KHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct BindDescriptorSetsInfoKHR) -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct BindDescriptorSetsInfoKHR) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct BindDescriptorSetsInfoKHR) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. 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 vkCmdBindDescriptorSets2KHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdBindDescriptorSets2KHR' :: Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorSetsInfoKHR) -> IO ()
vkCmdBindDescriptorSets2KHR' = FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct BindDescriptorSetsInfoKHR) -> IO ())
-> Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorSetsInfoKHR)
-> IO ()
mkVkCmdBindDescriptorSets2KHR FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct BindDescriptorSetsInfoKHR) -> IO ())
vkCmdBindDescriptorSets2KHRPtr
  Ptr (BindDescriptorSetsInfoKHR a)
pBindDescriptorSetsInfo <- ((Ptr (BindDescriptorSetsInfoKHR a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (BindDescriptorSetsInfoKHR a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (BindDescriptorSetsInfoKHR a) -> IO ()) -> IO ())
 -> ContT () IO (Ptr (BindDescriptorSetsInfoKHR a)))
-> ((Ptr (BindDescriptorSetsInfoKHR a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (BindDescriptorSetsInfoKHR a))
forall a b. (a -> b) -> a -> b
$ BindDescriptorSetsInfoKHR a
-> (Ptr (BindDescriptorSetsInfoKHR a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
BindDescriptorSetsInfoKHR a
-> (Ptr (BindDescriptorSetsInfoKHR a) -> IO b) -> IO b
withCStruct (BindDescriptorSetsInfoKHR a
bindDescriptorSetsInfo)
  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
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdBindDescriptorSets2KHR" (Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorSetsInfoKHR) -> IO ()
vkCmdBindDescriptorSets2KHR'
                                                           (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
                                                           (Ptr (BindDescriptorSetsInfoKHR a)
-> Ptr (SomeStruct BindDescriptorSetsInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (BindDescriptorSetsInfoKHR a)
pBindDescriptorSetsInfo))
  () -> ContT () IO ()
forall a. a -> ContT () IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


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

-- | vkCmdPushConstants2KHR - Update the values of push constants
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdPushConstants2KHR-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdPushConstants2KHR-pPushConstantsInfo-parameter#
--     @pPushConstantsInfo@ /must/ be a valid pointer to a valid
--     'PushConstantsInfoKHR' structure
--
-- -   #VUID-vkCmdPushConstants2KHR-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-vkCmdPushConstants2KHR-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics, or compute operations
--
-- -   #VUID-vkCmdPushConstants2KHR-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                                                                                                                     | Graphics                                                                                                              | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             | Compute                                                                                                               |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- 'Vulkan.Core10.Handles.CommandBuffer', 'PushConstantsInfoKHR'
cmdPushConstants2KHR :: forall a io
                      . ( Extendss PushConstantsInfoKHR 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 'PushConstantsInfoKHR' structure.
                        (PushConstantsInfoKHR a)
                     -> io ()
cmdPushConstants2KHR :: forall (a :: [*]) (io :: * -> *).
(Extendss PushConstantsInfoKHR a, PokeChain a, MonadIO io) =>
CommandBuffer -> PushConstantsInfoKHR a -> io ()
cmdPushConstants2KHR CommandBuffer
commandBuffer PushConstantsInfoKHR 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 vkCmdPushConstants2KHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushConstantsInfoKHR) -> IO ())
vkCmdPushConstants2KHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct PushConstantsInfoKHR) -> IO ())
pVkCmdPushConstants2KHR (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
$sel:deviceCmds:CommandBuffer :: 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 PushConstantsInfoKHR) -> IO ())
vkCmdPushConstants2KHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushConstantsInfoKHR) -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct PushConstantsInfoKHR) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushConstantsInfoKHR) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. 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 vkCmdPushConstants2KHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdPushConstants2KHR' :: Ptr CommandBuffer_T
-> Ptr (SomeStruct PushConstantsInfoKHR) -> IO ()
vkCmdPushConstants2KHR' = FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushConstantsInfoKHR) -> IO ())
-> Ptr CommandBuffer_T
-> Ptr (SomeStruct PushConstantsInfoKHR)
-> IO ()
mkVkCmdPushConstants2KHR FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushConstantsInfoKHR) -> IO ())
vkCmdPushConstants2KHRPtr
  Ptr (PushConstantsInfoKHR a)
pPushConstantsInfo <- ((Ptr (PushConstantsInfoKHR a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushConstantsInfoKHR a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (PushConstantsInfoKHR a) -> IO ()) -> IO ())
 -> ContT () IO (Ptr (PushConstantsInfoKHR a)))
-> ((Ptr (PushConstantsInfoKHR a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushConstantsInfoKHR a))
forall a b. (a -> b) -> a -> b
$ PushConstantsInfoKHR a
-> (Ptr (PushConstantsInfoKHR a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PushConstantsInfoKHR a
-> (Ptr (PushConstantsInfoKHR a) -> IO b) -> IO b
withCStruct (PushConstantsInfoKHR a
pushConstantsInfo)
  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
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdPushConstants2KHR" (Ptr CommandBuffer_T
-> Ptr (SomeStruct PushConstantsInfoKHR) -> IO ()
vkCmdPushConstants2KHR'
                                                      (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
                                                      (Ptr (PushConstantsInfoKHR a)
-> Ptr (SomeStruct PushConstantsInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (PushConstantsInfoKHR a)
pPushConstantsInfo))
  () -> ContT () IO ()
forall a. a -> ContT () IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


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

-- | vkCmdPushDescriptorSet2KHR - Pushes descriptor updates into a command
-- buffer
--
-- == Valid Usage
--
-- -   #VUID-vkCmdPushDescriptorSet2KHR-pPushDescriptorSetInfo-09468# Each
--     bit in @pPushDescriptorSetInfo->stageFlags@ /must/ be a stage
--     supported by the @commandBuffer@’s parent
--     'Vulkan.Core10.Handles.CommandPool'’s queue family
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdPushDescriptorSet2KHR-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdPushDescriptorSet2KHR-pPushDescriptorSetInfo-parameter#
--     @pPushDescriptorSetInfo@ /must/ be a valid pointer to a valid
--     'PushDescriptorSetInfoKHR' structure
--
-- -   #VUID-vkCmdPushDescriptorSet2KHR-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-vkCmdPushDescriptorSet2KHR-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics, or compute operations
--
-- -   #VUID-vkCmdPushDescriptorSet2KHR-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                                                                                                                     | Graphics                                                                                                              | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             | Compute                                                                                                               |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- = 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>,
-- 'Vulkan.Core10.Handles.CommandBuffer', 'PushDescriptorSetInfoKHR'
cmdPushDescriptorSet2KHR :: forall a io
                          . ( Extendss PushDescriptorSetInfoKHR a
                            , PokeChain a
                            , MonadIO io )
                         => -- | @commandBuffer@ is the command buffer that the descriptors will be
                            -- recorded in.
                            CommandBuffer
                         -> -- | @pPushDescriptorSetInfo@ is a pointer to a 'PushDescriptorSetInfoKHR'
                            -- structure.
                            (PushDescriptorSetInfoKHR a)
                         -> io ()
cmdPushDescriptorSet2KHR :: forall (a :: [*]) (io :: * -> *).
(Extendss PushDescriptorSetInfoKHR a, PokeChain a, MonadIO io) =>
CommandBuffer -> PushDescriptorSetInfoKHR a -> io ()
cmdPushDescriptorSet2KHR CommandBuffer
commandBuffer
                           PushDescriptorSetInfoKHR 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 vkCmdPushDescriptorSet2KHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetInfoKHR) -> IO ())
vkCmdPushDescriptorSet2KHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct PushDescriptorSetInfoKHR) -> IO ())
pVkCmdPushDescriptorSet2KHR (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
$sel:deviceCmds:CommandBuffer :: 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 PushDescriptorSetInfoKHR) -> IO ())
vkCmdPushDescriptorSet2KHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetInfoKHR) -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct PushDescriptorSetInfoKHR) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetInfoKHR) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. 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 vkCmdPushDescriptorSet2KHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdPushDescriptorSet2KHR' :: Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetInfoKHR) -> IO ()
vkCmdPushDescriptorSet2KHR' = FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetInfoKHR) -> IO ())
-> Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetInfoKHR)
-> IO ()
mkVkCmdPushDescriptorSet2KHR FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetInfoKHR) -> IO ())
vkCmdPushDescriptorSet2KHRPtr
  Ptr (PushDescriptorSetInfoKHR a)
pPushDescriptorSetInfo <- ((Ptr (PushDescriptorSetInfoKHR a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushDescriptorSetInfoKHR a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (PushDescriptorSetInfoKHR a) -> IO ()) -> IO ())
 -> ContT () IO (Ptr (PushDescriptorSetInfoKHR a)))
-> ((Ptr (PushDescriptorSetInfoKHR a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushDescriptorSetInfoKHR a))
forall a b. (a -> b) -> a -> b
$ PushDescriptorSetInfoKHR a
-> (Ptr (PushDescriptorSetInfoKHR a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PushDescriptorSetInfoKHR a
-> (Ptr (PushDescriptorSetInfoKHR a) -> IO b) -> IO b
withCStruct (PushDescriptorSetInfoKHR a
pushDescriptorSetInfo)
  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
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdPushDescriptorSet2KHR" (Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetInfoKHR) -> IO ()
vkCmdPushDescriptorSet2KHR'
                                                          (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
                                                          (Ptr (PushDescriptorSetInfoKHR a)
-> Ptr (SomeStruct PushDescriptorSetInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (PushDescriptorSetInfoKHR a)
pPushDescriptorSetInfo))
  () -> ContT () IO ()
forall a. a -> ContT () IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


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

-- | vkCmdPushDescriptorSetWithTemplate2KHR - Pushes descriptor updates into
-- a command buffer using a descriptor update template
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdPushDescriptorSetWithTemplate2KHR-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdPushDescriptorSetWithTemplate2KHR-pPushDescriptorSetWithTemplateInfo-parameter#
--     @pPushDescriptorSetWithTemplateInfo@ /must/ be a valid pointer to a
--     valid 'PushDescriptorSetWithTemplateInfoKHR' structure
--
-- -   #VUID-vkCmdPushDescriptorSetWithTemplate2KHR-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-vkCmdPushDescriptorSetWithTemplate2KHR-commandBuffer-cmdpool#
--     The 'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics, or compute operations
--
-- -   #VUID-vkCmdPushDescriptorSetWithTemplate2KHR-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                                                                                                                     | Graphics                                                                                                              | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             | Compute                                                                                                               |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- = 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>,
-- 'Vulkan.Core10.Handles.CommandBuffer',
-- 'PushDescriptorSetWithTemplateInfoKHR'
cmdPushDescriptorSetWithTemplate2KHR :: forall a io
                                      . ( Extendss PushDescriptorSetWithTemplateInfoKHR a
                                        , PokeChain a
                                        , MonadIO io )
                                     => -- | @commandBuffer@ is the command buffer that the descriptors will be
                                        -- recorded in.
                                        CommandBuffer
                                     -> -- | @pPushDescriptorSetWithTemplateInfo@ is a pointer to a
                                        -- 'PushDescriptorSetWithTemplateInfoKHR' structure.
                                        (PushDescriptorSetWithTemplateInfoKHR a)
                                     -> io ()
cmdPushDescriptorSetWithTemplate2KHR :: forall (a :: [*]) (io :: * -> *).
(Extendss PushDescriptorSetWithTemplateInfoKHR a, PokeChain a,
 MonadIO io) =>
CommandBuffer -> PushDescriptorSetWithTemplateInfoKHR a -> io ()
cmdPushDescriptorSetWithTemplate2KHR CommandBuffer
commandBuffer
                                       PushDescriptorSetWithTemplateInfoKHR 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 vkCmdPushDescriptorSetWithTemplate2KHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfoKHR) -> IO ())
vkCmdPushDescriptorSetWithTemplate2KHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfoKHR) -> IO ())
pVkCmdPushDescriptorSetWithTemplate2KHR (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
$sel:deviceCmds:CommandBuffer :: 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 PushDescriptorSetWithTemplateInfoKHR) -> IO ())
vkCmdPushDescriptorSetWithTemplate2KHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfoKHR) -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfoKHR) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfoKHR) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. 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 vkCmdPushDescriptorSetWithTemplate2KHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdPushDescriptorSetWithTemplate2KHR' :: Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetWithTemplateInfoKHR) -> IO ()
vkCmdPushDescriptorSetWithTemplate2KHR' = FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfoKHR) -> IO ())
-> Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetWithTemplateInfoKHR)
-> IO ()
mkVkCmdPushDescriptorSetWithTemplate2KHR FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfoKHR) -> IO ())
vkCmdPushDescriptorSetWithTemplate2KHRPtr
  Ptr (PushDescriptorSetWithTemplateInfoKHR a)
pPushDescriptorSetWithTemplateInfo <- ((Ptr (PushDescriptorSetWithTemplateInfoKHR a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushDescriptorSetWithTemplateInfoKHR a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (PushDescriptorSetWithTemplateInfoKHR a) -> IO ()) -> IO ())
 -> ContT () IO (Ptr (PushDescriptorSetWithTemplateInfoKHR a)))
-> ((Ptr (PushDescriptorSetWithTemplateInfoKHR a) -> IO ())
    -> IO ())
-> ContT () IO (Ptr (PushDescriptorSetWithTemplateInfoKHR a))
forall a b. (a -> b) -> a -> b
$ PushDescriptorSetWithTemplateInfoKHR a
-> (Ptr (PushDescriptorSetWithTemplateInfoKHR a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PushDescriptorSetWithTemplateInfoKHR a
-> (Ptr (PushDescriptorSetWithTemplateInfoKHR a) -> IO b) -> IO b
withCStruct (PushDescriptorSetWithTemplateInfoKHR a
pushDescriptorSetWithTemplateInfo)
  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
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdPushDescriptorSetWithTemplate2KHR" (Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetWithTemplateInfoKHR) -> IO ()
vkCmdPushDescriptorSetWithTemplate2KHR'
                                                                      (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
                                                                      (Ptr (PushDescriptorSetWithTemplateInfoKHR a)
-> Ptr (SomeStruct PushDescriptorSetWithTemplateInfoKHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (PushDescriptorSetWithTemplateInfoKHR a)
pPushDescriptorSetWithTemplateInfo))
  () -> ContT () IO ()
forall a. a -> ContT () IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


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

-- | vkCmdSetDescriptorBufferOffsets2EXT - Setting descriptor buffer offsets
-- in a command buffer
--
-- == Valid Usage
--
-- -   #VUID-vkCmdSetDescriptorBufferOffsets2EXT-descriptorBuffer-09470#
--     The
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-descriptorBuffer descriptorBuffer>
--     feature /must/ be enabled
--
-- -   #VUID-vkCmdSetDescriptorBufferOffsets2EXT-pSetDescriptorBufferOffsetsInfo-09471#
--     Each bit in @pSetDescriptorBufferOffsetsInfo->stageFlags@ /must/ be
--     a stage supported by the @commandBuffer@’s parent
--     'Vulkan.Core10.Handles.CommandPool'’s queue family
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdSetDescriptorBufferOffsets2EXT-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdSetDescriptorBufferOffsets2EXT-pSetDescriptorBufferOffsetsInfo-parameter#
--     @pSetDescriptorBufferOffsetsInfo@ /must/ be a valid pointer to a
--     valid 'SetDescriptorBufferOffsetsInfoEXT' structure
--
-- -   #VUID-vkCmdSetDescriptorBufferOffsets2EXT-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-vkCmdSetDescriptorBufferOffsets2EXT-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics, or compute operations
--
-- -   #VUID-vkCmdSetDescriptorBufferOffsets2EXT-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                                                                                                                     | Graphics                                                                                                              | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             | Compute                                                                                                               |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_buffer VK_EXT_descriptor_buffer>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- 'Vulkan.Core10.Handles.CommandBuffer',
-- 'SetDescriptorBufferOffsetsInfoEXT'
cmdSetDescriptorBufferOffsets2EXT :: forall a io
                                   . ( Extendss SetDescriptorBufferOffsetsInfoEXT a
                                     , PokeChain a
                                     , MonadIO io )
                                  => -- | @commandBuffer@ is the command buffer in which the descriptor buffer
                                     -- offsets will be set.
                                     CommandBuffer
                                  -> -- | @pSetDescriptorBufferOffsetsInfo@ is a pointer to a
                                     -- 'SetDescriptorBufferOffsetsInfoEXT' structure.
                                     (SetDescriptorBufferOffsetsInfoEXT a)
                                  -> io ()
cmdSetDescriptorBufferOffsets2EXT :: forall (a :: [*]) (io :: * -> *).
(Extendss SetDescriptorBufferOffsetsInfoEXT a, PokeChain a,
 MonadIO io) =>
CommandBuffer -> SetDescriptorBufferOffsetsInfoEXT a -> io ()
cmdSetDescriptorBufferOffsets2EXT CommandBuffer
commandBuffer
                                    SetDescriptorBufferOffsetsInfoEXT a
setDescriptorBufferOffsetsInfo = 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 vkCmdSetDescriptorBufferOffsets2EXTPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct SetDescriptorBufferOffsetsInfoEXT) -> IO ())
vkCmdSetDescriptorBufferOffsets2EXTPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct SetDescriptorBufferOffsetsInfoEXT) -> IO ())
pVkCmdSetDescriptorBufferOffsets2EXT (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
$sel:deviceCmds:CommandBuffer :: 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 SetDescriptorBufferOffsetsInfoEXT) -> IO ())
vkCmdSetDescriptorBufferOffsets2EXTPtr FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct SetDescriptorBufferOffsetsInfoEXT) -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct SetDescriptorBufferOffsetsInfoEXT) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct SetDescriptorBufferOffsetsInfoEXT) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. 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 vkCmdSetDescriptorBufferOffsets2EXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdSetDescriptorBufferOffsets2EXT' :: Ptr CommandBuffer_T
-> Ptr (SomeStruct SetDescriptorBufferOffsetsInfoEXT) -> IO ()
vkCmdSetDescriptorBufferOffsets2EXT' = FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct SetDescriptorBufferOffsetsInfoEXT) -> IO ())
-> Ptr CommandBuffer_T
-> Ptr (SomeStruct SetDescriptorBufferOffsetsInfoEXT)
-> IO ()
mkVkCmdSetDescriptorBufferOffsets2EXT FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct SetDescriptorBufferOffsetsInfoEXT) -> IO ())
vkCmdSetDescriptorBufferOffsets2EXTPtr
  Ptr (SetDescriptorBufferOffsetsInfoEXT a)
pSetDescriptorBufferOffsetsInfo <- ((Ptr (SetDescriptorBufferOffsetsInfoEXT a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (SetDescriptorBufferOffsetsInfoEXT a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (SetDescriptorBufferOffsetsInfoEXT a) -> IO ()) -> IO ())
 -> ContT () IO (Ptr (SetDescriptorBufferOffsetsInfoEXT a)))
-> ((Ptr (SetDescriptorBufferOffsetsInfoEXT a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (SetDescriptorBufferOffsetsInfoEXT a))
forall a b. (a -> b) -> a -> b
$ SetDescriptorBufferOffsetsInfoEXT a
-> (Ptr (SetDescriptorBufferOffsetsInfoEXT a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
SetDescriptorBufferOffsetsInfoEXT a
-> (Ptr (SetDescriptorBufferOffsetsInfoEXT a) -> IO b) -> IO b
withCStruct (SetDescriptorBufferOffsetsInfoEXT a
setDescriptorBufferOffsetsInfo)
  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
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdSetDescriptorBufferOffsets2EXT" (Ptr CommandBuffer_T
-> Ptr (SomeStruct SetDescriptorBufferOffsetsInfoEXT) -> IO ()
vkCmdSetDescriptorBufferOffsets2EXT'
                                                                   (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
                                                                   (Ptr (SetDescriptorBufferOffsetsInfoEXT a)
-> Ptr (SomeStruct SetDescriptorBufferOffsetsInfoEXT)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (SetDescriptorBufferOffsetsInfoEXT a)
pSetDescriptorBufferOffsetsInfo))
  () -> ContT () IO ()
forall a. a -> ContT () IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


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

-- | vkCmdBindDescriptorBufferEmbeddedSamplers2EXT - Setting embedded
-- immutable samplers offsets in a command buffer
--
-- == Valid Usage
--
-- -   #VUID-vkCmdBindDescriptorBufferEmbeddedSamplers2EXT-descriptorBuffer-09472#
--     The
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-descriptorBuffer descriptorBuffer>
--     feature /must/ be enabled
--
-- -   #VUID-vkCmdBindDescriptorBufferEmbeddedSamplers2EXT-pBindDescriptorBufferEmbeddedSamplersInfo-09473#
--     Each bit in @pBindDescriptorBufferEmbeddedSamplersInfo->stageFlags@
--     /must/ be a stage supported by the @commandBuffer@’s parent
--     'Vulkan.Core10.Handles.CommandPool'’s queue family
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdBindDescriptorBufferEmbeddedSamplers2EXT-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdBindDescriptorBufferEmbeddedSamplers2EXT-pBindDescriptorBufferEmbeddedSamplersInfo-parameter#
--     @pBindDescriptorBufferEmbeddedSamplersInfo@ /must/ be a valid
--     pointer to a valid 'BindDescriptorBufferEmbeddedSamplersInfoEXT'
--     structure
--
-- -   #VUID-vkCmdBindDescriptorBufferEmbeddedSamplers2EXT-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-vkCmdBindDescriptorBufferEmbeddedSamplers2EXT-commandBuffer-cmdpool#
--     The 'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics, or compute operations
--
-- -   #VUID-vkCmdBindDescriptorBufferEmbeddedSamplers2EXT-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                                                                                                                     | Graphics                                                                                                              | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             | Compute                                                                                                               |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_buffer VK_EXT_descriptor_buffer>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- 'BindDescriptorBufferEmbeddedSamplersInfoEXT',
-- 'Vulkan.Core10.Handles.CommandBuffer'
cmdBindDescriptorBufferEmbeddedSamplers2EXT :: forall a io
                                             . ( Extendss BindDescriptorBufferEmbeddedSamplersInfoEXT a
                                               , PokeChain a
                                               , MonadIO io )
                                            => -- | @commandBuffer@ is the command buffer that the embedded immutable
                                               -- samplers will be bound to.
                                               CommandBuffer
                                            -> -- | @pBindDescriptorBufferEmbeddedSamplersInfo@ is a pointer to a
                                               -- 'BindDescriptorBufferEmbeddedSamplersInfoEXT' structure.
                                               (BindDescriptorBufferEmbeddedSamplersInfoEXT a)
                                            -> io ()
cmdBindDescriptorBufferEmbeddedSamplers2EXT :: forall (a :: [*]) (io :: * -> *).
(Extendss BindDescriptorBufferEmbeddedSamplersInfoEXT a,
 PokeChain a, MonadIO io) =>
CommandBuffer
-> BindDescriptorBufferEmbeddedSamplersInfoEXT a -> io ()
cmdBindDescriptorBufferEmbeddedSamplers2EXT CommandBuffer
commandBuffer
                                              BindDescriptorBufferEmbeddedSamplersInfoEXT a
bindDescriptorBufferEmbeddedSamplersInfo = 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 vkCmdBindDescriptorBufferEmbeddedSamplers2EXTPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct BindDescriptorBufferEmbeddedSamplersInfoEXT)
   -> IO ())
vkCmdBindDescriptorBufferEmbeddedSamplers2EXTPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct BindDescriptorBufferEmbeddedSamplersInfoEXT)
      -> IO ())
pVkCmdBindDescriptorBufferEmbeddedSamplers2EXT (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
$sel:deviceCmds:CommandBuffer :: 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 BindDescriptorBufferEmbeddedSamplersInfoEXT)
   -> IO ())
vkCmdBindDescriptorBufferEmbeddedSamplers2EXTPtr FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct BindDescriptorBufferEmbeddedSamplersInfoEXT)
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct BindDescriptorBufferEmbeddedSamplersInfoEXT)
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct BindDescriptorBufferEmbeddedSamplersInfoEXT)
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. 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 vkCmdBindDescriptorBufferEmbeddedSamplers2EXT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdBindDescriptorBufferEmbeddedSamplers2EXT' :: Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorBufferEmbeddedSamplersInfoEXT)
-> IO ()
vkCmdBindDescriptorBufferEmbeddedSamplers2EXT' = FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct BindDescriptorBufferEmbeddedSamplersInfoEXT)
   -> IO ())
-> Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorBufferEmbeddedSamplersInfoEXT)
-> IO ()
mkVkCmdBindDescriptorBufferEmbeddedSamplers2EXT FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct BindDescriptorBufferEmbeddedSamplersInfoEXT)
   -> IO ())
vkCmdBindDescriptorBufferEmbeddedSamplers2EXTPtr
  Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT a)
pBindDescriptorBufferEmbeddedSamplersInfo <- ((Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT a) -> IO ())
 -> IO ())
-> ContT
     () IO (Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT a) -> IO ())
  -> IO ())
 -> ContT
      () IO (Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT a)))
-> ((Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT a) -> IO ())
    -> IO ())
-> ContT
     () IO (Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT a))
forall a b. (a -> b) -> a -> b
$ BindDescriptorBufferEmbeddedSamplersInfoEXT a
-> (Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT a) -> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
BindDescriptorBufferEmbeddedSamplersInfoEXT a
-> (Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT a) -> IO b)
-> IO b
withCStruct (BindDescriptorBufferEmbeddedSamplersInfoEXT a
bindDescriptorBufferEmbeddedSamplersInfo)
  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
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdBindDescriptorBufferEmbeddedSamplers2EXT" (Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorBufferEmbeddedSamplersInfoEXT)
-> IO ()
vkCmdBindDescriptorBufferEmbeddedSamplers2EXT'
                                                                             (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
                                                                             (Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT a)
-> Ptr (SomeStruct BindDescriptorBufferEmbeddedSamplersInfoEXT)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT a)
pBindDescriptorBufferEmbeddedSamplersInfo))
  () -> ContT () IO ()
forall a. a -> ContT () IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


-- | VkPhysicalDeviceMaintenance6FeaturesKHR - Structure describing whether
-- the implementation supports maintenance6 functionality
--
-- = Members
--
-- This structure describes the following feature:
--
-- = Description
--
-- If the 'PhysicalDeviceMaintenance6FeaturesKHR' 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. 'PhysicalDeviceMaintenance6FeaturesKHR' /can/ also be used in
-- the @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to
-- selectively enable these features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceMaintenance6FeaturesKHR = PhysicalDeviceMaintenance6FeaturesKHR
  { -- | #features-maintenance6# @maintenance6@ indicates that the implementation
    -- supports the following:
    --
    -- -   'Vulkan.Core10.APIConstants.NULL_HANDLE' /can/ be used when binding
    --     an index buffer
    --
    -- -   'BindMemoryStatusKHR' /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.
    --
    -- -   'PhysicalDeviceMaintenance6PropertiesKHR'::@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@.
    --
    -- -   'PhysicalDeviceMaintenance6PropertiesKHR'::@maxCombinedImageSamplerDescriptorCount@
    --     property which indicates the maximum descriptor size required for
    --     any
    --     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion format that requires a sampler Y′CBCR conversion>
    --     supported by the implementation.
    --
    -- -   A
    --     'PhysicalDeviceMaintenance6PropertiesKHR'::@fragmentShadingRateClampCombinerInputs@
    --     property which indicates whether the implementation clamps the
    --     inputs to fragment shading rate combiner operations.
    PhysicalDeviceMaintenance6FeaturesKHR -> Bool
maintenance6 :: Bool }
  deriving (Typeable, PhysicalDeviceMaintenance6FeaturesKHR
-> PhysicalDeviceMaintenance6FeaturesKHR -> Bool
(PhysicalDeviceMaintenance6FeaturesKHR
 -> PhysicalDeviceMaintenance6FeaturesKHR -> Bool)
-> (PhysicalDeviceMaintenance6FeaturesKHR
    -> PhysicalDeviceMaintenance6FeaturesKHR -> Bool)
-> Eq PhysicalDeviceMaintenance6FeaturesKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceMaintenance6FeaturesKHR
-> PhysicalDeviceMaintenance6FeaturesKHR -> Bool
== :: PhysicalDeviceMaintenance6FeaturesKHR
-> PhysicalDeviceMaintenance6FeaturesKHR -> Bool
$c/= :: PhysicalDeviceMaintenance6FeaturesKHR
-> PhysicalDeviceMaintenance6FeaturesKHR -> Bool
/= :: PhysicalDeviceMaintenance6FeaturesKHR
-> PhysicalDeviceMaintenance6FeaturesKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceMaintenance6FeaturesKHR)
#endif
deriving instance Show PhysicalDeviceMaintenance6FeaturesKHR

instance ToCStruct PhysicalDeviceMaintenance6FeaturesKHR where
  withCStruct :: forall b.
PhysicalDeviceMaintenance6FeaturesKHR
-> (Ptr PhysicalDeviceMaintenance6FeaturesKHR -> IO b) -> IO b
withCStruct PhysicalDeviceMaintenance6FeaturesKHR
x Ptr PhysicalDeviceMaintenance6FeaturesKHR -> IO b
f = Int -> (Ptr PhysicalDeviceMaintenance6FeaturesKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceMaintenance6FeaturesKHR -> IO b) -> IO b)
-> (Ptr PhysicalDeviceMaintenance6FeaturesKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceMaintenance6FeaturesKHR
p -> Ptr PhysicalDeviceMaintenance6FeaturesKHR
-> PhysicalDeviceMaintenance6FeaturesKHR -> IO b -> IO b
forall b.
Ptr PhysicalDeviceMaintenance6FeaturesKHR
-> PhysicalDeviceMaintenance6FeaturesKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance6FeaturesKHR
p PhysicalDeviceMaintenance6FeaturesKHR
x (Ptr PhysicalDeviceMaintenance6FeaturesKHR -> IO b
f Ptr PhysicalDeviceMaintenance6FeaturesKHR
p)
  pokeCStruct :: forall b.
Ptr PhysicalDeviceMaintenance6FeaturesKHR
-> PhysicalDeviceMaintenance6FeaturesKHR -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance6FeaturesKHR
p PhysicalDeviceMaintenance6FeaturesKHR{Bool
$sel:maintenance6:PhysicalDeviceMaintenance6FeaturesKHR :: PhysicalDeviceMaintenance6FeaturesKHR -> Bool
maintenance6 :: Bool
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6FeaturesKHR
p Ptr PhysicalDeviceMaintenance6FeaturesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6FeaturesKHR
p Ptr PhysicalDeviceMaintenance6FeaturesKHR -> 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 PhysicalDeviceMaintenance6FeaturesKHR
p Ptr PhysicalDeviceMaintenance6FeaturesKHR -> 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 PhysicalDeviceMaintenance6FeaturesKHR -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceMaintenance6FeaturesKHR
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6FeaturesKHR
p Ptr PhysicalDeviceMaintenance6FeaturesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6FeaturesKHR
p Ptr PhysicalDeviceMaintenance6FeaturesKHR -> 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 PhysicalDeviceMaintenance6FeaturesKHR
p Ptr PhysicalDeviceMaintenance6FeaturesKHR -> 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 PhysicalDeviceMaintenance6FeaturesKHR where
  peekCStruct :: Ptr PhysicalDeviceMaintenance6FeaturesKHR
-> IO PhysicalDeviceMaintenance6FeaturesKHR
peekCStruct Ptr PhysicalDeviceMaintenance6FeaturesKHR
p = do
    Bool32
maintenance6 <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceMaintenance6FeaturesKHR
p Ptr PhysicalDeviceMaintenance6FeaturesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    PhysicalDeviceMaintenance6FeaturesKHR
-> IO PhysicalDeviceMaintenance6FeaturesKHR
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceMaintenance6FeaturesKHR
 -> IO PhysicalDeviceMaintenance6FeaturesKHR)
-> PhysicalDeviceMaintenance6FeaturesKHR
-> IO PhysicalDeviceMaintenance6FeaturesKHR
forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDeviceMaintenance6FeaturesKHR
PhysicalDeviceMaintenance6FeaturesKHR
             (Bool32 -> Bool
bool32ToBool Bool32
maintenance6)

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

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


-- | VkPhysicalDeviceMaintenance6PropertiesKHR - Structure describing various
-- implementation-defined properties introduced with VK_KHR_maintenance6
--
-- = Description
--
-- If the 'PhysicalDeviceMaintenance6PropertiesKHR' 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>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceMaintenance6PropertiesKHR = PhysicalDeviceMaintenance6PropertiesKHR
  { -- | @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@.
    PhysicalDeviceMaintenance6PropertiesKHR -> 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/1.3-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion formats that require a sampler Y′CBCR conversion>
    -- supported by the implementation.
    PhysicalDeviceMaintenance6PropertiesKHR -> Word32
maxCombinedImageSamplerDescriptorCount :: Word32
  , -- | @fragmentShadingRateClampCombinerInputs@ is a boolean value indicating
    -- that an implementation clamps the inputs to
    -- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#primsrast-fragment-shading-rate-combining combiner operations>.
    PhysicalDeviceMaintenance6PropertiesKHR -> Bool
fragmentShadingRateClampCombinerInputs :: Bool
  }
  deriving (Typeable, PhysicalDeviceMaintenance6PropertiesKHR
-> PhysicalDeviceMaintenance6PropertiesKHR -> Bool
(PhysicalDeviceMaintenance6PropertiesKHR
 -> PhysicalDeviceMaintenance6PropertiesKHR -> Bool)
-> (PhysicalDeviceMaintenance6PropertiesKHR
    -> PhysicalDeviceMaintenance6PropertiesKHR -> Bool)
-> Eq PhysicalDeviceMaintenance6PropertiesKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceMaintenance6PropertiesKHR
-> PhysicalDeviceMaintenance6PropertiesKHR -> Bool
== :: PhysicalDeviceMaintenance6PropertiesKHR
-> PhysicalDeviceMaintenance6PropertiesKHR -> Bool
$c/= :: PhysicalDeviceMaintenance6PropertiesKHR
-> PhysicalDeviceMaintenance6PropertiesKHR -> Bool
/= :: PhysicalDeviceMaintenance6PropertiesKHR
-> PhysicalDeviceMaintenance6PropertiesKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceMaintenance6PropertiesKHR)
#endif
deriving instance Show PhysicalDeviceMaintenance6PropertiesKHR

instance ToCStruct PhysicalDeviceMaintenance6PropertiesKHR where
  withCStruct :: forall b.
PhysicalDeviceMaintenance6PropertiesKHR
-> (Ptr PhysicalDeviceMaintenance6PropertiesKHR -> IO b) -> IO b
withCStruct PhysicalDeviceMaintenance6PropertiesKHR
x Ptr PhysicalDeviceMaintenance6PropertiesKHR -> IO b
f = Int
-> (Ptr PhysicalDeviceMaintenance6PropertiesKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr PhysicalDeviceMaintenance6PropertiesKHR -> IO b) -> IO b)
-> (Ptr PhysicalDeviceMaintenance6PropertiesKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceMaintenance6PropertiesKHR
p -> Ptr PhysicalDeviceMaintenance6PropertiesKHR
-> PhysicalDeviceMaintenance6PropertiesKHR -> IO b -> IO b
forall b.
Ptr PhysicalDeviceMaintenance6PropertiesKHR
-> PhysicalDeviceMaintenance6PropertiesKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance6PropertiesKHR
p PhysicalDeviceMaintenance6PropertiesKHR
x (Ptr PhysicalDeviceMaintenance6PropertiesKHR -> IO b
f Ptr PhysicalDeviceMaintenance6PropertiesKHR
p)
  pokeCStruct :: forall b.
Ptr PhysicalDeviceMaintenance6PropertiesKHR
-> PhysicalDeviceMaintenance6PropertiesKHR -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance6PropertiesKHR
p PhysicalDeviceMaintenance6PropertiesKHR{Bool
Word32
$sel:blockTexelViewCompatibleMultipleLayers:PhysicalDeviceMaintenance6PropertiesKHR :: PhysicalDeviceMaintenance6PropertiesKHR -> Bool
$sel:maxCombinedImageSamplerDescriptorCount:PhysicalDeviceMaintenance6PropertiesKHR :: PhysicalDeviceMaintenance6PropertiesKHR -> Word32
$sel:fragmentShadingRateClampCombinerInputs:PhysicalDeviceMaintenance6PropertiesKHR :: PhysicalDeviceMaintenance6PropertiesKHR -> 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 PhysicalDeviceMaintenance6PropertiesKHR
p Ptr PhysicalDeviceMaintenance6PropertiesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6PropertiesKHR
p Ptr PhysicalDeviceMaintenance6PropertiesKHR -> 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 PhysicalDeviceMaintenance6PropertiesKHR
p Ptr PhysicalDeviceMaintenance6PropertiesKHR -> 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 PhysicalDeviceMaintenance6PropertiesKHR
p Ptr PhysicalDeviceMaintenance6PropertiesKHR -> 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 PhysicalDeviceMaintenance6PropertiesKHR
p Ptr PhysicalDeviceMaintenance6PropertiesKHR -> 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 PhysicalDeviceMaintenance6PropertiesKHR -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceMaintenance6PropertiesKHR
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6PropertiesKHR
p Ptr PhysicalDeviceMaintenance6PropertiesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6PropertiesKHR
p Ptr PhysicalDeviceMaintenance6PropertiesKHR -> 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 PhysicalDeviceMaintenance6PropertiesKHR
p Ptr PhysicalDeviceMaintenance6PropertiesKHR -> 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 PhysicalDeviceMaintenance6PropertiesKHR
p Ptr PhysicalDeviceMaintenance6PropertiesKHR -> 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 PhysicalDeviceMaintenance6PropertiesKHR
p Ptr PhysicalDeviceMaintenance6PropertiesKHR -> 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 PhysicalDeviceMaintenance6PropertiesKHR where
  peekCStruct :: Ptr PhysicalDeviceMaintenance6PropertiesKHR
-> IO PhysicalDeviceMaintenance6PropertiesKHR
peekCStruct Ptr PhysicalDeviceMaintenance6PropertiesKHR
p = do
    Bool32
blockTexelViewCompatibleMultipleLayers <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceMaintenance6PropertiesKHR
p Ptr PhysicalDeviceMaintenance6PropertiesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    Word32
maxCombinedImageSamplerDescriptorCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceMaintenance6PropertiesKHR
p Ptr PhysicalDeviceMaintenance6PropertiesKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
    Bool32
fragmentShadingRateClampCombinerInputs <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceMaintenance6PropertiesKHR
p Ptr PhysicalDeviceMaintenance6PropertiesKHR -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32))
    PhysicalDeviceMaintenance6PropertiesKHR
-> IO PhysicalDeviceMaintenance6PropertiesKHR
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceMaintenance6PropertiesKHR
 -> IO PhysicalDeviceMaintenance6PropertiesKHR)
-> PhysicalDeviceMaintenance6PropertiesKHR
-> IO PhysicalDeviceMaintenance6PropertiesKHR
forall a b. (a -> b) -> a -> b
$ Bool -> Word32 -> Bool -> PhysicalDeviceMaintenance6PropertiesKHR
PhysicalDeviceMaintenance6PropertiesKHR
             (Bool32 -> Bool
bool32ToBool Bool32
blockTexelViewCompatibleMultipleLayers)
             Word32
maxCombinedImageSamplerDescriptorCount
             (Bool32 -> Bool
bool32ToBool Bool32
fragmentShadingRateClampCombinerInputs)

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

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


-- | VkBindMemoryStatusKHR - 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 'BindMemoryStatusKHR' structure, then the
-- 'BindMemoryStatusKHR'::@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>,
-- 'Vulkan.Core10.Enums.Result.Result',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data BindMemoryStatusKHR = BindMemoryStatusKHR
  { -- | @pResult@ is a pointer to a 'Vulkan.Core10.Enums.Result.Result' value.
    --
    -- #VUID-VkBindMemoryStatusKHR-pResult-parameter# @pResult@ /must/ be a
    -- valid pointer to a 'Vulkan.Core10.Enums.Result.Result' value
    BindMemoryStatusKHR -> Ptr Result
result :: Ptr Result }
  deriving (Typeable, BindMemoryStatusKHR -> BindMemoryStatusKHR -> Bool
(BindMemoryStatusKHR -> BindMemoryStatusKHR -> Bool)
-> (BindMemoryStatusKHR -> BindMemoryStatusKHR -> Bool)
-> Eq BindMemoryStatusKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BindMemoryStatusKHR -> BindMemoryStatusKHR -> Bool
== :: BindMemoryStatusKHR -> BindMemoryStatusKHR -> Bool
$c/= :: BindMemoryStatusKHR -> BindMemoryStatusKHR -> Bool
/= :: BindMemoryStatusKHR -> BindMemoryStatusKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BindMemoryStatusKHR)
#endif
deriving instance Show BindMemoryStatusKHR

instance ToCStruct BindMemoryStatusKHR where
  withCStruct :: forall b.
BindMemoryStatusKHR -> (Ptr BindMemoryStatusKHR -> IO b) -> IO b
withCStruct BindMemoryStatusKHR
x Ptr BindMemoryStatusKHR -> IO b
f = Int -> (Ptr BindMemoryStatusKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr BindMemoryStatusKHR -> IO b) -> IO b)
-> (Ptr BindMemoryStatusKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr BindMemoryStatusKHR
p -> Ptr BindMemoryStatusKHR -> BindMemoryStatusKHR -> IO b -> IO b
forall b.
Ptr BindMemoryStatusKHR -> BindMemoryStatusKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindMemoryStatusKHR
p BindMemoryStatusKHR
x (Ptr BindMemoryStatusKHR -> IO b
f Ptr BindMemoryStatusKHR
p)
  pokeCStruct :: forall b.
Ptr BindMemoryStatusKHR -> BindMemoryStatusKHR -> IO b -> IO b
pokeCStruct Ptr BindMemoryStatusKHR
p BindMemoryStatusKHR{Ptr Result
$sel:result:BindMemoryStatusKHR :: BindMemoryStatusKHR -> Ptr Result
result :: Ptr Result
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindMemoryStatusKHR
p Ptr BindMemoryStatusKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_MEMORY_STATUS_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindMemoryStatusKHR
p Ptr BindMemoryStatusKHR -> 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 BindMemoryStatusKHR
p Ptr BindMemoryStatusKHR -> 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 BindMemoryStatusKHR -> IO b -> IO b
pokeZeroCStruct Ptr BindMemoryStatusKHR
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindMemoryStatusKHR
p Ptr BindMemoryStatusKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_MEMORY_STATUS_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindMemoryStatusKHR
p Ptr BindMemoryStatusKHR -> 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 BindMemoryStatusKHR
p Ptr BindMemoryStatusKHR -> 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 BindMemoryStatusKHR where
  peekCStruct :: Ptr BindMemoryStatusKHR -> IO BindMemoryStatusKHR
peekCStruct Ptr BindMemoryStatusKHR
p = do
    Ptr Result
pResult <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Result) ((Ptr BindMemoryStatusKHR
p Ptr BindMemoryStatusKHR -> Int -> Ptr (Ptr Result)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Result)))
    BindMemoryStatusKHR -> IO BindMemoryStatusKHR
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (BindMemoryStatusKHR -> IO BindMemoryStatusKHR)
-> BindMemoryStatusKHR -> IO BindMemoryStatusKHR
forall a b. (a -> b) -> a -> b
$ Ptr Result -> BindMemoryStatusKHR
BindMemoryStatusKHR
             Ptr Result
pResult

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

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


-- | VkBindDescriptorSetsInfoKHR - 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-VkBindDescriptorSetsInfoKHR-pDescriptorSets-00358# Each
--     element of @pDescriptorSets@ /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-VkBindDescriptorSetsInfoKHR-dynamicOffsetCount-00359#
--     @dynamicOffsetCount@ /must/ be equal to the total number of dynamic
--     descriptors in @pDescriptorSets@
--
-- -   #VUID-VkBindDescriptorSetsInfoKHR-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-VkBindDescriptorSetsInfoKHR-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-VkBindDescriptorSetsInfoKHR-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-VkBindDescriptorSetsInfoKHR-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-VkBindDescriptorSetsInfoKHR-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-VkBindDescriptorSetsInfoKHR-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-VkBindDescriptorSetsInfoKHR-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-VkBindDescriptorSetsInfoKHR-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-VkBindDescriptorSetsInfoKHR-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-VkBindDescriptorSetsInfoKHR-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-VkBindDescriptorSetsInfoKHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO_KHR'
--
-- -   #VUID-VkBindDescriptorSetsInfoKHR-pNext-pNext# @pNext@ /must/ be
--     @NULL@ or a pointer to a valid instance of
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo'
--
-- -   #VUID-VkBindDescriptorSetsInfoKHR-sType-unique# The @sType@ value of
--     each struct in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkBindDescriptorSetsInfoKHR-stageFlags-parameter# @stageFlags@
--     /must/ be a valid combination of
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlagBits' values
--
-- -   #VUID-VkBindDescriptorSetsInfoKHR-stageFlags-requiredbitmask#
--     @stageFlags@ /must/ not be @0@
--
-- -   #VUID-VkBindDescriptorSetsInfoKHR-layout-parameter# If @layout@ is
--     not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @layout@ /must/ be a
--     valid 'Vulkan.Core10.Handles.PipelineLayout' handle
--
-- -   #VUID-VkBindDescriptorSetsInfoKHR-pDescriptorSets-parameter#
--     @pDescriptorSets@ /must/ be a valid pointer to an array of
--     @descriptorSetCount@ valid 'Vulkan.Core10.Handles.DescriptorSet'
--     handles
--
-- -   #VUID-VkBindDescriptorSetsInfoKHR-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-VkBindDescriptorSetsInfoKHR-descriptorSetCount-arraylength#
--     @descriptorSetCount@ /must/ be greater than @0@
--
-- -   #VUID-VkBindDescriptorSetsInfoKHR-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>,
-- 'Vulkan.Core10.Handles.DescriptorSet',
-- 'Vulkan.Core10.Handles.PipelineLayout',
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlags',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdBindDescriptorSets2KHR'
data BindDescriptorSetsInfoKHR (es :: [Type]) = BindDescriptorSetsInfoKHR
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). BindDescriptorSetsInfoKHR 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 :: [*]).
BindDescriptorSetsInfoKHR 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/1.3-extensions/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 :: [*]). BindDescriptorSetsInfoKHR es -> PipelineLayout
layout :: PipelineLayout
  , -- | @firstSet@ is the set number of the first descriptor set to be bound.
    forall (es :: [*]). BindDescriptorSetsInfoKHR 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 :: [*]).
BindDescriptorSetsInfoKHR es -> Vector DescriptorSet
descriptorSets :: Vector DescriptorSet
  , -- | @dynamicOffsetCount@ is the number of dynamic offsets in the
    -- @pDynamicOffsets@ array.
    forall (es :: [*]). BindDescriptorSetsInfoKHR es -> Word32
dynamicOffsetCount :: Word32
  , -- | @pDynamicOffsets@ is a pointer to an array of @uint32_t@ values
    -- specifying dynamic offsets.
    forall (es :: [*]). BindDescriptorSetsInfoKHR es -> Vector Word32
dynamicOffsets :: Vector Word32
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BindDescriptorSetsInfoKHR (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (BindDescriptorSetsInfoKHR es)

instance Extensible BindDescriptorSetsInfoKHR where
  extensibleTypeName :: String
extensibleTypeName = String
"BindDescriptorSetsInfoKHR"
  setNext :: forall (ds :: [*]) (es :: [*]).
BindDescriptorSetsInfoKHR ds
-> Chain es -> BindDescriptorSetsInfoKHR es
setNext BindDescriptorSetsInfoKHR{Word32
Vector Word32
Vector DescriptorSet
ShaderStageFlags
PipelineLayout
Chain ds
$sel:next:BindDescriptorSetsInfoKHR :: forall (es :: [*]). BindDescriptorSetsInfoKHR es -> Chain es
$sel:stageFlags:BindDescriptorSetsInfoKHR :: forall (es :: [*]).
BindDescriptorSetsInfoKHR es -> ShaderStageFlags
$sel:layout:BindDescriptorSetsInfoKHR :: forall (es :: [*]). BindDescriptorSetsInfoKHR es -> PipelineLayout
$sel:firstSet:BindDescriptorSetsInfoKHR :: forall (es :: [*]). BindDescriptorSetsInfoKHR es -> Word32
$sel:descriptorSets:BindDescriptorSetsInfoKHR :: forall (es :: [*]).
BindDescriptorSetsInfoKHR es -> Vector DescriptorSet
$sel:dynamicOffsetCount:BindDescriptorSetsInfoKHR :: forall (es :: [*]). BindDescriptorSetsInfoKHR es -> Word32
$sel:dynamicOffsets:BindDescriptorSetsInfoKHR :: forall (es :: [*]). BindDescriptorSetsInfoKHR es -> Vector Word32
next :: Chain ds
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
firstSet :: Word32
descriptorSets :: Vector DescriptorSet
dynamicOffsetCount :: Word32
dynamicOffsets :: Vector Word32
..} Chain es
next' = BindDescriptorSetsInfoKHR{$sel:next:BindDescriptorSetsInfoKHR :: Chain es
next = Chain es
next', Word32
Vector Word32
Vector DescriptorSet
ShaderStageFlags
PipelineLayout
$sel:stageFlags:BindDescriptorSetsInfoKHR :: ShaderStageFlags
$sel:layout:BindDescriptorSetsInfoKHR :: PipelineLayout
$sel:firstSet:BindDescriptorSetsInfoKHR :: Word32
$sel:descriptorSets:BindDescriptorSetsInfoKHR :: Vector DescriptorSet
$sel:dynamicOffsetCount:BindDescriptorSetsInfoKHR :: Word32
$sel:dynamicOffsets:BindDescriptorSetsInfoKHR :: Vector Word32
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
firstSet :: Word32
descriptorSets :: Vector DescriptorSet
dynamicOffsetCount :: Word32
dynamicOffsets :: Vector Word32
..}
  getNext :: forall (es :: [*]). BindDescriptorSetsInfoKHR es -> Chain es
getNext BindDescriptorSetsInfoKHR{Word32
Vector Word32
Vector DescriptorSet
ShaderStageFlags
PipelineLayout
Chain es
$sel:next:BindDescriptorSetsInfoKHR :: forall (es :: [*]). BindDescriptorSetsInfoKHR es -> Chain es
$sel:stageFlags:BindDescriptorSetsInfoKHR :: forall (es :: [*]).
BindDescriptorSetsInfoKHR es -> ShaderStageFlags
$sel:layout:BindDescriptorSetsInfoKHR :: forall (es :: [*]). BindDescriptorSetsInfoKHR es -> PipelineLayout
$sel:firstSet:BindDescriptorSetsInfoKHR :: forall (es :: [*]). BindDescriptorSetsInfoKHR es -> Word32
$sel:descriptorSets:BindDescriptorSetsInfoKHR :: forall (es :: [*]).
BindDescriptorSetsInfoKHR es -> Vector DescriptorSet
$sel:dynamicOffsetCount:BindDescriptorSetsInfoKHR :: forall (es :: [*]). BindDescriptorSetsInfoKHR es -> Word32
$sel:dynamicOffsets:BindDescriptorSetsInfoKHR :: forall (es :: [*]). BindDescriptorSetsInfoKHR 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 BindDescriptorSetsInfoKHR e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends BindDescriptorSetsInfoKHR e => b) -> Maybe b
extends proxy e
_ Extends BindDescriptorSetsInfoKHR 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 BindDescriptorSetsInfoKHR e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss BindDescriptorSetsInfoKHR es
         , PokeChain es ) => ToCStruct (BindDescriptorSetsInfoKHR es) where
  withCStruct :: forall b.
BindDescriptorSetsInfoKHR es
-> (Ptr (BindDescriptorSetsInfoKHR es) -> IO b) -> IO b
withCStruct BindDescriptorSetsInfoKHR es
x Ptr (BindDescriptorSetsInfoKHR es) -> IO b
f = Int -> (Ptr (BindDescriptorSetsInfoKHR es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
64 ((Ptr (BindDescriptorSetsInfoKHR es) -> IO b) -> IO b)
-> (Ptr (BindDescriptorSetsInfoKHR es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (BindDescriptorSetsInfoKHR es)
p -> Ptr (BindDescriptorSetsInfoKHR es)
-> BindDescriptorSetsInfoKHR es -> IO b -> IO b
forall b.
Ptr (BindDescriptorSetsInfoKHR es)
-> BindDescriptorSetsInfoKHR es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (BindDescriptorSetsInfoKHR es)
p BindDescriptorSetsInfoKHR es
x (Ptr (BindDescriptorSetsInfoKHR es) -> IO b
f Ptr (BindDescriptorSetsInfoKHR es)
p)
  pokeCStruct :: forall b.
Ptr (BindDescriptorSetsInfoKHR es)
-> BindDescriptorSetsInfoKHR es -> IO b -> IO b
pokeCStruct Ptr (BindDescriptorSetsInfoKHR es)
p BindDescriptorSetsInfoKHR{Word32
Vector Word32
Vector DescriptorSet
ShaderStageFlags
PipelineLayout
Chain es
$sel:next:BindDescriptorSetsInfoKHR :: forall (es :: [*]). BindDescriptorSetsInfoKHR es -> Chain es
$sel:stageFlags:BindDescriptorSetsInfoKHR :: forall (es :: [*]).
BindDescriptorSetsInfoKHR es -> ShaderStageFlags
$sel:layout:BindDescriptorSetsInfoKHR :: forall (es :: [*]). BindDescriptorSetsInfoKHR es -> PipelineLayout
$sel:firstSet:BindDescriptorSetsInfoKHR :: forall (es :: [*]). BindDescriptorSetsInfoKHR es -> Word32
$sel:descriptorSets:BindDescriptorSetsInfoKHR :: forall (es :: [*]).
BindDescriptorSetsInfoKHR es -> Vector DescriptorSet
$sel:dynamicOffsetCount:BindDescriptorSetsInfoKHR :: forall (es :: [*]). BindDescriptorSetsInfoKHR es -> Word32
$sel:dynamicOffsets:BindDescriptorSetsInfoKHR :: forall (es :: [*]). BindDescriptorSetsInfoKHR 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 (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO_KHR)
    Ptr ()
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)
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
    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 ShaderStageFlags -> ShaderStageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ShaderStageFlags)) (ShaderStageFlags
stageFlags)
    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 PipelineLayout -> PipelineLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr PipelineLayout)) (PipelineLayout
layout)
    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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Word32
firstSet)
    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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector DescriptorSet -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector DescriptorSet -> Int) -> Vector DescriptorSet -> Int
forall a b. (a -> b) -> a -> b
$ (Vector DescriptorSet
descriptorSets)) :: Word32))
    Ptr DescriptorSet
pPDescriptorSets' <- ((Ptr DescriptorSet -> IO b) -> IO b)
-> ContT b IO (Ptr DescriptorSet)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr DescriptorSet -> IO b) -> IO b)
 -> ContT b IO (Ptr DescriptorSet))
-> ((Ptr DescriptorSet -> IO b) -> IO b)
-> ContT b IO (Ptr DescriptorSet)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @DescriptorSet ((Vector DescriptorSet -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector DescriptorSet
descriptorSets)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
8)
    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
$ (Int -> DescriptorSet -> IO ()) -> Vector DescriptorSet -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
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)) (Vector DescriptorSet
descriptorSets)
    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 (Ptr DescriptorSet) -> Ptr DescriptorSet -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es)
-> Int -> Ptr (Ptr DescriptorSet)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr DescriptorSet))) (Ptr DescriptorSet
pPDescriptorSets')
    let pDynamicOffsetsLength :: Int
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)
    Word32
dynamicOffsetCount'' <- IO Word32 -> ContT b IO Word32
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 Word32 -> ContT b IO Word32) -> IO Word32 -> ContT b IO Word32
forall a b. (a -> b) -> a -> b
$ if (Word32
dynamicOffsetCount) Word32 -> Word32 -> Bool
forall a. Eq a => a -> a -> Bool
== Word32
0
      then Word32 -> IO Word32
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Word32 -> IO Word32) -> Word32 -> IO Word32
forall a b. (a -> b) -> a -> b
$ Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pDynamicOffsetsLength
      else do
        Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pDynamicOffsetsLength Word32 -> Word32 -> Bool
forall a. Eq a => a -> a -> Bool
== (Word32
dynamicOffsetCount) Bool -> Bool -> Bool
|| Int
pDynamicOffsetsLength Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
0) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
          IOException -> IO ()
forall e a. 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
"pDynamicOffsets must be empty or have 'dynamicOffsetCount' elements" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
        Word32 -> IO Word32
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Word32
dynamicOffsetCount)
    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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word32)) (Word32
dynamicOffsetCount'')
    Ptr Word32
pDynamicOffsets'' <- if Vector Word32 -> Bool
forall a. Vector a -> Bool
Data.Vector.null (Vector Word32
dynamicOffsets)
      then Ptr Word32 -> ContT b IO (Ptr Word32)
forall a. a -> ContT b IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr Word32
forall a. Ptr a
nullPtr
      else do
        Ptr Word32
pPDynamicOffsets <- ((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32))
-> ((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Word32 (((Vector Word32 -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Word32
dynamicOffsets))) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
4)
        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
$ (Int -> Word32 -> IO ()) -> Vector Word32 -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
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)) ((Vector Word32
dynamicOffsets))
        Ptr Word32 -> ContT b IO (Ptr Word32)
forall a. a -> ContT b IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Ptr Word32 -> ContT b IO (Ptr Word32))
-> Ptr Word32 -> ContT b IO (Ptr Word32)
forall a b. (a -> b) -> a -> b
$ Ptr Word32
pPDynamicOffsets
    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 (Ptr Word32) -> Ptr Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr (Ptr Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr (Ptr Word32))) Ptr Word32
pDynamicOffsets''
    IO b -> ContT b IO b
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 b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
64
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (BindDescriptorSetsInfoKHR es) -> IO b -> IO b
pokeZeroCStruct Ptr (BindDescriptorSetsInfoKHR 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 (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO_KHR)
    Ptr ()
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
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
    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 ShaderStageFlags -> ShaderStageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ShaderStageFlags)) (ShaderStageFlags
forall a. Zero a => a
zero)
    IO b -> ContT b IO b
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 b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance ( Extendss BindDescriptorSetsInfoKHR es
         , PeekChain es ) => FromCStruct (BindDescriptorSetsInfoKHR es) where
  peekCStruct :: Ptr (BindDescriptorSetsInfoKHR es)
-> IO (BindDescriptorSetsInfoKHR es)
peekCStruct Ptr (BindDescriptorSetsInfoKHR es)
p = do
    Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    Chain es
next <- Ptr (Chain es) -> IO (Chain es)
forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (Ptr () -> Ptr (Chain es)
forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
    ShaderStageFlags
stageFlags <- forall a. Storable a => Ptr a -> IO a
peek @ShaderStageFlags ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ShaderStageFlags))
    PipelineLayout
layout <- forall a. Storable a => Ptr a -> IO a
peek @PipelineLayout ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr PipelineLayout))
    Word32
firstSet <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32))
    Word32
descriptorSetCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Word32))
    Ptr DescriptorSet
pDescriptorSets <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr DescriptorSet) ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es)
-> Int -> Ptr (Ptr DescriptorSet)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr DescriptorSet)))
    Vector DescriptorSet
pDescriptorSets' <- Int -> (Int -> IO DescriptorSet) -> IO (Vector DescriptorSet)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
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)))
    Word32
dynamicOffsetCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word32))
    Ptr Word32
pDynamicOffsets <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) ((Ptr (BindDescriptorSetsInfoKHR es)
p Ptr (BindDescriptorSetsInfoKHR es) -> Int -> Ptr (Ptr Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr (Ptr Word32)))
    let pDynamicOffsetsLength :: Int
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)
    Vector Word32
pDynamicOffsets' <- Int -> (Int -> IO Word32) -> IO (Vector Word32)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM Int
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)))
    BindDescriptorSetsInfoKHR es -> IO (BindDescriptorSetsInfoKHR es)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (BindDescriptorSetsInfoKHR es -> IO (BindDescriptorSetsInfoKHR es))
-> BindDescriptorSetsInfoKHR es
-> IO (BindDescriptorSetsInfoKHR es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector DescriptorSet
-> Word32
-> Vector Word32
-> BindDescriptorSetsInfoKHR es
forall (es :: [*]).
Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector DescriptorSet
-> Word32
-> Vector Word32
-> BindDescriptorSetsInfoKHR es
BindDescriptorSetsInfoKHR
             Chain es
next
             ShaderStageFlags
stageFlags
             PipelineLayout
layout
             Word32
firstSet
             Vector DescriptorSet
pDescriptorSets'
             Word32
dynamicOffsetCount
             Vector Word32
pDynamicOffsets'

instance es ~ '[] => Zero (BindDescriptorSetsInfoKHR es) where
  zero :: BindDescriptorSetsInfoKHR es
zero = Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector DescriptorSet
-> Word32
-> Vector Word32
-> BindDescriptorSetsInfoKHR es
forall (es :: [*]).
Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector DescriptorSet
-> Word32
-> Vector Word32
-> BindDescriptorSetsInfoKHR es
BindDescriptorSetsInfoKHR
           ()
           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


-- | VkPushConstantsInfoKHR - Structure specifying a push constant update
-- operation
--
-- == Valid Usage
--
-- -   #VUID-VkPushConstantsInfoKHR-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-VkPushConstantsInfoKHR-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-VkPushConstantsInfoKHR-offset-00368# @offset@ /must/ be a
--     multiple of @4@
--
-- -   #VUID-VkPushConstantsInfoKHR-size-00369# @size@ /must/ be a multiple
--     of @4@
--
-- -   #VUID-VkPushConstantsInfoKHR-offset-00370# @offset@ /must/ be less
--     than
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@maxPushConstantsSize@
--
-- -   #VUID-VkPushConstantsInfoKHR-size-00371# @size@ /must/ be less than
--     or equal to
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@maxPushConstantsSize@
--     minus @offset@
--
-- -   #VUID-VkPushConstantsInfoKHR-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-VkPushConstantsInfoKHR-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-VkPushConstantsInfoKHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PUSH_CONSTANTS_INFO_KHR'
--
-- -   #VUID-VkPushConstantsInfoKHR-pNext-pNext# @pNext@ /must/ be @NULL@
--     or a pointer to a valid instance of
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo'
--
-- -   #VUID-VkPushConstantsInfoKHR-sType-unique# The @sType@ value of each
--     struct in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkPushConstantsInfoKHR-layout-parameter# If @layout@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @layout@ /must/ be a valid
--     'Vulkan.Core10.Handles.PipelineLayout' handle
--
-- -   #VUID-VkPushConstantsInfoKHR-stageFlags-parameter# @stageFlags@
--     /must/ be a valid combination of
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlagBits' values
--
-- -   #VUID-VkPushConstantsInfoKHR-stageFlags-requiredbitmask#
--     @stageFlags@ /must/ not be @0@
--
-- -   #VUID-VkPushConstantsInfoKHR-pValues-parameter# @pValues@ /must/ be
--     a valid pointer to an array of @size@ bytes
--
-- -   #VUID-VkPushConstantsInfoKHR-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>,
-- 'Vulkan.Core10.Handles.PipelineLayout',
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlags',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdPushConstants2KHR'
data PushConstantsInfoKHR (es :: [Type]) = PushConstantsInfoKHR
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). PushConstantsInfoKHR 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/1.3-extensions/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 :: [*]). PushConstantsInfoKHR 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 :: [*]). PushConstantsInfoKHR es -> ShaderStageFlags
stageFlags :: ShaderStageFlags
  , -- | @offset@ is the start offset of the push constant range to update, in
    -- units of bytes.
    forall (es :: [*]). PushConstantsInfoKHR es -> Word32
offset :: Word32
  , -- | @size@ is the size of the push constant range to update, in units of
    -- bytes.
    forall (es :: [*]). PushConstantsInfoKHR es -> Word32
size :: Word32
  , -- | @pValues@ is a pointer to an array of @size@ bytes containing the new
    -- push constant values.
    forall (es :: [*]). PushConstantsInfoKHR es -> Ptr ()
values :: Ptr ()
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PushConstantsInfoKHR (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (PushConstantsInfoKHR es)

instance Extensible PushConstantsInfoKHR where
  extensibleTypeName :: String
extensibleTypeName = String
"PushConstantsInfoKHR"
  setNext :: forall (ds :: [*]) (es :: [*]).
PushConstantsInfoKHR ds -> Chain es -> PushConstantsInfoKHR es
setNext PushConstantsInfoKHR{Word32
Ptr ()
ShaderStageFlags
PipelineLayout
Chain ds
$sel:next:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR es -> Chain es
$sel:layout:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR es -> PipelineLayout
$sel:stageFlags:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR es -> ShaderStageFlags
$sel:offset:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR es -> Word32
$sel:size:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR es -> Word32
$sel:values:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR es -> Ptr ()
next :: Chain ds
layout :: PipelineLayout
stageFlags :: ShaderStageFlags
offset :: Word32
size :: Word32
values :: Ptr ()
..} Chain es
next' = PushConstantsInfoKHR{$sel:next:PushConstantsInfoKHR :: Chain es
next = Chain es
next', Word32
Ptr ()
ShaderStageFlags
PipelineLayout
$sel:layout:PushConstantsInfoKHR :: PipelineLayout
$sel:stageFlags:PushConstantsInfoKHR :: ShaderStageFlags
$sel:offset:PushConstantsInfoKHR :: Word32
$sel:size:PushConstantsInfoKHR :: Word32
$sel:values:PushConstantsInfoKHR :: Ptr ()
layout :: PipelineLayout
stageFlags :: ShaderStageFlags
offset :: Word32
size :: Word32
values :: Ptr ()
..}
  getNext :: forall (es :: [*]). PushConstantsInfoKHR es -> Chain es
getNext PushConstantsInfoKHR{Word32
Ptr ()
ShaderStageFlags
PipelineLayout
Chain es
$sel:next:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR es -> Chain es
$sel:layout:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR es -> PipelineLayout
$sel:stageFlags:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR es -> ShaderStageFlags
$sel:offset:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR es -> Word32
$sel:size:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR es -> Word32
$sel:values:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR 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 PushConstantsInfoKHR e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends PushConstantsInfoKHR e => b) -> Maybe b
extends proxy e
_ Extends PushConstantsInfoKHR 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 PushConstantsInfoKHR e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss PushConstantsInfoKHR es
         , PokeChain es ) => ToCStruct (PushConstantsInfoKHR es) where
  withCStruct :: forall b.
PushConstantsInfoKHR es
-> (Ptr (PushConstantsInfoKHR es) -> IO b) -> IO b
withCStruct PushConstantsInfoKHR es
x Ptr (PushConstantsInfoKHR es) -> IO b
f = Int -> (Ptr (PushConstantsInfoKHR es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr (PushConstantsInfoKHR es) -> IO b) -> IO b)
-> (Ptr (PushConstantsInfoKHR es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (PushConstantsInfoKHR es)
p -> Ptr (PushConstantsInfoKHR es)
-> PushConstantsInfoKHR es -> IO b -> IO b
forall b.
Ptr (PushConstantsInfoKHR es)
-> PushConstantsInfoKHR es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (PushConstantsInfoKHR es)
p PushConstantsInfoKHR es
x (Ptr (PushConstantsInfoKHR es) -> IO b
f Ptr (PushConstantsInfoKHR es)
p)
  pokeCStruct :: forall b.
Ptr (PushConstantsInfoKHR es)
-> PushConstantsInfoKHR es -> IO b -> IO b
pokeCStruct Ptr (PushConstantsInfoKHR es)
p PushConstantsInfoKHR{Word32
Ptr ()
ShaderStageFlags
PipelineLayout
Chain es
$sel:next:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR es -> Chain es
$sel:layout:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR es -> PipelineLayout
$sel:stageFlags:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR es -> ShaderStageFlags
$sel:offset:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR es -> Word32
$sel:size:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR es -> Word32
$sel:values:PushConstantsInfoKHR :: forall (es :: [*]). PushConstantsInfoKHR 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 (PushConstantsInfoKHR es)
p Ptr (PushConstantsInfoKHR es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PUSH_CONSTANTS_INFO_KHR)
    Ptr ()
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)
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushConstantsInfoKHR es)
p Ptr (PushConstantsInfoKHR es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
    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 PipelineLayout -> PipelineLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushConstantsInfoKHR es)
p Ptr (PushConstantsInfoKHR es) -> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineLayout)) (PipelineLayout
layout)
    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 ShaderStageFlags -> ShaderStageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushConstantsInfoKHR es)
p Ptr (PushConstantsInfoKHR es) -> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ShaderStageFlags)) (ShaderStageFlags
stageFlags)
    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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushConstantsInfoKHR es)
p Ptr (PushConstantsInfoKHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) (Word32
offset)
    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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushConstantsInfoKHR es)
p Ptr (PushConstantsInfoKHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Word32
size)
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushConstantsInfoKHR es)
p Ptr (PushConstantsInfoKHR es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr ()))) (Ptr ()
values)
    IO b -> ContT b IO b
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 b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
48
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (PushConstantsInfoKHR es) -> IO b -> IO b
pokeZeroCStruct Ptr (PushConstantsInfoKHR 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 (PushConstantsInfoKHR es)
p Ptr (PushConstantsInfoKHR es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PUSH_CONSTANTS_INFO_KHR)
    Ptr ()
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
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushConstantsInfoKHR es)
p Ptr (PushConstantsInfoKHR es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
    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 ShaderStageFlags -> ShaderStageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushConstantsInfoKHR es)
p Ptr (PushConstantsInfoKHR es) -> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ShaderStageFlags)) (ShaderStageFlags
forall a. Zero a => a
zero)
    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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushConstantsInfoKHR es)
p Ptr (PushConstantsInfoKHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushConstantsInfoKHR es)
p Ptr (PushConstantsInfoKHR es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr ()))) (Ptr ()
forall a. Zero a => a
zero)
    IO b -> ContT b IO b
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 b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

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

instance es ~ '[] => Zero (PushConstantsInfoKHR es) where
  zero :: PushConstantsInfoKHR es
zero = Chain es
-> PipelineLayout
-> ShaderStageFlags
-> Word32
-> Word32
-> Ptr ()
-> PushConstantsInfoKHR es
forall (es :: [*]).
Chain es
-> PipelineLayout
-> ShaderStageFlags
-> Word32
-> Word32
-> Ptr ()
-> PushConstantsInfoKHR es
PushConstantsInfoKHR
           ()
           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


-- | VkPushDescriptorSetInfoKHR - 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-VkPushDescriptorSetInfoKHR-set-00364# @set@ /must/ be less
--     than
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo'::@setLayoutCount@
--     provided when @layout@ was created
--
-- -   #VUID-VkPushDescriptorSetInfoKHR-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_KHR'
--
-- -   #VUID-VkPushDescriptorSetInfoKHR-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-VkPushDescriptorSetInfoKHR-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-VkPushDescriptorSetInfoKHR-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-VkPushDescriptorSetInfoKHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO_KHR'
--
-- -   #VUID-VkPushDescriptorSetInfoKHR-pNext-pNext# @pNext@ /must/ be
--     @NULL@ or a pointer to a valid instance of
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo'
--
-- -   #VUID-VkPushDescriptorSetInfoKHR-sType-unique# The @sType@ value of
--     each struct in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkPushDescriptorSetInfoKHR-stageFlags-parameter# @stageFlags@
--     /must/ be a valid combination of
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlagBits' values
--
-- -   #VUID-VkPushDescriptorSetInfoKHR-stageFlags-requiredbitmask#
--     @stageFlags@ /must/ not be @0@
--
-- -   #VUID-VkPushDescriptorSetInfoKHR-layout-parameter# If @layout@ is
--     not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @layout@ /must/ be a
--     valid 'Vulkan.Core10.Handles.PipelineLayout' handle
--
-- -   #VUID-VkPushDescriptorSetInfoKHR-pDescriptorWrites-parameter#
--     @pDescriptorWrites@ /must/ be a valid pointer to an array of
--     @descriptorWriteCount@ valid
--     'Vulkan.Core10.DescriptorSet.WriteDescriptorSet' structures
--
-- -   #VUID-VkPushDescriptorSetInfoKHR-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>,
-- 'Vulkan.Core10.Handles.PipelineLayout',
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlags',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Core10.DescriptorSet.WriteDescriptorSet',
-- 'cmdPushDescriptorSet2KHR'
data PushDescriptorSetInfoKHR (es :: [Type]) = PushDescriptorSetInfoKHR
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). PushDescriptorSetInfoKHR 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 :: [*]). PushDescriptorSetInfoKHR 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/1.3-extensions/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 :: [*]). PushDescriptorSetInfoKHR es -> PipelineLayout
layout :: PipelineLayout
  , -- | @set@ is the set number of the descriptor set in the pipeline layout
    -- that will be updated.
    forall (es :: [*]). PushDescriptorSetInfoKHR 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 :: [*]).
PushDescriptorSetInfoKHR es
-> Vector (SomeStruct WriteDescriptorSet)
descriptorWrites :: Vector (SomeStruct WriteDescriptorSet)
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PushDescriptorSetInfoKHR (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (PushDescriptorSetInfoKHR es)

instance Extensible PushDescriptorSetInfoKHR where
  extensibleTypeName :: String
extensibleTypeName = String
"PushDescriptorSetInfoKHR"
  setNext :: forall (ds :: [*]) (es :: [*]).
PushDescriptorSetInfoKHR ds
-> Chain es -> PushDescriptorSetInfoKHR es
setNext PushDescriptorSetInfoKHR{Word32
Vector (SomeStruct WriteDescriptorSet)
ShaderStageFlags
PipelineLayout
Chain ds
$sel:next:PushDescriptorSetInfoKHR :: forall (es :: [*]). PushDescriptorSetInfoKHR es -> Chain es
$sel:stageFlags:PushDescriptorSetInfoKHR :: forall (es :: [*]). PushDescriptorSetInfoKHR es -> ShaderStageFlags
$sel:layout:PushDescriptorSetInfoKHR :: forall (es :: [*]). PushDescriptorSetInfoKHR es -> PipelineLayout
$sel:set:PushDescriptorSetInfoKHR :: forall (es :: [*]). PushDescriptorSetInfoKHR es -> Word32
$sel:descriptorWrites:PushDescriptorSetInfoKHR :: forall (es :: [*]).
PushDescriptorSetInfoKHR es
-> Vector (SomeStruct WriteDescriptorSet)
next :: Chain ds
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
set :: Word32
descriptorWrites :: Vector (SomeStruct WriteDescriptorSet)
..} Chain es
next' = PushDescriptorSetInfoKHR{$sel:next:PushDescriptorSetInfoKHR :: Chain es
next = Chain es
next', Word32
Vector (SomeStruct WriteDescriptorSet)
ShaderStageFlags
PipelineLayout
$sel:stageFlags:PushDescriptorSetInfoKHR :: ShaderStageFlags
$sel:layout:PushDescriptorSetInfoKHR :: PipelineLayout
$sel:set:PushDescriptorSetInfoKHR :: Word32
$sel:descriptorWrites:PushDescriptorSetInfoKHR :: Vector (SomeStruct WriteDescriptorSet)
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
set :: Word32
descriptorWrites :: Vector (SomeStruct WriteDescriptorSet)
..}
  getNext :: forall (es :: [*]). PushDescriptorSetInfoKHR es -> Chain es
getNext PushDescriptorSetInfoKHR{Word32
Vector (SomeStruct WriteDescriptorSet)
ShaderStageFlags
PipelineLayout
Chain es
$sel:next:PushDescriptorSetInfoKHR :: forall (es :: [*]). PushDescriptorSetInfoKHR es -> Chain es
$sel:stageFlags:PushDescriptorSetInfoKHR :: forall (es :: [*]). PushDescriptorSetInfoKHR es -> ShaderStageFlags
$sel:layout:PushDescriptorSetInfoKHR :: forall (es :: [*]). PushDescriptorSetInfoKHR es -> PipelineLayout
$sel:set:PushDescriptorSetInfoKHR :: forall (es :: [*]). PushDescriptorSetInfoKHR es -> Word32
$sel:descriptorWrites:PushDescriptorSetInfoKHR :: forall (es :: [*]).
PushDescriptorSetInfoKHR 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 PushDescriptorSetInfoKHR e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends PushDescriptorSetInfoKHR e => b) -> Maybe b
extends proxy e
_ Extends PushDescriptorSetInfoKHR 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 PushDescriptorSetInfoKHR e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss PushDescriptorSetInfoKHR es
         , PokeChain es ) => ToCStruct (PushDescriptorSetInfoKHR es) where
  withCStruct :: forall b.
PushDescriptorSetInfoKHR es
-> (Ptr (PushDescriptorSetInfoKHR es) -> IO b) -> IO b
withCStruct PushDescriptorSetInfoKHR es
x Ptr (PushDescriptorSetInfoKHR es) -> IO b
f = Int -> (Ptr (PushDescriptorSetInfoKHR es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr (PushDescriptorSetInfoKHR es) -> IO b) -> IO b)
-> (Ptr (PushDescriptorSetInfoKHR es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (PushDescriptorSetInfoKHR es)
p -> Ptr (PushDescriptorSetInfoKHR es)
-> PushDescriptorSetInfoKHR es -> IO b -> IO b
forall b.
Ptr (PushDescriptorSetInfoKHR es)
-> PushDescriptorSetInfoKHR es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (PushDescriptorSetInfoKHR es)
p PushDescriptorSetInfoKHR es
x (Ptr (PushDescriptorSetInfoKHR es) -> IO b
f Ptr (PushDescriptorSetInfoKHR es)
p)
  pokeCStruct :: forall b.
Ptr (PushDescriptorSetInfoKHR es)
-> PushDescriptorSetInfoKHR es -> IO b -> IO b
pokeCStruct Ptr (PushDescriptorSetInfoKHR es)
p PushDescriptorSetInfoKHR{Word32
Vector (SomeStruct WriteDescriptorSet)
ShaderStageFlags
PipelineLayout
Chain es
$sel:next:PushDescriptorSetInfoKHR :: forall (es :: [*]). PushDescriptorSetInfoKHR es -> Chain es
$sel:stageFlags:PushDescriptorSetInfoKHR :: forall (es :: [*]). PushDescriptorSetInfoKHR es -> ShaderStageFlags
$sel:layout:PushDescriptorSetInfoKHR :: forall (es :: [*]). PushDescriptorSetInfoKHR es -> PipelineLayout
$sel:set:PushDescriptorSetInfoKHR :: forall (es :: [*]). PushDescriptorSetInfoKHR es -> Word32
$sel:descriptorWrites:PushDescriptorSetInfoKHR :: forall (es :: [*]).
PushDescriptorSetInfoKHR 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 (PushDescriptorSetInfoKHR es)
p Ptr (PushDescriptorSetInfoKHR es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO_KHR)
    Ptr ()
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)
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetInfoKHR es)
p Ptr (PushDescriptorSetInfoKHR es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
    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 ShaderStageFlags -> ShaderStageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetInfoKHR es)
p Ptr (PushDescriptorSetInfoKHR es) -> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ShaderStageFlags)) (ShaderStageFlags
stageFlags)
    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 PipelineLayout -> PipelineLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetInfoKHR es)
p Ptr (PushDescriptorSetInfoKHR es) -> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr PipelineLayout)) (PipelineLayout
layout)
    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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetInfoKHR es)
p Ptr (PushDescriptorSetInfoKHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Word32
set)
    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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetInfoKHR es)
p Ptr (PushDescriptorSetInfoKHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector (SomeStruct WriteDescriptorSet) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct WriteDescriptorSet) -> Int)
-> Vector (SomeStruct WriteDescriptorSet) -> Int
forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct WriteDescriptorSet)
descriptorWrites)) :: Word32))
    Ptr (WriteDescriptorSet Any)
pPDescriptorWrites' <- ((Ptr (WriteDescriptorSet Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (WriteDescriptorSet Any))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (WriteDescriptorSet Any) -> IO b) -> IO b)
 -> ContT b IO (Ptr (WriteDescriptorSet Any)))
-> ((Ptr (WriteDescriptorSet Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (WriteDescriptorSet Any))
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(WriteDescriptorSet _) ((Vector (SomeStruct WriteDescriptorSet) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct WriteDescriptorSet)
descriptorWrites)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
64)
    (Int -> SomeStruct WriteDescriptorSet -> ContT b IO ())
-> Vector (SomeStruct WriteDescriptorSet) -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
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 Any) -> Ptr (SomeStruct WriteDescriptorSet)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (WriteDescriptorSet Any)
pPDescriptorWrites' Ptr (WriteDescriptorSet Any) -> 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
$ ())) (Vector (SomeStruct WriteDescriptorSet)
descriptorWrites)
    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 (Ptr (WriteDescriptorSet Any))
-> Ptr (WriteDescriptorSet Any) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetInfoKHR es)
p Ptr (PushDescriptorSetInfoKHR es)
-> Int -> Ptr (Ptr (WriteDescriptorSet w))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr (WriteDescriptorSet _)))) (Ptr (WriteDescriptorSet Any)
pPDescriptorWrites')
    IO b -> ContT b IO b
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 b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
48
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (PushDescriptorSetInfoKHR es) -> IO b -> IO b
pokeZeroCStruct Ptr (PushDescriptorSetInfoKHR 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 (PushDescriptorSetInfoKHR es)
p Ptr (PushDescriptorSetInfoKHR es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO_KHR)
    Ptr ()
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
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetInfoKHR es)
p Ptr (PushDescriptorSetInfoKHR es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
    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 ShaderStageFlags -> ShaderStageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetInfoKHR es)
p Ptr (PushDescriptorSetInfoKHR es) -> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ShaderStageFlags)) (ShaderStageFlags
forall a. Zero a => a
zero)
    IO b -> ContT b IO b
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 b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance ( Extendss PushDescriptorSetInfoKHR es
         , PeekChain es ) => FromCStruct (PushDescriptorSetInfoKHR es) where
  peekCStruct :: Ptr (PushDescriptorSetInfoKHR es)
-> IO (PushDescriptorSetInfoKHR es)
peekCStruct Ptr (PushDescriptorSetInfoKHR es)
p = do
    Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PushDescriptorSetInfoKHR es)
p Ptr (PushDescriptorSetInfoKHR es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    Chain es
next <- Ptr (Chain es) -> IO (Chain es)
forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (Ptr () -> Ptr (Chain es)
forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
    ShaderStageFlags
stageFlags <- forall a. Storable a => Ptr a -> IO a
peek @ShaderStageFlags ((Ptr (PushDescriptorSetInfoKHR es)
p Ptr (PushDescriptorSetInfoKHR es) -> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ShaderStageFlags))
    PipelineLayout
layout <- forall a. Storable a => Ptr a -> IO a
peek @PipelineLayout ((Ptr (PushDescriptorSetInfoKHR es)
p Ptr (PushDescriptorSetInfoKHR es) -> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr PipelineLayout))
    Word32
set <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (PushDescriptorSetInfoKHR es)
p Ptr (PushDescriptorSetInfoKHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32))
    Word32
descriptorWriteCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (PushDescriptorSetInfoKHR es)
p Ptr (PushDescriptorSetInfoKHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Word32))
    Ptr (WriteDescriptorSet Any)
pDescriptorWrites <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (WriteDescriptorSet _)) ((Ptr (PushDescriptorSetInfoKHR es)
p Ptr (PushDescriptorSetInfoKHR es)
-> Int -> Ptr (Ptr (WriteDescriptorSet w))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr (WriteDescriptorSet _))))
    Vector (SomeStruct WriteDescriptorSet)
pDescriptorWrites' <- Int
-> (Int -> IO (SomeStruct WriteDescriptorSet))
-> IO (Vector (SomeStruct WriteDescriptorSet))
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
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 Any) -> Ptr (SomeStruct WriteDescriptorSet)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (WriteDescriptorSet Any)
pDescriptorWrites Ptr (WriteDescriptorSet Any) -> Int -> Ptr (WriteDescriptorSet Any)
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
64 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (WriteDescriptorSet _)))))
    PushDescriptorSetInfoKHR es -> IO (PushDescriptorSetInfoKHR es)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PushDescriptorSetInfoKHR es -> IO (PushDescriptorSetInfoKHR es))
-> PushDescriptorSetInfoKHR es -> IO (PushDescriptorSetInfoKHR es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector (SomeStruct WriteDescriptorSet)
-> PushDescriptorSetInfoKHR es
forall (es :: [*]).
Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector (SomeStruct WriteDescriptorSet)
-> PushDescriptorSetInfoKHR es
PushDescriptorSetInfoKHR
             Chain es
next ShaderStageFlags
stageFlags PipelineLayout
layout Word32
set Vector (SomeStruct WriteDescriptorSet)
pDescriptorWrites'

instance es ~ '[] => Zero (PushDescriptorSetInfoKHR es) where
  zero :: PushDescriptorSetInfoKHR es
zero = Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector (SomeStruct WriteDescriptorSet)
-> PushDescriptorSetInfoKHR es
forall (es :: [*]).
Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector (SomeStruct WriteDescriptorSet)
-> PushDescriptorSetInfoKHR es
PushDescriptorSetInfoKHR
           ()
           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


-- | VkPushDescriptorSetWithTemplateInfoKHR - Structure specifying a
-- descriptor set push operation using a descriptor update template
--
-- == Valid Usage
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfoKHR-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-VkPushDescriptorSetWithTemplateInfoKHR-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-VkPushDescriptorSetWithTemplateInfoKHR-layout-07993# @layout@
--     /must/ be compatible with the layout used to create
--     @descriptorUpdateTemplate@
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfoKHR-descriptorUpdateTemplate-07994#
--     @descriptorUpdateTemplate@ /must/ have been created with a
--     @templateType@ of
--     'Vulkan.Core11.Enums.DescriptorUpdateTemplateType.DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR'
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfoKHR-set-07995# @set@ /must/
--     be the same value used to create @descriptorUpdateTemplate@
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfoKHR-set-07304# @set@ /must/
--     be less than
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo'::@setLayoutCount@
--     provided when @layout@ was created
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfoKHR-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_KHR'
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfoKHR-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-VkPushDescriptorSetWithTemplateInfoKHR-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-VkPushDescriptorSetWithTemplateInfoKHR-sType-sType# @sType@
--     /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO_KHR'
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfoKHR-pNext-pNext# @pNext@
--     /must/ be @NULL@ or a pointer to a valid instance of
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo'
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfoKHR-sType-unique# The
--     @sType@ value of each struct in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfoKHR-descriptorUpdateTemplate-parameter#
--     @descriptorUpdateTemplate@ /must/ be a valid
--     'Vulkan.Core11.Handles.DescriptorUpdateTemplate' handle
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfoKHR-layout-parameter# If
--     @layout@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @layout@
--     /must/ be a valid 'Vulkan.Core10.Handles.PipelineLayout' handle
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfoKHR-pData-parameter#
--     @pData@ /must/ be a pointer value
--
-- -   #VUID-VkPushDescriptorSetWithTemplateInfoKHR-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>,
-- 'Vulkan.Core11.Handles.DescriptorUpdateTemplate',
-- 'Vulkan.Core10.Handles.PipelineLayout',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdPushDescriptorSetWithTemplate2KHR'
data PushDescriptorSetWithTemplateInfoKHR (es :: [Type]) = PushDescriptorSetWithTemplateInfoKHR
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR es -> Chain es
next :: Chain es
  , -- | @descriptorUpdateTemplate@ is a descriptor update template defining how
    -- to interpret the descriptor information in @pData@.
    forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR 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/1.3-extensions/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 :: [*]).
PushDescriptorSetWithTemplateInfoKHR 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 :: [*]).
PushDescriptorSetWithTemplateInfoKHR es -> Word32
set :: Word32
  , -- | @pData@ is a pointer to memory containing descriptors for the templated
    -- update.
    forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR es -> Ptr ()
data' :: Ptr ()
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PushDescriptorSetWithTemplateInfoKHR (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (PushDescriptorSetWithTemplateInfoKHR es)

instance Extensible PushDescriptorSetWithTemplateInfoKHR where
  extensibleTypeName :: String
extensibleTypeName = String
"PushDescriptorSetWithTemplateInfoKHR"
  setNext :: forall (ds :: [*]) (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR ds
-> Chain es -> PushDescriptorSetWithTemplateInfoKHR es
setNext PushDescriptorSetWithTemplateInfoKHR{Word32
Ptr ()
DescriptorUpdateTemplate
PipelineLayout
Chain ds
$sel:next:PushDescriptorSetWithTemplateInfoKHR :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR es -> Chain es
$sel:descriptorUpdateTemplate:PushDescriptorSetWithTemplateInfoKHR :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR es -> DescriptorUpdateTemplate
$sel:layout:PushDescriptorSetWithTemplateInfoKHR :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR es -> PipelineLayout
$sel:set:PushDescriptorSetWithTemplateInfoKHR :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR es -> Word32
$sel:data':PushDescriptorSetWithTemplateInfoKHR :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR es -> Ptr ()
next :: Chain ds
descriptorUpdateTemplate :: DescriptorUpdateTemplate
layout :: PipelineLayout
set :: Word32
data' :: Ptr ()
..} Chain es
next' = PushDescriptorSetWithTemplateInfoKHR{$sel:next:PushDescriptorSetWithTemplateInfoKHR :: Chain es
next = Chain es
next', Word32
Ptr ()
DescriptorUpdateTemplate
PipelineLayout
$sel:descriptorUpdateTemplate:PushDescriptorSetWithTemplateInfoKHR :: DescriptorUpdateTemplate
$sel:layout:PushDescriptorSetWithTemplateInfoKHR :: PipelineLayout
$sel:set:PushDescriptorSetWithTemplateInfoKHR :: Word32
$sel:data':PushDescriptorSetWithTemplateInfoKHR :: Ptr ()
descriptorUpdateTemplate :: DescriptorUpdateTemplate
layout :: PipelineLayout
set :: Word32
data' :: Ptr ()
..}
  getNext :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR es -> Chain es
getNext PushDescriptorSetWithTemplateInfoKHR{Word32
Ptr ()
DescriptorUpdateTemplate
PipelineLayout
Chain es
$sel:next:PushDescriptorSetWithTemplateInfoKHR :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR es -> Chain es
$sel:descriptorUpdateTemplate:PushDescriptorSetWithTemplateInfoKHR :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR es -> DescriptorUpdateTemplate
$sel:layout:PushDescriptorSetWithTemplateInfoKHR :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR es -> PipelineLayout
$sel:set:PushDescriptorSetWithTemplateInfoKHR :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR es -> Word32
$sel:data':PushDescriptorSetWithTemplateInfoKHR :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR 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 PushDescriptorSetWithTemplateInfoKHR e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e
-> (Extends PushDescriptorSetWithTemplateInfoKHR e => b) -> Maybe b
extends proxy e
_ Extends PushDescriptorSetWithTemplateInfoKHR 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 PushDescriptorSetWithTemplateInfoKHR e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss PushDescriptorSetWithTemplateInfoKHR es
         , PokeChain es ) => ToCStruct (PushDescriptorSetWithTemplateInfoKHR es) where
  withCStruct :: forall b.
PushDescriptorSetWithTemplateInfoKHR es
-> (Ptr (PushDescriptorSetWithTemplateInfoKHR es) -> IO b) -> IO b
withCStruct PushDescriptorSetWithTemplateInfoKHR es
x Ptr (PushDescriptorSetWithTemplateInfoKHR es) -> IO b
f = Int
-> (Ptr (PushDescriptorSetWithTemplateInfoKHR es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr (PushDescriptorSetWithTemplateInfoKHR es) -> IO b) -> IO b)
-> (Ptr (PushDescriptorSetWithTemplateInfoKHR es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (PushDescriptorSetWithTemplateInfoKHR es)
p -> Ptr (PushDescriptorSetWithTemplateInfoKHR es)
-> PushDescriptorSetWithTemplateInfoKHR es -> IO b -> IO b
forall b.
Ptr (PushDescriptorSetWithTemplateInfoKHR es)
-> PushDescriptorSetWithTemplateInfoKHR es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (PushDescriptorSetWithTemplateInfoKHR es)
p PushDescriptorSetWithTemplateInfoKHR es
x (Ptr (PushDescriptorSetWithTemplateInfoKHR es) -> IO b
f Ptr (PushDescriptorSetWithTemplateInfoKHR es)
p)
  pokeCStruct :: forall b.
Ptr (PushDescriptorSetWithTemplateInfoKHR es)
-> PushDescriptorSetWithTemplateInfoKHR es -> IO b -> IO b
pokeCStruct Ptr (PushDescriptorSetWithTemplateInfoKHR es)
p PushDescriptorSetWithTemplateInfoKHR{Word32
Ptr ()
DescriptorUpdateTemplate
PipelineLayout
Chain es
$sel:next:PushDescriptorSetWithTemplateInfoKHR :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR es -> Chain es
$sel:descriptorUpdateTemplate:PushDescriptorSetWithTemplateInfoKHR :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR es -> DescriptorUpdateTemplate
$sel:layout:PushDescriptorSetWithTemplateInfoKHR :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR es -> PipelineLayout
$sel:set:PushDescriptorSetWithTemplateInfoKHR :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR es -> Word32
$sel:data':PushDescriptorSetWithTemplateInfoKHR :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfoKHR 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 (PushDescriptorSetWithTemplateInfoKHR es)
p Ptr (PushDescriptorSetWithTemplateInfoKHR 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_KHR)
    Ptr ()
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)
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetWithTemplateInfoKHR es)
p Ptr (PushDescriptorSetWithTemplateInfoKHR es)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
    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 DescriptorUpdateTemplate -> DescriptorUpdateTemplate -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetWithTemplateInfoKHR es)
p Ptr (PushDescriptorSetWithTemplateInfoKHR es)
-> Int -> Ptr DescriptorUpdateTemplate
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DescriptorUpdateTemplate)) (DescriptorUpdateTemplate
descriptorUpdateTemplate)
    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 PipelineLayout -> PipelineLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetWithTemplateInfoKHR es)
p Ptr (PushDescriptorSetWithTemplateInfoKHR es)
-> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr PipelineLayout)) (PipelineLayout
layout)
    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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetWithTemplateInfoKHR es)
p Ptr (PushDescriptorSetWithTemplateInfoKHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Word32
set)
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetWithTemplateInfoKHR es)
p Ptr (PushDescriptorSetWithTemplateInfoKHR es)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr ()))) (Ptr ()
data')
    IO b -> ContT b IO b
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 b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
48
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr (PushDescriptorSetWithTemplateInfoKHR es) -> IO b -> IO b
pokeZeroCStruct Ptr (PushDescriptorSetWithTemplateInfoKHR 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 (PushDescriptorSetWithTemplateInfoKHR es)
p Ptr (PushDescriptorSetWithTemplateInfoKHR 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_KHR)
    Ptr ()
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
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetWithTemplateInfoKHR es)
p Ptr (PushDescriptorSetWithTemplateInfoKHR es)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
    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 DescriptorUpdateTemplate -> DescriptorUpdateTemplate -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetWithTemplateInfoKHR es)
p Ptr (PushDescriptorSetWithTemplateInfoKHR es)
-> Int -> Ptr DescriptorUpdateTemplate
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DescriptorUpdateTemplate)) (DescriptorUpdateTemplate
forall a. Zero a => a
zero)
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (PushDescriptorSetWithTemplateInfoKHR es)
p Ptr (PushDescriptorSetWithTemplateInfoKHR es)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr ()))) (Ptr ()
forall a. Zero a => a
zero)
    IO b -> ContT b IO b
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 b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

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

instance es ~ '[] => Zero (PushDescriptorSetWithTemplateInfoKHR es) where
  zero :: PushDescriptorSetWithTemplateInfoKHR es
zero = Chain es
-> DescriptorUpdateTemplate
-> PipelineLayout
-> Word32
-> Ptr ()
-> PushDescriptorSetWithTemplateInfoKHR es
forall (es :: [*]).
Chain es
-> DescriptorUpdateTemplate
-> PipelineLayout
-> Word32
-> Ptr ()
-> PushDescriptorSetWithTemplateInfoKHR es
PushDescriptorSetWithTemplateInfoKHR
           ()
           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


-- | VkSetDescriptorBufferOffsetsInfoEXT - Structure specifying descriptor
-- buffer offsets to set in a command buffer
--
-- = 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-VkSetDescriptorBufferOffsetsInfoEXT-pOffsets-08061# The
--     offsets in @pOffsets@ /must/ be aligned to
--     'Vulkan.Extensions.VK_EXT_descriptor_buffer.PhysicalDeviceDescriptorBufferPropertiesEXT'::@descriptorBufferOffsetAlignment@
--
-- -   #VUID-VkSetDescriptorBufferOffsetsInfoEXT-pOffsets-08063# The
--     offsets in @pOffsets@ /must/ be small enough such that any
--     descriptor binding referenced by @layout@ without the
--     'Vulkan.Core12.Enums.DescriptorBindingFlagBits.DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT'
--     flag computes a valid address inside the underlying
--     'Vulkan.Core10.Handles.Buffer'
--
-- -   #VUID-VkSetDescriptorBufferOffsetsInfoEXT-pOffsets-08126# The
--     offsets in @pOffsets@ /must/ be small enough such that any location
--     accessed by a shader as a sampler descriptor /must/ be within
--     'Vulkan.Extensions.VK_EXT_descriptor_buffer.PhysicalDeviceDescriptorBufferPropertiesEXT'::@maxSamplerDescriptorBufferRange@
--     of the sampler descriptor buffer binding
--
-- -   #VUID-VkSetDescriptorBufferOffsetsInfoEXT-pOffsets-08127# The
--     offsets in @pOffsets@ /must/ be small enough such that any location
--     accessed by a shader as a resource descriptor /must/ be within
--     'Vulkan.Extensions.VK_EXT_descriptor_buffer.PhysicalDeviceDescriptorBufferPropertiesEXT'::@maxResourceDescriptorBufferRange@
--     of the resource descriptor buffer binding
--
-- -   #VUID-VkSetDescriptorBufferOffsetsInfoEXT-pBufferIndices-08064# Each
--     element of @pBufferIndices@ /must/ be less than
--     'Vulkan.Extensions.VK_EXT_descriptor_buffer.PhysicalDeviceDescriptorBufferPropertiesEXT'::@maxDescriptorBufferBindings@
--
-- -   #VUID-VkSetDescriptorBufferOffsetsInfoEXT-pBufferIndices-08065# Each
--     element of @pBufferIndices@ /must/ reference a valid descriptor
--     buffer binding set by a previous call to
--     'Vulkan.Extensions.VK_EXT_descriptor_buffer.cmdBindDescriptorBuffersEXT'
--     in @commandBuffer@
--
-- -   #VUID-VkSetDescriptorBufferOffsetsInfoEXT-firstSet-08066# The sum of
--     @firstSet@ and @setCount@ /must/ be less than or equal to
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo'::@setLayoutCount@
--     provided when @layout@ was created
--
-- -   #VUID-VkSetDescriptorBufferOffsetsInfoEXT-firstSet-09006# The
--     'Vulkan.Core10.Handles.DescriptorSetLayout' for each set from
--     @firstSet@ to @firstSet@ + @setCount@ when @layout@ was created
--     /must/ have been created with the
--     'Vulkan.Core10.Enums.DescriptorSetLayoutCreateFlagBits.DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT'
--     bit set
--
-- -   #VUID-VkSetDescriptorBufferOffsetsInfoEXT-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-VkSetDescriptorBufferOffsetsInfoEXT-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-VkSetDescriptorBufferOffsetsInfoEXT-sType-sType# @sType@
--     /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SET_DESCRIPTOR_BUFFER_OFFSETS_INFO_EXT'
--
-- -   #VUID-VkSetDescriptorBufferOffsetsInfoEXT-pNext-pNext# @pNext@
--     /must/ be @NULL@ or a pointer to a valid instance of
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo'
--
-- -   #VUID-VkSetDescriptorBufferOffsetsInfoEXT-sType-unique# The @sType@
--     value of each struct in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkSetDescriptorBufferOffsetsInfoEXT-stageFlags-parameter#
--     @stageFlags@ /must/ be a valid combination of
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlagBits' values
--
-- -   #VUID-VkSetDescriptorBufferOffsetsInfoEXT-stageFlags-requiredbitmask#
--     @stageFlags@ /must/ not be @0@
--
-- -   #VUID-VkSetDescriptorBufferOffsetsInfoEXT-layout-parameter# If
--     @layout@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @layout@
--     /must/ be a valid 'Vulkan.Core10.Handles.PipelineLayout' handle
--
-- -   #VUID-VkSetDescriptorBufferOffsetsInfoEXT-pBufferIndices-parameter#
--     @pBufferIndices@ /must/ be a valid pointer to an array of @setCount@
--     @uint32_t@ values
--
-- -   #VUID-VkSetDescriptorBufferOffsetsInfoEXT-pOffsets-parameter#
--     @pOffsets@ /must/ be a valid pointer to an array of @setCount@
--     'Vulkan.Core10.FundamentalTypes.DeviceSize' values
--
-- -   #VUID-VkSetDescriptorBufferOffsetsInfoEXT-setCount-arraylength#
--     @setCount@ /must/ be greater than @0@
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_buffer VK_EXT_descriptor_buffer>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Core10.Handles.PipelineLayout',
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlags',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdSetDescriptorBufferOffsets2EXT'
data SetDescriptorBufferOffsetsInfoEXT (es :: [Type]) = SetDescriptorBufferOffsetsInfoEXT
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT 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 :: [*]).
SetDescriptorBufferOffsetsInfoEXT 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/1.3-extensions/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 :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> PipelineLayout
layout :: PipelineLayout
  , -- | @firstSet@ is the number of the first set to be bound.
    forall (es :: [*]). SetDescriptorBufferOffsetsInfoEXT es -> Word32
firstSet :: Word32
  , -- | @pBufferIndices@ is a pointer to an array of indices into the descriptor
    -- buffer binding points set by
    -- 'Vulkan.Extensions.VK_EXT_descriptor_buffer.cmdBindDescriptorBuffersEXT'.
    forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> Vector Word32
bufferIndices :: Vector Word32
  , -- | @pOffsets@ is a pointer to an array of
    -- 'Vulkan.Core10.FundamentalTypes.DeviceSize' offsets to apply to the
    -- bound descriptor buffers.
    forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> Vector DeviceSize
offsets :: Vector DeviceSize
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SetDescriptorBufferOffsetsInfoEXT (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (SetDescriptorBufferOffsetsInfoEXT es)

instance Extensible SetDescriptorBufferOffsetsInfoEXT where
  extensibleTypeName :: String
extensibleTypeName = String
"SetDescriptorBufferOffsetsInfoEXT"
  setNext :: forall (ds :: [*]) (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT ds
-> Chain es -> SetDescriptorBufferOffsetsInfoEXT es
setNext SetDescriptorBufferOffsetsInfoEXT{Word32
Vector Word32
Vector DeviceSize
ShaderStageFlags
PipelineLayout
Chain ds
$sel:next:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> Chain es
$sel:stageFlags:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> ShaderStageFlags
$sel:layout:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> PipelineLayout
$sel:firstSet:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]). SetDescriptorBufferOffsetsInfoEXT es -> Word32
$sel:bufferIndices:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> Vector Word32
$sel:offsets:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> Vector DeviceSize
next :: Chain ds
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
firstSet :: Word32
bufferIndices :: Vector Word32
offsets :: Vector DeviceSize
..} Chain es
next' = SetDescriptorBufferOffsetsInfoEXT{$sel:next:SetDescriptorBufferOffsetsInfoEXT :: Chain es
next = Chain es
next', Word32
Vector Word32
Vector DeviceSize
ShaderStageFlags
PipelineLayout
$sel:stageFlags:SetDescriptorBufferOffsetsInfoEXT :: ShaderStageFlags
$sel:layout:SetDescriptorBufferOffsetsInfoEXT :: PipelineLayout
$sel:firstSet:SetDescriptorBufferOffsetsInfoEXT :: Word32
$sel:bufferIndices:SetDescriptorBufferOffsetsInfoEXT :: Vector Word32
$sel:offsets:SetDescriptorBufferOffsetsInfoEXT :: Vector DeviceSize
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
firstSet :: Word32
bufferIndices :: Vector Word32
offsets :: Vector DeviceSize
..}
  getNext :: forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> Chain es
getNext SetDescriptorBufferOffsetsInfoEXT{Word32
Vector Word32
Vector DeviceSize
ShaderStageFlags
PipelineLayout
Chain es
$sel:next:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> Chain es
$sel:stageFlags:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> ShaderStageFlags
$sel:layout:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> PipelineLayout
$sel:firstSet:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]). SetDescriptorBufferOffsetsInfoEXT es -> Word32
$sel:bufferIndices:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> Vector Word32
$sel:offsets:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> Vector DeviceSize
next :: Chain es
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
firstSet :: Word32
bufferIndices :: Vector Word32
offsets :: Vector DeviceSize
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends SetDescriptorBufferOffsetsInfoEXT e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e
-> (Extends SetDescriptorBufferOffsetsInfoEXT e => b) -> Maybe b
extends proxy e
_ Extends SetDescriptorBufferOffsetsInfoEXT 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 SetDescriptorBufferOffsetsInfoEXT e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss SetDescriptorBufferOffsetsInfoEXT es
         , PokeChain es ) => ToCStruct (SetDescriptorBufferOffsetsInfoEXT es) where
  withCStruct :: forall b.
SetDescriptorBufferOffsetsInfoEXT es
-> (Ptr (SetDescriptorBufferOffsetsInfoEXT es) -> IO b) -> IO b
withCStruct SetDescriptorBufferOffsetsInfoEXT es
x Ptr (SetDescriptorBufferOffsetsInfoEXT es) -> IO b
f = Int -> (Ptr (SetDescriptorBufferOffsetsInfoEXT es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 ((Ptr (SetDescriptorBufferOffsetsInfoEXT es) -> IO b) -> IO b)
-> (Ptr (SetDescriptorBufferOffsetsInfoEXT es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p -> Ptr (SetDescriptorBufferOffsetsInfoEXT es)
-> SetDescriptorBufferOffsetsInfoEXT es -> IO b -> IO b
forall b.
Ptr (SetDescriptorBufferOffsetsInfoEXT es)
-> SetDescriptorBufferOffsetsInfoEXT es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p SetDescriptorBufferOffsetsInfoEXT es
x (Ptr (SetDescriptorBufferOffsetsInfoEXT es) -> IO b
f Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p)
  pokeCStruct :: forall b.
Ptr (SetDescriptorBufferOffsetsInfoEXT es)
-> SetDescriptorBufferOffsetsInfoEXT es -> IO b -> IO b
pokeCStruct Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p SetDescriptorBufferOffsetsInfoEXT{Word32
Vector Word32
Vector DeviceSize
ShaderStageFlags
PipelineLayout
Chain es
$sel:next:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> Chain es
$sel:stageFlags:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> ShaderStageFlags
$sel:layout:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> PipelineLayout
$sel:firstSet:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]). SetDescriptorBufferOffsetsInfoEXT es -> Word32
$sel:bufferIndices:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> Vector Word32
$sel:offsets:SetDescriptorBufferOffsetsInfoEXT :: forall (es :: [*]).
SetDescriptorBufferOffsetsInfoEXT es -> Vector DeviceSize
next :: Chain es
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
firstSet :: Word32
bufferIndices :: Vector Word32
offsets :: Vector DeviceSize
..} 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 (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SET_DESCRIPTOR_BUFFER_OFFSETS_INFO_EXT)
    Ptr ()
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)
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
    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 ShaderStageFlags -> ShaderStageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es)
-> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ShaderStageFlags)) (ShaderStageFlags
stageFlags)
    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 PipelineLayout -> PipelineLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es)
-> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr PipelineLayout)) (PipelineLayout
layout)
    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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Word32
firstSet)
    let pBufferIndicesLength :: Int
pBufferIndicesLength = 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
bufferIndices)
    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
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ((Vector DeviceSize -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector DeviceSize -> Int) -> Vector DeviceSize -> Int
forall a b. (a -> b) -> a -> b
$ (Vector DeviceSize
offsets)) Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
pBufferIndicesLength) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
      IOException -> IO ()
forall e a. 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
"pOffsets and pBufferIndices must have the same length" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
    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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pBufferIndicesLength :: Word32))
    Ptr Word32
pPBufferIndices' <- ((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32))
-> ((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Word32 ((Vector Word32 -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Word32
bufferIndices)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
4)
    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
$ (Int -> Word32 -> IO ()) -> Vector Word32 -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Word32
e -> Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word32
pPBufferIndices' 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)) (Vector Word32
bufferIndices)
    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 (Ptr Word32) -> Ptr Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es)
-> Int -> Ptr (Ptr Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr Word32))) (Ptr Word32
pPBufferIndices')
    Ptr DeviceSize
pPOffsets' <- ((Ptr DeviceSize -> IO b) -> IO b) -> ContT b IO (Ptr DeviceSize)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr DeviceSize -> IO b) -> IO b) -> ContT b IO (Ptr DeviceSize))
-> ((Ptr DeviceSize -> IO b) -> IO b)
-> ContT b IO (Ptr DeviceSize)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @DeviceSize ((Vector DeviceSize -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector DeviceSize
offsets)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
8)
    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
$ (Int -> DeviceSize -> IO ()) -> Vector DeviceSize -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i DeviceSize
e -> Ptr DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DeviceSize
pPOffsets' Ptr DeviceSize -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DeviceSize) (DeviceSize
e)) (Vector DeviceSize
offsets)
    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 (Ptr DeviceSize) -> Ptr DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es)
-> Int -> Ptr (Ptr DeviceSize)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr DeviceSize))) (Ptr DeviceSize
pPOffsets')
    IO b -> ContT b IO b
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 b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
56
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr (SetDescriptorBufferOffsetsInfoEXT es) -> IO b -> IO b
pokeZeroCStruct Ptr (SetDescriptorBufferOffsetsInfoEXT 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 (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SET_DESCRIPTOR_BUFFER_OFFSETS_INFO_EXT)
    Ptr ()
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
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
    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 ShaderStageFlags -> ShaderStageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es)
-> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ShaderStageFlags)) (ShaderStageFlags
forall a. Zero a => a
zero)
    IO b -> ContT b IO b
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 b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance ( Extendss SetDescriptorBufferOffsetsInfoEXT es
         , PeekChain es ) => FromCStruct (SetDescriptorBufferOffsetsInfoEXT es) where
  peekCStruct :: Ptr (SetDescriptorBufferOffsetsInfoEXT es)
-> IO (SetDescriptorBufferOffsetsInfoEXT es)
peekCStruct Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p = do
    Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    Chain es
next <- Ptr (Chain es) -> IO (Chain es)
forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (Ptr () -> Ptr (Chain es)
forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
    ShaderStageFlags
stageFlags <- forall a. Storable a => Ptr a -> IO a
peek @ShaderStageFlags ((Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es)
-> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ShaderStageFlags))
    PipelineLayout
layout <- forall a. Storable a => Ptr a -> IO a
peek @PipelineLayout ((Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es)
-> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr PipelineLayout))
    Word32
firstSet <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32))
    Word32
setCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Word32))
    Ptr Word32
pBufferIndices <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) ((Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es)
-> Int -> Ptr (Ptr Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr Word32)))
    Vector Word32
pBufferIndices' <- Int -> (Int -> IO Word32) -> IO (Vector Word32)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
setCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr Word32
pBufferIndices 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)))
    Ptr DeviceSize
pOffsets <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr DeviceSize) ((Ptr (SetDescriptorBufferOffsetsInfoEXT es)
p Ptr (SetDescriptorBufferOffsetsInfoEXT es)
-> Int -> Ptr (Ptr DeviceSize)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr DeviceSize)))
    Vector DeviceSize
pOffsets' <- Int -> (Int -> IO DeviceSize) -> IO (Vector DeviceSize)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
setCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr DeviceSize
pOffsets Ptr DeviceSize -> Int -> Ptr DeviceSize
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DeviceSize)))
    SetDescriptorBufferOffsetsInfoEXT es
-> IO (SetDescriptorBufferOffsetsInfoEXT es)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SetDescriptorBufferOffsetsInfoEXT es
 -> IO (SetDescriptorBufferOffsetsInfoEXT es))
-> SetDescriptorBufferOffsetsInfoEXT es
-> IO (SetDescriptorBufferOffsetsInfoEXT es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector Word32
-> Vector DeviceSize
-> SetDescriptorBufferOffsetsInfoEXT es
forall (es :: [*]).
Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector Word32
-> Vector DeviceSize
-> SetDescriptorBufferOffsetsInfoEXT es
SetDescriptorBufferOffsetsInfoEXT
             Chain es
next ShaderStageFlags
stageFlags PipelineLayout
layout Word32
firstSet Vector Word32
pBufferIndices' Vector DeviceSize
pOffsets'

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


-- | VkBindDescriptorBufferEmbeddedSamplersInfoEXT - Structure specifying
-- embedded immutable sampler offsets to set in a command buffer
--
-- = 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-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-set-08070# The
--     'Vulkan.Core10.Handles.DescriptorSetLayout' at index @set@ when
--     @layout@ was created /must/ have been created with the
--     'Vulkan.Core10.Enums.DescriptorSetLayoutCreateFlagBits.DESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT'
--     bit set
--
-- -   #VUID-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-set-08071# @set@
--     /must/ be less than or equal to
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo'::@setLayoutCount@
--     provided when @layout@ was created
--
-- -   #VUID-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-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-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-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-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-sType-sType#
--     @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BIND_DESCRIPTOR_BUFFER_EMBEDDED_SAMPLERS_INFO_EXT'
--
-- -   #VUID-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-pNext-pNext#
--     @pNext@ /must/ be @NULL@ or a pointer to a valid instance of
--     'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo'
--
-- -   #VUID-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-sType-unique#
--     The @sType@ value of each struct in the @pNext@ chain /must/ be
--     unique
--
-- -   #VUID-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-stageFlags-parameter#
--     @stageFlags@ /must/ be a valid combination of
--     'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlagBits' values
--
-- -   #VUID-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-stageFlags-requiredbitmask#
--     @stageFlags@ /must/ not be @0@
--
-- -   #VUID-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-layout-parameter#
--     If @layout@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @layout@ /must/ be a valid 'Vulkan.Core10.Handles.PipelineLayout'
--     handle
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_buffer VK_EXT_descriptor_buffer>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance6 VK_KHR_maintenance6>,
-- 'Vulkan.Core10.Handles.PipelineLayout',
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlags',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdBindDescriptorBufferEmbeddedSamplers2EXT'
data BindDescriptorBufferEmbeddedSamplersInfoEXT (es :: [Type]) = BindDescriptorBufferEmbeddedSamplersInfoEXT
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT es -> Chain es
next :: Chain es
  , -- | @stageFlags@ is a bitmask of
    -- 'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlagBits' specifying
    -- the shader stages that will use the embedded immutable samplers.
    forall (es :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT 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/1.3-extensions/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 :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT es -> PipelineLayout
layout :: PipelineLayout
  , -- | @set@ is the number of the set to be bound.
    forall (es :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT es -> Word32
set :: Word32
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BindDescriptorBufferEmbeddedSamplersInfoEXT (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (BindDescriptorBufferEmbeddedSamplersInfoEXT es)

instance Extensible BindDescriptorBufferEmbeddedSamplersInfoEXT where
  extensibleTypeName :: String
extensibleTypeName = String
"BindDescriptorBufferEmbeddedSamplersInfoEXT"
  setNext :: forall (ds :: [*]) (es :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT ds
-> Chain es -> BindDescriptorBufferEmbeddedSamplersInfoEXT es
setNext BindDescriptorBufferEmbeddedSamplersInfoEXT{Word32
ShaderStageFlags
PipelineLayout
Chain ds
$sel:next:BindDescriptorBufferEmbeddedSamplersInfoEXT :: forall (es :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT es -> Chain es
$sel:stageFlags:BindDescriptorBufferEmbeddedSamplersInfoEXT :: forall (es :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT es -> ShaderStageFlags
$sel:layout:BindDescriptorBufferEmbeddedSamplersInfoEXT :: forall (es :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT es -> PipelineLayout
$sel:set:BindDescriptorBufferEmbeddedSamplersInfoEXT :: forall (es :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT es -> Word32
next :: Chain ds
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
set :: Word32
..} Chain es
next' = BindDescriptorBufferEmbeddedSamplersInfoEXT{$sel:next:BindDescriptorBufferEmbeddedSamplersInfoEXT :: Chain es
next = Chain es
next', Word32
ShaderStageFlags
PipelineLayout
$sel:stageFlags:BindDescriptorBufferEmbeddedSamplersInfoEXT :: ShaderStageFlags
$sel:layout:BindDescriptorBufferEmbeddedSamplersInfoEXT :: PipelineLayout
$sel:set:BindDescriptorBufferEmbeddedSamplersInfoEXT :: Word32
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
set :: Word32
..}
  getNext :: forall (es :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT es -> Chain es
getNext BindDescriptorBufferEmbeddedSamplersInfoEXT{Word32
ShaderStageFlags
PipelineLayout
Chain es
$sel:next:BindDescriptorBufferEmbeddedSamplersInfoEXT :: forall (es :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT es -> Chain es
$sel:stageFlags:BindDescriptorBufferEmbeddedSamplersInfoEXT :: forall (es :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT es -> ShaderStageFlags
$sel:layout:BindDescriptorBufferEmbeddedSamplersInfoEXT :: forall (es :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT es -> PipelineLayout
$sel:set:BindDescriptorBufferEmbeddedSamplersInfoEXT :: forall (es :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT es -> Word32
next :: Chain es
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
set :: Word32
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends BindDescriptorBufferEmbeddedSamplersInfoEXT e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e
-> (Extends BindDescriptorBufferEmbeddedSamplersInfoEXT e => b)
-> Maybe b
extends proxy e
_ Extends BindDescriptorBufferEmbeddedSamplersInfoEXT 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 BindDescriptorBufferEmbeddedSamplersInfoEXT e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss BindDescriptorBufferEmbeddedSamplersInfoEXT es
         , PokeChain es ) => ToCStruct (BindDescriptorBufferEmbeddedSamplersInfoEXT es) where
  withCStruct :: forall b.
BindDescriptorBufferEmbeddedSamplersInfoEXT es
-> (Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es) -> IO b)
-> IO b
withCStruct BindDescriptorBufferEmbeddedSamplersInfoEXT es
x Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es) -> IO b
f = Int
-> (Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es) -> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es) -> IO b)
 -> IO b)
-> (Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es) -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
p -> Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
-> BindDescriptorBufferEmbeddedSamplersInfoEXT es -> IO b -> IO b
forall b.
Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
-> BindDescriptorBufferEmbeddedSamplersInfoEXT es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
p BindDescriptorBufferEmbeddedSamplersInfoEXT es
x (Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es) -> IO b
f Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
p)
  pokeCStruct :: forall b.
Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
-> BindDescriptorBufferEmbeddedSamplersInfoEXT es -> IO b -> IO b
pokeCStruct Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
p BindDescriptorBufferEmbeddedSamplersInfoEXT{Word32
ShaderStageFlags
PipelineLayout
Chain es
$sel:next:BindDescriptorBufferEmbeddedSamplersInfoEXT :: forall (es :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT es -> Chain es
$sel:stageFlags:BindDescriptorBufferEmbeddedSamplersInfoEXT :: forall (es :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT es -> ShaderStageFlags
$sel:layout:BindDescriptorBufferEmbeddedSamplersInfoEXT :: forall (es :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT es -> PipelineLayout
$sel:set:BindDescriptorBufferEmbeddedSamplersInfoEXT :: forall (es :: [*]).
BindDescriptorBufferEmbeddedSamplersInfoEXT es -> Word32
next :: Chain es
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
set :: 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 (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
p Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_DESCRIPTOR_BUFFER_EMBEDDED_SAMPLERS_INFO_EXT)
    Ptr ()
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)
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
p Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
    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 ShaderStageFlags -> ShaderStageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
p Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
-> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ShaderStageFlags)) (ShaderStageFlags
stageFlags)
    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 PipelineLayout -> PipelineLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
p Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
-> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr PipelineLayout)) (PipelineLayout
layout)
    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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
p Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Word32
set)
    IO b -> ContT b IO b
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 b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
40
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
-> IO b -> IO b
pokeZeroCStruct Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT 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 (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
p Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_DESCRIPTOR_BUFFER_EMBEDDED_SAMPLERS_INFO_EXT)
    Ptr ()
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
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
p Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
    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 ShaderStageFlags -> ShaderStageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
p Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
-> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ShaderStageFlags)) (ShaderStageFlags
forall a. Zero a => a
zero)
    IO b -> ContT b IO b
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 b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance ( Extendss BindDescriptorBufferEmbeddedSamplersInfoEXT es
         , PeekChain es ) => FromCStruct (BindDescriptorBufferEmbeddedSamplersInfoEXT es) where
  peekCStruct :: Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
-> IO (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
peekCStruct Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
p = do
    Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
p Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    Chain es
next <- Ptr (Chain es) -> IO (Chain es)
forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (Ptr () -> Ptr (Chain es)
forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
    ShaderStageFlags
stageFlags <- forall a. Storable a => Ptr a -> IO a
peek @ShaderStageFlags ((Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
p Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
-> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ShaderStageFlags))
    PipelineLayout
layout <- forall a. Storable a => Ptr a -> IO a
peek @PipelineLayout ((Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
p Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
-> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr PipelineLayout))
    Word32
set <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
p Ptr (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32))
    BindDescriptorBufferEmbeddedSamplersInfoEXT es
-> IO (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (BindDescriptorBufferEmbeddedSamplersInfoEXT es
 -> IO (BindDescriptorBufferEmbeddedSamplersInfoEXT es))
-> BindDescriptorBufferEmbeddedSamplersInfoEXT es
-> IO (BindDescriptorBufferEmbeddedSamplersInfoEXT es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> BindDescriptorBufferEmbeddedSamplersInfoEXT es
forall (es :: [*]).
Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> BindDescriptorBufferEmbeddedSamplersInfoEXT es
BindDescriptorBufferEmbeddedSamplersInfoEXT
             Chain es
next ShaderStageFlags
stageFlags PipelineLayout
layout Word32
set

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


type KHR_MAINTENANCE_6_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_KHR_MAINTENANCE_6_SPEC_VERSION"
pattern KHR_MAINTENANCE_6_SPEC_VERSION :: forall a . Integral a => a
pattern $mKHR_MAINTENANCE_6_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bKHR_MAINTENANCE_6_SPEC_VERSION :: forall a. Integral a => a
KHR_MAINTENANCE_6_SPEC_VERSION = 1


type KHR_MAINTENANCE_6_EXTENSION_NAME = "VK_KHR_maintenance6"

-- No documentation found for TopLevel "VK_KHR_MAINTENANCE_6_EXTENSION_NAME"
pattern KHR_MAINTENANCE_6_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mKHR_MAINTENANCE_6_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bKHR_MAINTENANCE_6_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
KHR_MAINTENANCE_6_EXTENSION_NAME = "VK_KHR_maintenance6"