{-# language CPP #-}
-- | = Name
--
-- VK_KHR_copy_commands2 - device extension
--
-- == VK_KHR_copy_commands2
--
-- [__Name String__]
--     @VK_KHR_copy_commands2@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     338
--
-- [__Revision__]
--     1
--
-- [__Extension and Version Dependencies__]
--
--     -   Requires Vulkan 1.0
--
-- [__Contact__]
--
--     -   Jeff Leger
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?title=VK_KHR_copy_commands2:%20&body=@jackohound%20 >
--
-- == Other Extension Metadata
--
-- [Last Modified Date]
--     2020-07-06
--
-- [__Interactions and External Dependencies__]
--
--     -   None
--
-- [Contributors]
--
--     -   Jeff Leger, Qualcomm
--
--     -   Tobias Hector, AMD
--
--     -   Jan-Harald Fredriksen, ARM
--
--     -   Tom Olson, ARM
--
-- == Description
--
-- This extension provides extensible versions of the Vulkan buffer and
-- image copy commands. The new commands are functionally identical to the
-- core commands, except that their copy parameters are specified using
-- extensible structures that can be used to pass extension-specific
-- information.
--
-- The following extensible copy commands are introduced with this
-- extension: 'cmdCopyBuffer2KHR', 'cmdCopyImage2KHR',
-- 'cmdCopyBufferToImage2KHR', 'cmdCopyImageToBuffer2KHR',
-- 'cmdBlitImage2KHR', and 'cmdResolveImage2KHR'. Each command
-- contain@*Info2KHR@ structure parameter that includes @sType@\/@pNext@
-- members. Lower level structures that describe each region to be copied
-- are also extended with @sType@\/@pNext@ members.
--
-- == New Commands
--
-- -   'cmdBlitImage2KHR'
--
-- -   'cmdCopyBuffer2KHR'
--
-- -   'cmdCopyBufferToImage2KHR'
--
-- -   'cmdCopyImage2KHR'
--
-- -   'cmdCopyImageToBuffer2KHR'
--
-- -   'cmdResolveImage2KHR'
--
-- == New Structures
--
-- -   'BlitImageInfo2KHR'
--
-- -   'BufferCopy2KHR'
--
-- -   'BufferImageCopy2KHR'
--
-- -   'CopyBufferInfo2KHR'
--
-- -   'CopyBufferToImageInfo2KHR'
--
-- -   'CopyImageInfo2KHR'
--
-- -   'CopyImageToBufferInfo2KHR'
--
-- -   'ImageBlit2KHR'
--
-- -   'ImageCopy2KHR'
--
-- -   'ImageResolve2KHR'
--
-- -   'ResolveImageInfo2KHR'
--
-- == New Enum Constants
--
-- -   'KHR_COPY_COMMANDS_2_EXTENSION_NAME'
--
-- -   'KHR_COPY_COMMANDS_2_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BLIT_IMAGE_INFO_2_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BUFFER_COPY_2_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_BUFFER_INFO_2_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_IMAGE_INFO_2_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMAGE_BLIT_2_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMAGE_COPY_2_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMAGE_RESOLVE_2_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2_KHR'
--
-- == Version History
--
-- -   Revision 1, 2020-07-06 (Jeff Leger)
--
--     -   Internal revisions
--
-- = See Also
--
-- 'BlitImageInfo2KHR', 'BufferCopy2KHR', 'BufferImageCopy2KHR',
-- 'CopyBufferInfo2KHR', 'CopyBufferToImageInfo2KHR', 'CopyImageInfo2KHR',
-- 'CopyImageToBufferInfo2KHR', 'ImageBlit2KHR', 'ImageCopy2KHR',
-- 'ImageResolve2KHR', 'ResolveImageInfo2KHR', 'cmdBlitImage2KHR',
-- 'cmdCopyBuffer2KHR', 'cmdCopyBufferToImage2KHR', 'cmdCopyImage2KHR',
-- 'cmdCopyImageToBuffer2KHR', 'cmdResolveImage2KHR'
--
-- = Document Notes
--
-- For more information, see the
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_copy_commands2 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_copy_commands2  ( cmdCopyBuffer2KHR
                                                , cmdCopyImage2KHR
                                                , cmdBlitImage2KHR
                                                , cmdCopyBufferToImage2KHR
                                                , cmdCopyImageToBuffer2KHR
                                                , cmdResolveImage2KHR
                                                , BufferCopy2KHR(..)
                                                , ImageCopy2KHR(..)
                                                , ImageBlit2KHR(..)
                                                , BufferImageCopy2KHR(..)
                                                , ImageResolve2KHR(..)
                                                , CopyBufferInfo2KHR(..)
                                                , CopyImageInfo2KHR(..)
                                                , BlitImageInfo2KHR(..)
                                                , CopyBufferToImageInfo2KHR(..)
                                                , CopyImageToBufferInfo2KHR(..)
                                                , ResolveImageInfo2KHR(..)
                                                , KHR_COPY_COMMANDS_2_SPEC_VERSION
                                                , pattern KHR_COPY_COMMANDS_2_SPEC_VERSION
                                                , KHR_COPY_COMMANDS_2_EXTENSION_NAME
                                                , pattern KHR_COPY_COMMANDS_2_EXTENSION_NAME
                                                ) where

import Vulkan.CStruct.Utils (FixedArray)
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytesAligned)
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 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.CStruct.Extends (forgetExtensions)
import Vulkan.CStruct.Utils (lowerArrayPtr)
import Vulkan.CStruct.Extends (peekSomeCStruct)
import Vulkan.CStruct.Extends (pokeSomeCStruct)
import Vulkan.Core10.Handles (Buffer)
import Vulkan.CStruct.Extends (Chain)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer_T)
import {-# SOURCE #-} Vulkan.Extensions.VK_QCOM_rotated_copy_commands (CopyCommandTransformInfoQCOM)
import Vulkan.Dynamic (DeviceCmds(pVkCmdBlitImage2KHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyBuffer2KHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyBufferToImage2KHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyImage2KHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyImageToBuffer2KHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdResolveImage2KHR))
import Vulkan.Core10.FundamentalTypes (DeviceSize)
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import Vulkan.Core10.FundamentalTypes (Extent3D)
import Vulkan.Core10.Enums.Filter (Filter)
import Vulkan.Core10.Handles (Image)
import Vulkan.Core10.Enums.ImageLayout (ImageLayout)
import Vulkan.Core10.CommandBufferBuilding (ImageSubresourceLayers)
import Vulkan.Core10.FundamentalTypes (Offset3D)
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PeekChain(..))
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BLIT_IMAGE_INFO_2_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BUFFER_COPY_2_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COPY_BUFFER_INFO_2_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COPY_IMAGE_INFO_2_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMAGE_BLIT_2_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMAGE_COPY_2_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMAGE_RESOLVE_2_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2_KHR))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdCopyBuffer2KHR
  :: FunPtr (Ptr CommandBuffer_T -> Ptr CopyBufferInfo2KHR -> IO ()) -> Ptr CommandBuffer_T -> Ptr CopyBufferInfo2KHR -> IO ()

-- | vkCmdCopyBuffer2KHR - Copy data between buffer regions
--
-- = Description
--
-- This command is functionally identical to
-- 'Vulkan.Core10.CommandBufferBuilding.cmdCopyBuffer', but includes
-- extensible sub-structures that include @sType@ and @pNext@ parameters,
-- allowing them to be more easily extended.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdCopyBuffer2KHR-commandBuffer-01822# If @commandBuffer@ is
--     an unprotected command buffer, then @srcBuffer@ /must/ not be a
--     protected buffer
--
-- -   #VUID-vkCmdCopyBuffer2KHR-commandBuffer-01823# If @commandBuffer@ is
--     an unprotected command buffer, then @dstBuffer@ /must/ not be a
--     protected buffer
--
-- -   #VUID-vkCmdCopyBuffer2KHR-commandBuffer-01824# If @commandBuffer@ is
--     a protected command buffer, then @dstBuffer@ /must/ not be an
--     unprotected buffer
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdCopyBuffer2KHR-commandBuffer-parameter# @commandBuffer@
--     /must/ be a valid 'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdCopyBuffer2KHR-pCopyBufferInfo-parameter#
--     @pCopyBufferInfo@ /must/ be a valid pointer to a valid
--     'CopyBufferInfo2KHR' structure
--
-- -   #VUID-vkCmdCopyBuffer2KHR-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-vkCmdCopyBuffer2KHR-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support transfer, graphics, or compute
--     operations
--
-- -   #VUID-vkCmdCopyBuffer2KHR-renderpass# This command /must/ only be
--     called outside of a render pass instance
--
-- == 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#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Transfer                                                                                                              | Transfer                                                                                                                            |
-- | Secondary                                                                                                                  |                                                                                                                        | Graphics                                                                                                              |                                                                                                                                     |
-- |                                                                                                                            |                                                                                                                        | Compute                                                                                                               |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.CommandBuffer', 'CopyBufferInfo2KHR'
cmdCopyBuffer2KHR :: forall io
                   . (MonadIO io)
                  => -- | @commandBuffer@ is the command buffer into which the command will be
                     -- recorded.
                     CommandBuffer
                  -> -- | @pCopyBufferInfo@ is a pointer to a 'CopyBufferInfo2KHR' structure
                     -- describing the copy parameters.
                     CopyBufferInfo2KHR
                  -> io ()
cmdCopyBuffer2KHR :: CommandBuffer -> CopyBufferInfo2KHR -> io ()
cmdCopyBuffer2KHR commandBuffer :: CommandBuffer
commandBuffer copyBufferInfo :: CopyBufferInfo2KHR
copyBufferInfo = IO () -> io ()
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 vkCmdCopyBuffer2KHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO ())
vkCmdCopyBuffer2KHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO ())
pVkCmdCopyBuffer2KHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  IO () -> ContT () IO ()
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
   -> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO ())
vkCmdCopyBuffer2KHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> 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 "" "The function pointer for vkCmdCopyBuffer2KHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdCopyBuffer2KHR' :: Ptr CommandBuffer_T
-> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO ()
vkCmdCopyBuffer2KHR' = FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO ())
-> Ptr CommandBuffer_T
-> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR)
-> IO ()
mkVkCmdCopyBuffer2KHR FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO ())
vkCmdCopyBuffer2KHRPtr
  "pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
pCopyBufferInfo <- ((("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO ())
 -> IO ())
-> ContT () IO ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO ())
  -> IO ())
 -> ContT () IO ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR))
-> ((("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO ())
    -> IO ())
-> ContT () IO ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR)
forall a b. (a -> b) -> a -> b
$ CopyBufferInfo2KHR
-> (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyBufferInfo2KHR
copyBufferInfo)
  IO () -> ContT () IO ()
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 "vkCmdCopyBuffer2KHR" (Ptr CommandBuffer_T
-> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO ()
vkCmdCopyBuffer2KHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) "pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
pCopyBufferInfo)
  () -> ContT () IO ()
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" mkVkCmdCopyImage2KHR
  :: FunPtr (Ptr CommandBuffer_T -> Ptr CopyImageInfo2KHR -> IO ()) -> Ptr CommandBuffer_T -> Ptr CopyImageInfo2KHR -> IO ()

-- | vkCmdCopyImage2KHR - Copy data between images
--
-- = Description
--
-- This command is functionally identical to
-- 'Vulkan.Core10.CommandBufferBuilding.cmdCopyImage', but includes
-- extensible sub-structures that include @sType@ and @pNext@ parameters,
-- allowing them to be more easily extended.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdCopyImage2KHR-commandBuffer-01825# If @commandBuffer@ is
--     an unprotected command buffer, then @srcImage@ /must/ not be a
--     protected image
--
-- -   #VUID-vkCmdCopyImage2KHR-commandBuffer-01826# If @commandBuffer@ is
--     an unprotected command buffer, then @dstImage@ /must/ not be a
--     protected image
--
-- -   #VUID-vkCmdCopyImage2KHR-commandBuffer-01827# If @commandBuffer@ is
--     a protected command buffer, then @dstImage@ /must/ not be an
--     unprotected image
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdCopyImage2KHR-commandBuffer-parameter# @commandBuffer@
--     /must/ be a valid 'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdCopyImage2KHR-pCopyImageInfo-parameter# @pCopyImageInfo@
--     /must/ be a valid pointer to a valid 'CopyImageInfo2KHR' structure
--
-- -   #VUID-vkCmdCopyImage2KHR-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-vkCmdCopyImage2KHR-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support transfer, graphics, or compute
--     operations
--
-- -   #VUID-vkCmdCopyImage2KHR-renderpass# This command /must/ only be
--     called outside of a render pass instance
--
-- == 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#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Transfer                                                                                                              | Transfer                                                                                                                            |
-- | Secondary                                                                                                                  |                                                                                                                        | Graphics                                                                                                              |                                                                                                                                     |
-- |                                                                                                                            |                                                                                                                        | Compute                                                                                                               |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.CommandBuffer', 'CopyImageInfo2KHR'
cmdCopyImage2KHR :: forall io
                  . (MonadIO io)
                 => -- | @commandBuffer@ is the command buffer into which the command will be
                    -- recorded.
                    CommandBuffer
                 -> -- | @pCopyImageInfo@ is a pointer to a 'CopyImageInfo2KHR' structure
                    -- describing the copy parameters.
                    CopyImageInfo2KHR
                 -> io ()
cmdCopyImage2KHR :: CommandBuffer -> CopyImageInfo2KHR -> io ()
cmdCopyImage2KHR commandBuffer :: CommandBuffer
commandBuffer copyImageInfo :: CopyImageInfo2KHR
copyImageInfo = IO () -> io ()
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 vkCmdCopyImage2KHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO ())
vkCmdCopyImage2KHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO ())
pVkCmdCopyImage2KHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  IO () -> ContT () IO ()
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
   -> ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO ())
vkCmdCopyImage2KHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> 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 "" "The function pointer for vkCmdCopyImage2KHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdCopyImage2KHR' :: Ptr CommandBuffer_T
-> ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO ()
vkCmdCopyImage2KHR' = FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO ())
-> Ptr CommandBuffer_T
-> ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR)
-> IO ()
mkVkCmdCopyImage2KHR FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO ())
vkCmdCopyImage2KHRPtr
  "pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
pCopyImageInfo <- ((("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO ()) -> IO ())
-> ContT () IO ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO ()) -> IO ())
 -> ContT () IO ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR))
-> ((("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO ())
    -> IO ())
-> ContT () IO ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR)
forall a b. (a -> b) -> a -> b
$ CopyImageInfo2KHR
-> (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyImageInfo2KHR
copyImageInfo)
  IO () -> ContT () IO ()
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 "vkCmdCopyImage2KHR" (Ptr CommandBuffer_T
-> ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO ()
vkCmdCopyImage2KHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) "pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
pCopyImageInfo)
  () -> ContT () IO ()
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" mkVkCmdBlitImage2KHR
  :: FunPtr (Ptr CommandBuffer_T -> Ptr BlitImageInfo2KHR -> IO ()) -> Ptr CommandBuffer_T -> Ptr BlitImageInfo2KHR -> IO ()

-- | vkCmdBlitImage2KHR - Copy regions of an image, potentially performing
-- format conversion,
--
-- = Description
--
-- This command is functionally identical to
-- 'Vulkan.Core10.CommandBufferBuilding.cmdBlitImage', but includes
-- extensible sub-structures that include @sType@ and @pNext@ parameters,
-- allowing them to be more easily extended.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdBlitImage2KHR-commandBuffer-01834# If @commandBuffer@ is
--     an unprotected command buffer, then @srcImage@ /must/ not be a
--     protected image
--
-- -   #VUID-vkCmdBlitImage2KHR-commandBuffer-01835# If @commandBuffer@ is
--     an unprotected command buffer, then @dstImage@ /must/ not be a
--     protected image
--
-- -   #VUID-vkCmdBlitImage2KHR-commandBuffer-01836# If @commandBuffer@ is
--     a protected command buffer, then @dstImage@ /must/ not be an
--     unprotected image
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdBlitImage2KHR-commandBuffer-parameter# @commandBuffer@
--     /must/ be a valid 'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdBlitImage2KHR-pBlitImageInfo-parameter# @pBlitImageInfo@
--     /must/ be a valid pointer to a valid 'BlitImageInfo2KHR' structure
--
-- -   #VUID-vkCmdBlitImage2KHR-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-vkCmdBlitImage2KHR-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics operations
--
-- -   #VUID-vkCmdBlitImage2KHR-renderpass# This command /must/ only be
--     called outside of a render pass instance
--
-- == 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#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Graphics                                                                                                              | Transfer                                                                                                                            |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                       |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'BlitImageInfo2KHR', 'Vulkan.Core10.Handles.CommandBuffer'
cmdBlitImage2KHR :: forall io
                  . (MonadIO io)
                 => -- | @commandBuffer@ is the command buffer into which the command will be
                    -- recorded.
                    CommandBuffer
                 -> -- | @pBlitImageInfo@ is a pointer to a 'BlitImageInfo2KHR' structure
                    -- describing the blit parameters.
                    BlitImageInfo2KHR
                 -> io ()
cmdBlitImage2KHR :: CommandBuffer -> BlitImageInfo2KHR -> io ()
cmdBlitImage2KHR commandBuffer :: CommandBuffer
commandBuffer blitImageInfo :: BlitImageInfo2KHR
blitImageInfo = IO () -> io ()
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 vkCmdBlitImage2KHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO ())
vkCmdBlitImage2KHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO ())
pVkCmdBlitImage2KHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  IO () -> ContT () IO ()
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
   -> ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO ())
vkCmdBlitImage2KHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> 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 "" "The function pointer for vkCmdBlitImage2KHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdBlitImage2KHR' :: Ptr CommandBuffer_T
-> ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO ()
vkCmdBlitImage2KHR' = FunPtr
  (Ptr CommandBuffer_T
   -> ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO ())
-> Ptr CommandBuffer_T
-> ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR)
-> IO ()
mkVkCmdBlitImage2KHR FunPtr
  (Ptr CommandBuffer_T
   -> ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO ())
vkCmdBlitImage2KHRPtr
  "pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
pBlitImageInfo <- ((("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO ()) -> IO ())
-> ContT () IO ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO ()) -> IO ())
 -> ContT () IO ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR))
-> ((("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO ())
    -> IO ())
-> ContT () IO ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR)
forall a b. (a -> b) -> a -> b
$ BlitImageInfo2KHR
-> (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (BlitImageInfo2KHR
blitImageInfo)
  IO () -> ContT () IO ()
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 "vkCmdBlitImage2KHR" (Ptr CommandBuffer_T
-> ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO ()
vkCmdBlitImage2KHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) "pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
pBlitImageInfo)
  () -> ContT () IO ()
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" mkVkCmdCopyBufferToImage2KHR
  :: FunPtr (Ptr CommandBuffer_T -> Ptr CopyBufferToImageInfo2KHR -> IO ()) -> Ptr CommandBuffer_T -> Ptr CopyBufferToImageInfo2KHR -> IO ()

-- | vkCmdCopyBufferToImage2KHR - Copy data from a buffer into an image
--
-- = Description
--
-- This command is functionally identical to
-- 'Vulkan.Core10.CommandBufferBuilding.cmdCopyBufferToImage', but includes
-- extensible sub-structures that include @sType@ and @pNext@ parameters,
-- allowing them to be more easily extended.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdCopyBufferToImage2KHR-commandBuffer-01828# If
--     @commandBuffer@ is an unprotected command buffer, then @srcBuffer@
--     /must/ not be a protected buffer
--
-- -   #VUID-vkCmdCopyBufferToImage2KHR-commandBuffer-01829# If
--     @commandBuffer@ is an unprotected command buffer, then @dstImage@
--     /must/ not be a protected image
--
-- -   #VUID-vkCmdCopyBufferToImage2KHR-commandBuffer-01830# If
--     @commandBuffer@ is a protected command buffer, then @dstImage@
--     /must/ not be an unprotected image
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdCopyBufferToImage2KHR-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdCopyBufferToImage2KHR-pCopyBufferToImageInfo-parameter#
--     @pCopyBufferToImageInfo@ /must/ be a valid pointer to a valid
--     'CopyBufferToImageInfo2KHR' structure
--
-- -   #VUID-vkCmdCopyBufferToImage2KHR-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-vkCmdCopyBufferToImage2KHR-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support transfer, graphics, or compute
--     operations
--
-- -   #VUID-vkCmdCopyBufferToImage2KHR-renderpass# This command /must/
--     only be called outside of a render pass instance
--
-- == 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#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Transfer                                                                                                              | Transfer                                                                                                                            |
-- | Secondary                                                                                                                  |                                                                                                                        | Graphics                                                                                                              |                                                                                                                                     |
-- |                                                                                                                            |                                                                                                                        | Compute                                                                                                               |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.CommandBuffer', 'CopyBufferToImageInfo2KHR'
cmdCopyBufferToImage2KHR :: forall io
                          . (MonadIO io)
                         => -- | @commandBuffer@ is the command buffer into which the command will be
                            -- recorded.
                            CommandBuffer
                         -> -- | @pCopyBufferToImageInfo@ is a pointer to a 'CopyBufferToImageInfo2KHR'
                            -- structure describing the copy parameters.
                            CopyBufferToImageInfo2KHR
                         -> io ()
cmdCopyBufferToImage2KHR :: CommandBuffer -> CopyBufferToImageInfo2KHR -> io ()
cmdCopyBufferToImage2KHR commandBuffer :: CommandBuffer
commandBuffer copyBufferToImageInfo :: CopyBufferToImageInfo2KHR
copyBufferToImageInfo = IO () -> io ()
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 vkCmdCopyBufferToImage2KHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
   -> IO ())
vkCmdCopyBufferToImage2KHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
      -> IO ())
pVkCmdCopyBufferToImage2KHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  IO () -> ContT () IO ()
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
   -> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
   -> IO ())
vkCmdCopyBufferToImage2KHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
   -> 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 "" "The function pointer for vkCmdCopyBufferToImage2KHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdCopyBufferToImage2KHR' :: Ptr CommandBuffer_T
-> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> IO ()
vkCmdCopyBufferToImage2KHR' = FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
   -> IO ())
-> Ptr CommandBuffer_T
-> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> IO ()
mkVkCmdCopyBufferToImage2KHR FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
   -> IO ())
vkCmdCopyBufferToImage2KHRPtr
  "pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
pCopyBufferToImageInfo <- ((("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
  -> IO ())
 -> IO ())
-> ContT
     () IO ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
   -> IO ())
  -> IO ())
 -> ContT
      () IO ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR))
-> ((("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
     -> IO ())
    -> IO ())
-> ContT
     () IO ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
forall a b. (a -> b) -> a -> b
$ CopyBufferToImageInfo2KHR
-> (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
    -> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyBufferToImageInfo2KHR
copyBufferToImageInfo)
  IO () -> ContT () IO ()
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 "vkCmdCopyBufferToImage2KHR" (Ptr CommandBuffer_T
-> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> IO ()
vkCmdCopyBufferToImage2KHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) "pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
pCopyBufferToImageInfo)
  () -> ContT () IO ()
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" mkVkCmdCopyImageToBuffer2KHR
  :: FunPtr (Ptr CommandBuffer_T -> Ptr CopyImageToBufferInfo2KHR -> IO ()) -> Ptr CommandBuffer_T -> Ptr CopyImageToBufferInfo2KHR -> IO ()

-- | vkCmdCopyImageToBuffer2KHR - Copy image data into a buffer
--
-- = Description
--
-- This command is functionally identical to
-- 'Vulkan.Core10.CommandBufferBuilding.cmdCopyImageToBuffer', but includes
-- extensible sub-structures that include @sType@ and @pNext@ parameters,
-- allowing them to be more easily extended.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdCopyImageToBuffer2KHR-commandBuffer-01831# If
--     @commandBuffer@ is an unprotected command buffer, then @srcImage@
--     /must/ not be a protected image
--
-- -   #VUID-vkCmdCopyImageToBuffer2KHR-commandBuffer-01832# If
--     @commandBuffer@ is an unprotected command buffer, then @dstBuffer@
--     /must/ not be a protected buffer
--
-- -   #VUID-vkCmdCopyImageToBuffer2KHR-commandBuffer-01833# If
--     @commandBuffer@ is a protected command buffer, then @dstBuffer@
--     /must/ not be an unprotected buffer
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdCopyImageToBuffer2KHR-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdCopyImageToBuffer2KHR-pCopyImageToBufferInfo-parameter#
--     @pCopyImageToBufferInfo@ /must/ be a valid pointer to a valid
--     'CopyImageToBufferInfo2KHR' structure
--
-- -   #VUID-vkCmdCopyImageToBuffer2KHR-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-vkCmdCopyImageToBuffer2KHR-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support transfer, graphics, or compute
--     operations
--
-- -   #VUID-vkCmdCopyImageToBuffer2KHR-renderpass# This command /must/
--     only be called outside of a render pass instance
--
-- == 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#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Transfer                                                                                                              | Transfer                                                                                                                            |
-- | Secondary                                                                                                                  |                                                                                                                        | Graphics                                                                                                              |                                                                                                                                     |
-- |                                                                                                                            |                                                                                                                        | Compute                                                                                                               |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.CommandBuffer', 'CopyImageToBufferInfo2KHR'
cmdCopyImageToBuffer2KHR :: forall io
                          . (MonadIO io)
                         => -- | @commandBuffer@ is the command buffer into which the command will be
                            -- recorded.
                            CommandBuffer
                         -> -- | @pCopyImageToBufferInfo@ is a pointer to a 'cmdCopyImageToBuffer2KHR'
                            -- structure describing the copy parameters.
                            CopyImageToBufferInfo2KHR
                         -> io ()
cmdCopyImageToBuffer2KHR :: CommandBuffer -> CopyImageToBufferInfo2KHR -> io ()
cmdCopyImageToBuffer2KHR commandBuffer :: CommandBuffer
commandBuffer copyImageToBufferInfo :: CopyImageToBufferInfo2KHR
copyImageToBufferInfo = IO () -> io ()
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 vkCmdCopyImageToBuffer2KHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
   -> IO ())
vkCmdCopyImageToBuffer2KHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
      -> IO ())
pVkCmdCopyImageToBuffer2KHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  IO () -> ContT () IO ()
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
   -> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
   -> IO ())
vkCmdCopyImageToBuffer2KHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
   -> 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 "" "The function pointer for vkCmdCopyImageToBuffer2KHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdCopyImageToBuffer2KHR' :: Ptr CommandBuffer_T
-> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> IO ()
vkCmdCopyImageToBuffer2KHR' = FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
   -> IO ())
-> Ptr CommandBuffer_T
-> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> IO ()
mkVkCmdCopyImageToBuffer2KHR FunPtr
  (Ptr CommandBuffer_T
   -> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
   -> IO ())
vkCmdCopyImageToBuffer2KHRPtr
  "pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
pCopyImageToBufferInfo <- ((("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
  -> IO ())
 -> IO ())
-> ContT
     () IO ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
   -> IO ())
  -> IO ())
 -> ContT
      () IO ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR))
-> ((("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
     -> IO ())
    -> IO ())
-> ContT
     () IO ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
forall a b. (a -> b) -> a -> b
$ CopyImageToBufferInfo2KHR
-> (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
    -> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyImageToBufferInfo2KHR
copyImageToBufferInfo)
  IO () -> ContT () IO ()
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 "vkCmdCopyImageToBuffer2KHR" (Ptr CommandBuffer_T
-> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> IO ()
vkCmdCopyImageToBuffer2KHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) "pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
pCopyImageToBufferInfo)
  () -> ContT () IO ()
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" mkVkCmdResolveImage2KHR
  :: FunPtr (Ptr CommandBuffer_T -> Ptr ResolveImageInfo2KHR -> IO ()) -> Ptr CommandBuffer_T -> Ptr ResolveImageInfo2KHR -> IO ()

-- | vkCmdResolveImage2KHR - Resolve regions of an image
--
-- = Description
--
-- This command is functionally identical to
-- 'Vulkan.Core10.CommandBufferBuilding.cmdResolveImage', but includes
-- extensible sub-structures that include @sType@ and @pNext@ parameters,
-- allowing them to be more easily extended.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdResolveImage2KHR-commandBuffer-01837# If @commandBuffer@
--     is an unprotected command buffer, then @srcImage@ /must/ not be a
--     protected image
--
-- -   #VUID-vkCmdResolveImage2KHR-commandBuffer-01838# If @commandBuffer@
--     is an unprotected command buffer, then @dstImage@ /must/ not be a
--     protected image
--
-- -   #VUID-vkCmdResolveImage2KHR-commandBuffer-01839# If @commandBuffer@
--     is a protected command buffer, then @dstImage@ /must/ not be an
--     unprotected image
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdResolveImage2KHR-commandBuffer-parameter# @commandBuffer@
--     /must/ be a valid 'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdResolveImage2KHR-pResolveImageInfo-parameter#
--     @pResolveImageInfo@ /must/ be a valid pointer to a valid
--     'ResolveImageInfo2KHR' structure
--
-- -   #VUID-vkCmdResolveImage2KHR-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-vkCmdResolveImage2KHR-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics operations
--
-- -   #VUID-vkCmdResolveImage2KHR-renderpass# This command /must/ only be
--     called outside of a render pass instance
--
-- == 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#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Graphics                                                                                                              | Transfer                                                                                                                            |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                       |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.CommandBuffer', 'ResolveImageInfo2KHR'
cmdResolveImage2KHR :: forall io
                     . (MonadIO io)
                    => -- | @commandBuffer@ is the command buffer into which the command will be
                       -- recorded.
                       CommandBuffer
                    -> -- | @pResolveImageInfo@ is a pointer to a 'ResolveImageInfo2KHR' structure
                       -- describing the resolve parameters.
                       ResolveImageInfo2KHR
                    -> io ()
cmdResolveImage2KHR :: CommandBuffer -> ResolveImageInfo2KHR -> io ()
cmdResolveImage2KHR commandBuffer :: CommandBuffer
commandBuffer resolveImageInfo :: ResolveImageInfo2KHR
resolveImageInfo = IO () -> io ()
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 vkCmdResolveImage2KHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO ())
vkCmdResolveImage2KHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO ())
pVkCmdResolveImage2KHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  IO () -> ContT () IO ()
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
   -> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO ())
vkCmdResolveImage2KHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> 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 "" "The function pointer for vkCmdResolveImage2KHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdResolveImage2KHR' :: Ptr CommandBuffer_T
-> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO ()
vkCmdResolveImage2KHR' = FunPtr
  (Ptr CommandBuffer_T
   -> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO ())
-> Ptr CommandBuffer_T
-> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> IO ()
mkVkCmdResolveImage2KHR FunPtr
  (Ptr CommandBuffer_T
   -> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO ())
vkCmdResolveImage2KHRPtr
  "pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
pResolveImageInfo <- ((("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO ())
 -> IO ())
-> ContT () IO ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO ())
  -> IO ())
 -> ContT () IO ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR))
-> ((("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO ())
    -> IO ())
-> ContT () IO ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
forall a b. (a -> b) -> a -> b
$ ResolveImageInfo2KHR
-> (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (ResolveImageInfo2KHR
resolveImageInfo)
  IO () -> ContT () IO ()
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 "vkCmdResolveImage2KHR" (Ptr CommandBuffer_T
-> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO ()
vkCmdResolveImage2KHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) "pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
pResolveImageInfo)
  () -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


-- | VkBufferCopy2KHR - Structure specifying a buffer copy operation
--
-- == Valid Usage
--
-- -   #VUID-VkBufferCopy2KHR-size-01988# The @size@ /must/ be greater than
--     @0@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkBufferCopy2KHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BUFFER_COPY_2_KHR'
--
-- -   #VUID-VkBufferCopy2KHR-pNext-pNext# @pNext@ /must/ be @NULL@
--
-- = See Also
--
-- 'CopyBufferInfo2KHR', 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data BufferCopy2KHR = BufferCopy2KHR
  { -- | @srcOffset@ is the starting offset in bytes from the start of
    -- @srcBuffer@.
    BufferCopy2KHR -> DeviceSize
srcOffset :: DeviceSize
  , -- | @dstOffset@ is the starting offset in bytes from the start of
    -- @dstBuffer@.
    BufferCopy2KHR -> DeviceSize
dstOffset :: DeviceSize
  , -- | @size@ is the number of bytes to copy.
    BufferCopy2KHR -> DeviceSize
size :: DeviceSize
  }
  deriving (Typeable, BufferCopy2KHR -> BufferCopy2KHR -> Bool
(BufferCopy2KHR -> BufferCopy2KHR -> Bool)
-> (BufferCopy2KHR -> BufferCopy2KHR -> Bool) -> Eq BufferCopy2KHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BufferCopy2KHR -> BufferCopy2KHR -> Bool
$c/= :: BufferCopy2KHR -> BufferCopy2KHR -> Bool
== :: BufferCopy2KHR -> BufferCopy2KHR -> Bool
$c== :: BufferCopy2KHR -> BufferCopy2KHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BufferCopy2KHR)
#endif
deriving instance Show BufferCopy2KHR

instance ToCStruct BufferCopy2KHR where
  withCStruct :: BufferCopy2KHR -> (Ptr BufferCopy2KHR -> IO b) -> IO b
withCStruct x :: BufferCopy2KHR
x f :: Ptr BufferCopy2KHR -> IO b
f = Int -> Int -> (Ptr BufferCopy2KHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 40 8 ((Ptr BufferCopy2KHR -> IO b) -> IO b)
-> (Ptr BufferCopy2KHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr BufferCopy2KHR
p -> Ptr BufferCopy2KHR -> BufferCopy2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BufferCopy2KHR
p BufferCopy2KHR
x (Ptr BufferCopy2KHR -> IO b
f Ptr BufferCopy2KHR
p)
  pokeCStruct :: Ptr BufferCopy2KHR -> BufferCopy2KHR -> IO b -> IO b
pokeCStruct p :: Ptr BufferCopy2KHR
p BufferCopy2KHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2KHR
p Ptr BufferCopy2KHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_COPY_2_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2KHR
p Ptr BufferCopy2KHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2KHR
p Ptr BufferCopy2KHR -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DeviceSize)) (DeviceSize
srcOffset)
    Ptr DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2KHR
p Ptr BufferCopy2KHR -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr DeviceSize)) (DeviceSize
dstOffset)
    Ptr DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2KHR
p Ptr BufferCopy2KHR -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr DeviceSize)) (DeviceSize
size)
    IO b
f
  cStructSize :: Int
cStructSize = 40
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr BufferCopy2KHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr BufferCopy2KHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2KHR
p Ptr BufferCopy2KHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_COPY_2_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2KHR
p Ptr BufferCopy2KHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2KHR
p Ptr BufferCopy2KHR -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DeviceSize)) (DeviceSize
forall a. Zero a => a
zero)
    Ptr DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2KHR
p Ptr BufferCopy2KHR -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr DeviceSize)) (DeviceSize
forall a. Zero a => a
zero)
    Ptr DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2KHR
p Ptr BufferCopy2KHR -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr DeviceSize)) (DeviceSize
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct BufferCopy2KHR where
  peekCStruct :: Ptr BufferCopy2KHR -> IO BufferCopy2KHR
peekCStruct p :: Ptr BufferCopy2KHR
p = do
    DeviceSize
srcOffset <- Ptr DeviceSize -> IO DeviceSize
forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr BufferCopy2KHR
p Ptr BufferCopy2KHR -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DeviceSize))
    DeviceSize
dstOffset <- Ptr DeviceSize -> IO DeviceSize
forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr BufferCopy2KHR
p Ptr BufferCopy2KHR -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr DeviceSize))
    DeviceSize
size <- Ptr DeviceSize -> IO DeviceSize
forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr BufferCopy2KHR
p Ptr BufferCopy2KHR -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr DeviceSize))
    BufferCopy2KHR -> IO BufferCopy2KHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (BufferCopy2KHR -> IO BufferCopy2KHR)
-> BufferCopy2KHR -> IO BufferCopy2KHR
forall a b. (a -> b) -> a -> b
$ DeviceSize -> DeviceSize -> DeviceSize -> BufferCopy2KHR
BufferCopy2KHR
             DeviceSize
srcOffset DeviceSize
dstOffset DeviceSize
size

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

instance Zero BufferCopy2KHR where
  zero :: BufferCopy2KHR
zero = DeviceSize -> DeviceSize -> DeviceSize -> BufferCopy2KHR
BufferCopy2KHR
           DeviceSize
forall a. Zero a => a
zero
           DeviceSize
forall a. Zero a => a
zero
           DeviceSize
forall a. Zero a => a
zero


-- | VkImageCopy2KHR - Structure specifying an image copy operation
--
-- == Valid Usage
--
-- -   #VUID-VkImageCopy2KHR-extent-00140# The number of slices of the
--     @extent@ (for 3D) or layers of the @srcSubresource@ (for non-3D)
--     /must/ match the number of slices of the @extent@ (for 3D) or layers
--     of the @dstSubresource@ (for non-3D)
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkImageCopy2KHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMAGE_COPY_2_KHR'
--
-- -   #VUID-VkImageCopy2KHR-pNext-pNext# @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkImageCopy2KHR-srcSubresource-parameter# @srcSubresource@
--     /must/ be a valid
--     'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers'
--     structure
--
-- -   #VUID-VkImageCopy2KHR-dstSubresource-parameter# @dstSubresource@
--     /must/ be a valid
--     'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers'
--     structure
--
-- = See Also
--
-- 'CopyImageInfo2KHR', 'Vulkan.Core10.FundamentalTypes.Extent3D',
-- 'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers',
-- 'Vulkan.Core10.FundamentalTypes.Offset3D',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ImageCopy2KHR = ImageCopy2KHR
  { -- | @srcSubresource@ and @dstSubresource@ are
    -- 'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers' structures
    -- specifying the image subresources of the images used for the source and
    -- destination image data, respectively.
    ImageCopy2KHR -> ImageSubresourceLayers
srcSubresource :: ImageSubresourceLayers
  , -- | @srcOffset@ and @dstOffset@ select the initial @x@, @y@, and @z@ offsets
    -- in texels of the sub-regions of the source and destination image data.
    ImageCopy2KHR -> Offset3D
srcOffset :: Offset3D
  , -- No documentation found for Nested "VkImageCopy2KHR" "dstSubresource"
    ImageCopy2KHR -> ImageSubresourceLayers
dstSubresource :: ImageSubresourceLayers
  , -- No documentation found for Nested "VkImageCopy2KHR" "dstOffset"
    ImageCopy2KHR -> Offset3D
dstOffset :: Offset3D
  , -- | @extent@ is the size in texels of the image to copy in @width@, @height@
    -- and @depth@.
    ImageCopy2KHR -> Extent3D
extent :: Extent3D
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImageCopy2KHR)
#endif
deriving instance Show ImageCopy2KHR

instance ToCStruct ImageCopy2KHR where
  withCStruct :: ImageCopy2KHR -> (Ptr ImageCopy2KHR -> IO b) -> IO b
withCStruct x :: ImageCopy2KHR
x f :: Ptr ImageCopy2KHR -> IO b
f = Int -> Int -> (Ptr ImageCopy2KHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 88 8 ((Ptr ImageCopy2KHR -> IO b) -> IO b)
-> (Ptr ImageCopy2KHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr ImageCopy2KHR
p -> Ptr ImageCopy2KHR -> ImageCopy2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageCopy2KHR
p ImageCopy2KHR
x (Ptr ImageCopy2KHR -> IO b
f Ptr ImageCopy2KHR
p)
  pokeCStruct :: Ptr ImageCopy2KHR -> ImageCopy2KHR -> IO b -> IO b
pokeCStruct p :: Ptr ImageCopy2KHR
p ImageCopy2KHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_COPY_2_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ImageSubresourceLayers -> ImageSubresourceLayers -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
srcSubresource)
    Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Offset3D)) (Offset3D
srcOffset)
    Ptr ImageSubresourceLayers -> ImageSubresourceLayers -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
dstSubresource)
    Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Offset3D)) (Offset3D
dstOffset)
    Ptr Extent3D -> Extent3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr Extent3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr Extent3D)) (Extent3D
extent)
    IO b
f
  cStructSize :: Int
cStructSize = 88
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr ImageCopy2KHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr ImageCopy2KHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_COPY_2_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ImageSubresourceLayers -> ImageSubresourceLayers -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
forall a. Zero a => a
zero)
    Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Offset3D)) (Offset3D
forall a. Zero a => a
zero)
    Ptr ImageSubresourceLayers -> ImageSubresourceLayers -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
forall a. Zero a => a
zero)
    Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Offset3D)) (Offset3D
forall a. Zero a => a
zero)
    Ptr Extent3D -> Extent3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr Extent3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr Extent3D)) (Extent3D
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct ImageCopy2KHR where
  peekCStruct :: Ptr ImageCopy2KHR -> IO ImageCopy2KHR
peekCStruct p :: Ptr ImageCopy2KHR
p = do
    ImageSubresourceLayers
srcSubresource <- Ptr ImageSubresourceLayers -> IO ImageSubresourceLayers
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresourceLayers ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageSubresourceLayers))
    Offset3D
srcOffset <- Ptr Offset3D -> IO Offset3D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Offset3D))
    ImageSubresourceLayers
dstSubresource <- Ptr ImageSubresourceLayers -> IO ImageSubresourceLayers
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresourceLayers ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr ImageSubresourceLayers))
    Offset3D
dstOffset <- Ptr Offset3D -> IO Offset3D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Offset3D))
    Extent3D
extent <- Ptr Extent3D -> IO Extent3D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent3D ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr Extent3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr Extent3D))
    ImageCopy2KHR -> IO ImageCopy2KHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ImageCopy2KHR -> IO ImageCopy2KHR)
-> ImageCopy2KHR -> IO ImageCopy2KHR
forall a b. (a -> b) -> a -> b
$ ImageSubresourceLayers
-> Offset3D
-> ImageSubresourceLayers
-> Offset3D
-> Extent3D
-> ImageCopy2KHR
ImageCopy2KHR
             ImageSubresourceLayers
srcSubresource Offset3D
srcOffset ImageSubresourceLayers
dstSubresource Offset3D
dstOffset Extent3D
extent

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

instance Zero ImageCopy2KHR where
  zero :: ImageCopy2KHR
zero = ImageSubresourceLayers
-> Offset3D
-> ImageSubresourceLayers
-> Offset3D
-> Extent3D
-> ImageCopy2KHR
ImageCopy2KHR
           ImageSubresourceLayers
forall a. Zero a => a
zero
           Offset3D
forall a. Zero a => a
zero
           ImageSubresourceLayers
forall a. Zero a => a
zero
           Offset3D
forall a. Zero a => a
zero
           Extent3D
forall a. Zero a => a
zero


-- | VkImageBlit2KHR - Structure specifying an image blit operation
--
-- = Description
--
-- For each element of the @pRegions@ array, a blit operation is performed
-- for the specified source and destination regions.
--
-- == Valid Usage
--
-- -   #VUID-VkImageBlit2KHR-aspectMask-00238# The @aspectMask@ member of
--     @srcSubresource@ and @dstSubresource@ /must/ match
--
-- -   #VUID-VkImageBlit2KHR-layerCount-00239# The @layerCount@ member of
--     @srcSubresource@ and @dstSubresource@ /must/ match
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkImageBlit2KHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMAGE_BLIT_2_KHR'
--
-- -   #VUID-VkImageBlit2KHR-pNext-pNext# @pNext@ /must/ be @NULL@ or a
--     pointer to a valid instance of
--     'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM'
--
-- -   #VUID-VkImageBlit2KHR-sType-unique# The @sType@ value of each struct
--     in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkImageBlit2KHR-srcSubresource-parameter# @srcSubresource@
--     /must/ be a valid
--     'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers'
--     structure
--
-- -   #VUID-VkImageBlit2KHR-dstSubresource-parameter# @dstSubresource@
--     /must/ be a valid
--     'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers'
--     structure
--
-- = See Also
--
-- 'BlitImageInfo2KHR',
-- 'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers',
-- 'Vulkan.Core10.FundamentalTypes.Offset3D',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ImageBlit2KHR (es :: [Type]) = ImageBlit2KHR
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    ImageBlit2KHR es -> Chain es
next :: Chain es
  , -- | @srcSubresource@ is the subresource to blit from.
    ImageBlit2KHR es -> ImageSubresourceLayers
srcSubresource :: ImageSubresourceLayers
  , -- | @srcOffsets@ is a pointer to an array of two
    -- 'Vulkan.Core10.FundamentalTypes.Offset3D' structures specifying the
    -- bounds of the source region within @srcSubresource@.
    ImageBlit2KHR es -> (Offset3D, Offset3D)
srcOffsets :: (Offset3D, Offset3D)
  , -- | @dstSubresource@ is the subresource to blit into.
    ImageBlit2KHR es -> ImageSubresourceLayers
dstSubresource :: ImageSubresourceLayers
  , -- | @dstOffsets@ is a pointer to an array of two
    -- 'Vulkan.Core10.FundamentalTypes.Offset3D' structures specifying the
    -- bounds of the destination region within @dstSubresource@.
    ImageBlit2KHR es -> (Offset3D, Offset3D)
dstOffsets :: (Offset3D, Offset3D)
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImageBlit2KHR (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (ImageBlit2KHR es)

instance Extensible ImageBlit2KHR where
  extensibleTypeName :: String
extensibleTypeName = "ImageBlit2KHR"
  setNext :: ImageBlit2KHR ds -> Chain es -> ImageBlit2KHR es
setNext x :: ImageBlit2KHR ds
x next :: Chain es
next = ImageBlit2KHR ds
x{$sel:next:ImageBlit2KHR :: Chain es
next = Chain es
next}
  getNext :: ImageBlit2KHR es -> Chain es
getNext ImageBlit2KHR{..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends ImageBlit2KHR e => b) -> Maybe b
  extends :: proxy e -> (Extends ImageBlit2KHR e => b) -> Maybe b
extends _ f :: Extends ImageBlit2KHR e => b
f
    | Just Refl <- (Typeable e, Typeable CopyCommandTransformInfoQCOM) =>
Maybe (e :~: CopyCommandTransformInfoQCOM)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @CopyCommandTransformInfoQCOM = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends ImageBlit2KHR e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance (Extendss ImageBlit2KHR es, PokeChain es) => ToCStruct (ImageBlit2KHR es) where
  withCStruct :: ImageBlit2KHR es -> (Ptr (ImageBlit2KHR es) -> IO b) -> IO b
withCStruct x :: ImageBlit2KHR es
x f :: Ptr (ImageBlit2KHR es) -> IO b
f = Int -> Int -> (Ptr (ImageBlit2KHR es) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 96 8 ((Ptr (ImageBlit2KHR es) -> IO b) -> IO b)
-> (Ptr (ImageBlit2KHR es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr (ImageBlit2KHR es)
p -> Ptr (ImageBlit2KHR es) -> ImageBlit2KHR es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (ImageBlit2KHR es)
p ImageBlit2KHR es
x (Ptr (ImageBlit2KHR es) -> IO b
f Ptr (ImageBlit2KHR es)
p)
  pokeCStruct :: Ptr (ImageBlit2KHR es) -> ImageBlit2KHR es -> IO b -> IO b
pokeCStruct p :: Ptr (ImageBlit2KHR es)
p ImageBlit2KHR{..} f :: 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 (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 (ImageBlit2KHR es)
p Ptr (ImageBlit2KHR es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_BLIT_2_KHR)
    Ptr ()
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
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
withChain (Chain es
next)
    IO () -> ContT b IO ()
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 (ImageBlit2KHR es)
p Ptr (ImageBlit2KHR es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) Ptr ()
pNext''
    IO () -> ContT b IO ()
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 ImageSubresourceLayers -> ImageSubresourceLayers -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageBlit2KHR es)
p Ptr (ImageBlit2KHR es) -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
srcSubresource)
    let pSrcOffsets' :: Ptr Offset3D
pSrcOffsets' = Ptr (FixedArray 2 Offset3D) -> Ptr Offset3D
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr (ImageBlit2KHR es)
p Ptr (ImageBlit2KHR es) -> Int -> Ptr (FixedArray 2 Offset3D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (FixedArray 2 Offset3D)))
    IO () -> ContT b IO ()
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
$ case ((Offset3D, Offset3D)
srcOffsets) of
      (e0 :: Offset3D
e0, e1 :: Offset3D
e1) -> do
        Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset3D
pSrcOffsets' :: Ptr Offset3D) (Offset3D
e0)
        Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset3D
pSrcOffsets' Ptr Offset3D -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Offset3D) (Offset3D
e1)
    IO () -> ContT b IO ()
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 ImageSubresourceLayers -> ImageSubresourceLayers -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageBlit2KHR es)
p Ptr (ImageBlit2KHR es) -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
dstSubresource)
    let pDstOffsets' :: Ptr Offset3D
pDstOffsets' = Ptr (FixedArray 2 Offset3D) -> Ptr Offset3D
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr (ImageBlit2KHR es)
p Ptr (ImageBlit2KHR es) -> Int -> Ptr (FixedArray 2 Offset3D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr (FixedArray 2 Offset3D)))
    IO () -> ContT b IO ()
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
$ case ((Offset3D, Offset3D)
dstOffsets) of
      (e0 :: Offset3D
e0, e1 :: Offset3D
e1) -> do
        Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset3D
pDstOffsets' :: Ptr Offset3D) (Offset3D
e0)
        Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset3D
pDstOffsets' Ptr Offset3D -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Offset3D) (Offset3D
e1)
    IO b -> ContT b IO b
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 = 96
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr (ImageBlit2KHR es) -> IO b -> IO b
pokeZeroCStruct p :: Ptr (ImageBlit2KHR es)
p f :: 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 (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 (ImageBlit2KHR es)
p Ptr (ImageBlit2KHR es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_BLIT_2_KHR)
    Ptr ()
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
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 a. PokeChain es => (Ptr (Chain es) -> IO a) -> IO a
forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    IO () -> ContT b IO ()
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 (ImageBlit2KHR es)
p Ptr (ImageBlit2KHR es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) Ptr ()
pNext'
    IO () -> ContT b IO ()
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 ImageSubresourceLayers -> ImageSubresourceLayers -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageBlit2KHR es)
p Ptr (ImageBlit2KHR es) -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
forall a. Zero a => a
zero)
    let pSrcOffsets' :: Ptr Offset3D
pSrcOffsets' = Ptr (FixedArray 2 Offset3D) -> Ptr Offset3D
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr (ImageBlit2KHR es)
p Ptr (ImageBlit2KHR es) -> Int -> Ptr (FixedArray 2 Offset3D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (FixedArray 2 Offset3D)))
    IO () -> ContT b IO ()
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
$ case ((Offset3D
forall a. Zero a => a
zero, Offset3D
forall a. Zero a => a
zero)) of
      (e0 :: Offset3D
e0, e1 :: Offset3D
e1) -> do
        Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset3D
pSrcOffsets' :: Ptr Offset3D) (Offset3D
e0)
        Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset3D
pSrcOffsets' Ptr Offset3D -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Offset3D) (Offset3D
e1)
    IO () -> ContT b IO ()
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 ImageSubresourceLayers -> ImageSubresourceLayers -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageBlit2KHR es)
p Ptr (ImageBlit2KHR es) -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
forall a. Zero a => a
zero)
    let pDstOffsets' :: Ptr Offset3D
pDstOffsets' = Ptr (FixedArray 2 Offset3D) -> Ptr Offset3D
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr (ImageBlit2KHR es)
p Ptr (ImageBlit2KHR es) -> Int -> Ptr (FixedArray 2 Offset3D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr (FixedArray 2 Offset3D)))
    IO () -> ContT b IO ()
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
$ case ((Offset3D
forall a. Zero a => a
zero, Offset3D
forall a. Zero a => a
zero)) of
      (e0 :: Offset3D
e0, e1 :: Offset3D
e1) -> do
        Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset3D
pDstOffsets' :: Ptr Offset3D) (Offset3D
e0)
        Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset3D
pDstOffsets' Ptr Offset3D -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Offset3D) (Offset3D
e1)
    IO b -> ContT b IO b
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 ImageBlit2KHR es, PeekChain es) => FromCStruct (ImageBlit2KHR es) where
  peekCStruct :: Ptr (ImageBlit2KHR es) -> IO (ImageBlit2KHR es)
peekCStruct p :: Ptr (ImageBlit2KHR es)
p = do
    Ptr ()
pNext <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (ImageBlit2KHR es)
p Ptr (ImageBlit2KHR es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 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)
    ImageSubresourceLayers
srcSubresource <- Ptr ImageSubresourceLayers -> IO ImageSubresourceLayers
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresourceLayers ((Ptr (ImageBlit2KHR es)
p Ptr (ImageBlit2KHR es) -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageSubresourceLayers))
    let psrcOffsets :: Ptr Offset3D
psrcOffsets = Ptr (FixedArray 2 Offset3D) -> Ptr Offset3D
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr @Offset3D ((Ptr (ImageBlit2KHR es)
p Ptr (ImageBlit2KHR es) -> Int -> Ptr (FixedArray 2 Offset3D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (FixedArray 2 Offset3D)))
    Offset3D
srcOffsets0 <- Ptr Offset3D -> IO Offset3D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr Offset3D
psrcOffsets Ptr Offset3D -> Int -> Ptr Offset3D
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 0 :: Ptr Offset3D))
    Offset3D
srcOffsets1 <- Ptr Offset3D -> IO Offset3D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr Offset3D
psrcOffsets Ptr Offset3D -> Int -> Ptr Offset3D
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 12 :: Ptr Offset3D))
    ImageSubresourceLayers
dstSubresource <- Ptr ImageSubresourceLayers -> IO ImageSubresourceLayers
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresourceLayers ((Ptr (ImageBlit2KHR es)
p Ptr (ImageBlit2KHR es) -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr ImageSubresourceLayers))
    let pdstOffsets :: Ptr Offset3D
pdstOffsets = Ptr (FixedArray 2 Offset3D) -> Ptr Offset3D
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr @Offset3D ((Ptr (ImageBlit2KHR es)
p Ptr (ImageBlit2KHR es) -> Int -> Ptr (FixedArray 2 Offset3D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr (FixedArray 2 Offset3D)))
    Offset3D
dstOffsets0 <- Ptr Offset3D -> IO Offset3D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr Offset3D
pdstOffsets Ptr Offset3D -> Int -> Ptr Offset3D
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 0 :: Ptr Offset3D))
    Offset3D
dstOffsets1 <- Ptr Offset3D -> IO Offset3D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr Offset3D
pdstOffsets Ptr Offset3D -> Int -> Ptr Offset3D
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 12 :: Ptr Offset3D))
    ImageBlit2KHR es -> IO (ImageBlit2KHR es)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ImageBlit2KHR es -> IO (ImageBlit2KHR es))
-> ImageBlit2KHR es -> IO (ImageBlit2KHR es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> ImageSubresourceLayers
-> (Offset3D, Offset3D)
-> ImageSubresourceLayers
-> (Offset3D, Offset3D)
-> ImageBlit2KHR es
forall (es :: [*]).
Chain es
-> ImageSubresourceLayers
-> (Offset3D, Offset3D)
-> ImageSubresourceLayers
-> (Offset3D, Offset3D)
-> ImageBlit2KHR es
ImageBlit2KHR
             Chain es
next ImageSubresourceLayers
srcSubresource ((Offset3D
srcOffsets0, Offset3D
srcOffsets1)) ImageSubresourceLayers
dstSubresource ((Offset3D
dstOffsets0, Offset3D
dstOffsets1))

instance es ~ '[] => Zero (ImageBlit2KHR es) where
  zero :: ImageBlit2KHR es
zero = Chain es
-> ImageSubresourceLayers
-> (Offset3D, Offset3D)
-> ImageSubresourceLayers
-> (Offset3D, Offset3D)
-> ImageBlit2KHR es
forall (es :: [*]).
Chain es
-> ImageSubresourceLayers
-> (Offset3D, Offset3D)
-> ImageSubresourceLayers
-> (Offset3D, Offset3D)
-> ImageBlit2KHR es
ImageBlit2KHR
           ()
           ImageSubresourceLayers
forall a. Zero a => a
zero
           (Offset3D
forall a. Zero a => a
zero, Offset3D
forall a. Zero a => a
zero)
           ImageSubresourceLayers
forall a. Zero a => a
zero
           (Offset3D
forall a. Zero a => a
zero, Offset3D
forall a. Zero a => a
zero)


-- | VkBufferImageCopy2KHR - Structure specifying a buffer image copy
-- operation
--
-- = Description
--
-- This structure is functionally identical to
-- 'Vulkan.Core10.CommandBufferBuilding.BufferImageCopy', but adds @sType@
-- and @pNext@ parameters, allowing it to be more easily extended.
--
-- == Valid Usage
--
-- -   #VUID-VkBufferImageCopy2KHR-bufferRowLength-00195# @bufferRowLength@
--     /must/ be @0@, or greater than or equal to the @width@ member of
--     @imageExtent@
--
-- -   #VUID-VkBufferImageCopy2KHR-bufferImageHeight-00196#
--     @bufferImageHeight@ /must/ be @0@, or greater than or equal to the
--     @height@ member of @imageExtent@
--
-- -   #VUID-VkBufferImageCopy2KHR-aspectMask-00212# The @aspectMask@
--     member of @imageSubresource@ /must/ only have a single bit set
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkBufferImageCopy2KHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2_KHR'
--
-- -   #VUID-VkBufferImageCopy2KHR-pNext-pNext# @pNext@ /must/ be @NULL@ or
--     a pointer to a valid instance of
--     'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM'
--
-- -   #VUID-VkBufferImageCopy2KHR-sType-unique# The @sType@ value of each
--     struct in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkBufferImageCopy2KHR-imageSubresource-parameter#
--     @imageSubresource@ /must/ be a valid
--     'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers'
--     structure
--
-- = See Also
--
-- 'CopyBufferToImageInfo2KHR', 'CopyImageToBufferInfo2KHR',
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Core10.FundamentalTypes.Extent3D',
-- 'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers',
-- 'Vulkan.Core10.FundamentalTypes.Offset3D',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data BufferImageCopy2KHR (es :: [Type]) = BufferImageCopy2KHR
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    BufferImageCopy2KHR es -> Chain es
next :: Chain es
  , -- | @bufferOffset@ is the offset in bytes from the start of the buffer
    -- object where the image data is copied from or to.
    BufferImageCopy2KHR es -> DeviceSize
bufferOffset :: DeviceSize
  , -- | @bufferRowLength@ and @bufferImageHeight@ specify in texels a subregion
    -- of a larger two- or three-dimensional image in buffer memory, and
    -- control the addressing calculations. If either of these values is zero,
    -- that aspect of the buffer memory is considered to be tightly packed
    -- according to the @imageExtent@.
    BufferImageCopy2KHR es -> Word32
bufferRowLength :: Word32
  , -- No documentation found for Nested "VkBufferImageCopy2KHR" "bufferImageHeight"
    BufferImageCopy2KHR es -> Word32
bufferImageHeight :: Word32
  , -- | @imageSubresource@ is a
    -- 'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers' used to
    -- specify the specific image subresources of the image used for the source
    -- or destination image data.
    BufferImageCopy2KHR es -> ImageSubresourceLayers
imageSubresource :: ImageSubresourceLayers
  , -- | @imageOffset@ selects the initial @x@, @y@, @z@ offsets in texels of the
    -- sub-region of the source or destination image data.
    BufferImageCopy2KHR es -> Offset3D
imageOffset :: Offset3D
  , -- | @imageExtent@ is the size in texels of the image to copy in @width@,
    -- @height@ and @depth@.
    BufferImageCopy2KHR es -> Extent3D
imageExtent :: Extent3D
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BufferImageCopy2KHR (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (BufferImageCopy2KHR es)

instance Extensible BufferImageCopy2KHR where
  extensibleTypeName :: String
extensibleTypeName = "BufferImageCopy2KHR"
  setNext :: BufferImageCopy2KHR ds -> Chain es -> BufferImageCopy2KHR es
setNext x :: BufferImageCopy2KHR ds
x next :: Chain es
next = BufferImageCopy2KHR ds
x{$sel:next:BufferImageCopy2KHR :: Chain es
next = Chain es
next}
  getNext :: BufferImageCopy2KHR es -> Chain es
getNext BufferImageCopy2KHR{..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends BufferImageCopy2KHR e => b) -> Maybe b
  extends :: proxy e -> (Extends BufferImageCopy2KHR e => b) -> Maybe b
extends _ f :: Extends BufferImageCopy2KHR e => b
f
    | Just Refl <- (Typeable e, Typeable CopyCommandTransformInfoQCOM) =>
Maybe (e :~: CopyCommandTransformInfoQCOM)
forall k (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @CopyCommandTransformInfoQCOM = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends BufferImageCopy2KHR e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance (Extendss BufferImageCopy2KHR es, PokeChain es) => ToCStruct (BufferImageCopy2KHR es) where
  withCStruct :: BufferImageCopy2KHR es
-> (Ptr (BufferImageCopy2KHR es) -> IO b) -> IO b
withCStruct x :: BufferImageCopy2KHR es
x f :: Ptr (BufferImageCopy2KHR es) -> IO b
f = Int -> Int -> (Ptr (BufferImageCopy2KHR es) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 72 8 ((Ptr (BufferImageCopy2KHR es) -> IO b) -> IO b)
-> (Ptr (BufferImageCopy2KHR es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr (BufferImageCopy2KHR es)
p -> Ptr (BufferImageCopy2KHR es)
-> BufferImageCopy2KHR es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (BufferImageCopy2KHR es)
p BufferImageCopy2KHR es
x (Ptr (BufferImageCopy2KHR es) -> IO b
f Ptr (BufferImageCopy2KHR es)
p)
  pokeCStruct :: Ptr (BufferImageCopy2KHR es)
-> BufferImageCopy2KHR es -> IO b -> IO b
pokeCStruct p :: Ptr (BufferImageCopy2KHR es)
p BufferImageCopy2KHR{..} f :: 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 (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 (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2_KHR)
    Ptr ()
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
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
withChain (Chain es
next)
    IO () -> ContT b IO ()
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 (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) Ptr ()
pNext''
    IO () -> ContT b IO ()
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 DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DeviceSize)) (DeviceSize
bufferOffset)
    IO () -> ContT b IO ()
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 (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32)) (Word32
bufferRowLength)
    IO () -> ContT b IO ()
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 (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32)) (Word32
bufferImageHeight)
    IO () -> ContT b IO ()
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 ImageSubresourceLayers -> ImageSubresourceLayers -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
imageSubresource)
    IO () -> ContT b IO ()
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 Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Offset3D)) (Offset3D
imageOffset)
    IO () -> ContT b IO ()
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 Extent3D -> Extent3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr Extent3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Extent3D)) (Extent3D
imageExtent)
    IO b -> ContT b IO b
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 = 72
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr (BufferImageCopy2KHR es) -> IO b -> IO b
pokeZeroCStruct p :: Ptr (BufferImageCopy2KHR es)
p f :: 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 (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 (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2_KHR)
    Ptr ()
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
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 a. PokeChain es => (Ptr (Chain es) -> IO a) -> IO a
forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    IO () -> ContT b IO ()
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 (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) Ptr ()
pNext'
    IO () -> ContT b IO ()
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 DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DeviceSize)) (DeviceSize
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 ImageSubresourceLayers -> ImageSubresourceLayers -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Offset3D)) (Offset3D
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 Extent3D -> Extent3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr Extent3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Extent3D)) (Extent3D
forall a. Zero a => a
zero)
    IO b -> ContT b IO b
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 BufferImageCopy2KHR es, PeekChain es) => FromCStruct (BufferImageCopy2KHR es) where
  peekCStruct :: Ptr (BufferImageCopy2KHR es) -> IO (BufferImageCopy2KHR es)
peekCStruct p :: Ptr (BufferImageCopy2KHR es)
p = do
    Ptr ()
pNext <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 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)
    DeviceSize
bufferOffset <- Ptr DeviceSize -> IO DeviceSize
forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr DeviceSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DeviceSize))
    Word32
bufferRowLength <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32))
    Word32
bufferImageHeight <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32))
    ImageSubresourceLayers
imageSubresource <- Ptr ImageSubresourceLayers -> IO ImageSubresourceLayers
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresourceLayers ((Ptr (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr ImageSubresourceLayers))
    Offset3D
imageOffset <- Ptr Offset3D -> IO Offset3D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Offset3D))
    Extent3D
imageExtent <- Ptr Extent3D -> IO Extent3D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent3D ((Ptr (BufferImageCopy2KHR es)
p Ptr (BufferImageCopy2KHR es) -> Int -> Ptr Extent3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Extent3D))
    BufferImageCopy2KHR es -> IO (BufferImageCopy2KHR es)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (BufferImageCopy2KHR es -> IO (BufferImageCopy2KHR es))
-> BufferImageCopy2KHR es -> IO (BufferImageCopy2KHR es)
forall a b. (a -> b) -> a -> b
$ Chain es
-> DeviceSize
-> Word32
-> Word32
-> ImageSubresourceLayers
-> Offset3D
-> Extent3D
-> BufferImageCopy2KHR es
forall (es :: [*]).
Chain es
-> DeviceSize
-> Word32
-> Word32
-> ImageSubresourceLayers
-> Offset3D
-> Extent3D
-> BufferImageCopy2KHR es
BufferImageCopy2KHR
             Chain es
next DeviceSize
bufferOffset Word32
bufferRowLength Word32
bufferImageHeight ImageSubresourceLayers
imageSubresource Offset3D
imageOffset Extent3D
imageExtent

instance es ~ '[] => Zero (BufferImageCopy2KHR es) where
  zero :: BufferImageCopy2KHR es
zero = Chain es
-> DeviceSize
-> Word32
-> Word32
-> ImageSubresourceLayers
-> Offset3D
-> Extent3D
-> BufferImageCopy2KHR es
forall (es :: [*]).
Chain es
-> DeviceSize
-> Word32
-> Word32
-> ImageSubresourceLayers
-> Offset3D
-> Extent3D
-> BufferImageCopy2KHR es
BufferImageCopy2KHR
           ()
           DeviceSize
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           ImageSubresourceLayers
forall a. Zero a => a
zero
           Offset3D
forall a. Zero a => a
zero
           Extent3D
forall a. Zero a => a
zero


-- | VkImageResolve2KHR - Structure specifying an image resolve operation
--
-- == Valid Usage
--
-- -   #VUID-VkImageResolve2KHR-aspectMask-00266# The @aspectMask@ member
--     of @srcSubresource@ and @dstSubresource@ /must/ only contain
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_COLOR_BIT'
--
-- -   #VUID-VkImageResolve2KHR-layerCount-00267# The @layerCount@ member
--     of @srcSubresource@ and @dstSubresource@ /must/ match
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkImageResolve2KHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMAGE_RESOLVE_2_KHR'
--
-- -   #VUID-VkImageResolve2KHR-pNext-pNext# @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkImageResolve2KHR-srcSubresource-parameter# @srcSubresource@
--     /must/ be a valid
--     'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers'
--     structure
--
-- -   #VUID-VkImageResolve2KHR-dstSubresource-parameter# @dstSubresource@
--     /must/ be a valid
--     'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers'
--     structure
--
-- = See Also
--
-- 'Vulkan.Core10.FundamentalTypes.Extent3D',
-- 'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers',
-- 'Vulkan.Core10.FundamentalTypes.Offset3D', 'ResolveImageInfo2KHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ImageResolve2KHR = ImageResolve2KHR
  { -- | @srcSubresource@ and @dstSubresource@ are
    -- 'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers' structures
    -- specifying the image subresources of the images used for the source and
    -- destination image data, respectively. Resolve of depth\/stencil images
    -- is not supported.
    ImageResolve2KHR -> ImageSubresourceLayers
srcSubresource :: ImageSubresourceLayers
  , -- | @srcOffset@ and @dstOffset@ select the initial @x@, @y@, and @z@ offsets
    -- in texels of the sub-regions of the source and destination image data.
    ImageResolve2KHR -> Offset3D
srcOffset :: Offset3D
  , -- No documentation found for Nested "VkImageResolve2KHR" "dstSubresource"
    ImageResolve2KHR -> ImageSubresourceLayers
dstSubresource :: ImageSubresourceLayers
  , -- No documentation found for Nested "VkImageResolve2KHR" "dstOffset"
    ImageResolve2KHR -> Offset3D
dstOffset :: Offset3D
  , -- | @extent@ is the size in texels of the source image to resolve in
    -- @width@, @height@ and @depth@.
    ImageResolve2KHR -> Extent3D
extent :: Extent3D
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImageResolve2KHR)
#endif
deriving instance Show ImageResolve2KHR

instance ToCStruct ImageResolve2KHR where
  withCStruct :: ImageResolve2KHR -> (Ptr ImageResolve2KHR -> IO b) -> IO b
withCStruct x :: ImageResolve2KHR
x f :: Ptr ImageResolve2KHR -> IO b
f = Int -> Int -> (Ptr ImageResolve2KHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 88 8 ((Ptr ImageResolve2KHR -> IO b) -> IO b)
-> (Ptr ImageResolve2KHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr ImageResolve2KHR
p -> Ptr ImageResolve2KHR -> ImageResolve2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageResolve2KHR
p ImageResolve2KHR
x (Ptr ImageResolve2KHR -> IO b
f Ptr ImageResolve2KHR
p)
  pokeCStruct :: Ptr ImageResolve2KHR -> ImageResolve2KHR -> IO b -> IO b
pokeCStruct p :: Ptr ImageResolve2KHR
p ImageResolve2KHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_RESOLVE_2_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ImageSubresourceLayers -> ImageSubresourceLayers -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
srcSubresource)
    Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Offset3D)) (Offset3D
srcOffset)
    Ptr ImageSubresourceLayers -> ImageSubresourceLayers -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
dstSubresource)
    Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Offset3D)) (Offset3D
dstOffset)
    Ptr Extent3D -> Extent3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr Extent3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr Extent3D)) (Extent3D
extent)
    IO b
f
  cStructSize :: Int
cStructSize = 88
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr ImageResolve2KHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr ImageResolve2KHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_RESOLVE_2_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ImageSubresourceLayers -> ImageSubresourceLayers -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
forall a. Zero a => a
zero)
    Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Offset3D)) (Offset3D
forall a. Zero a => a
zero)
    Ptr ImageSubresourceLayers -> ImageSubresourceLayers -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
forall a. Zero a => a
zero)
    Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Offset3D)) (Offset3D
forall a. Zero a => a
zero)
    Ptr Extent3D -> Extent3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr Extent3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr Extent3D)) (Extent3D
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct ImageResolve2KHR where
  peekCStruct :: Ptr ImageResolve2KHR -> IO ImageResolve2KHR
peekCStruct p :: Ptr ImageResolve2KHR
p = do
    ImageSubresourceLayers
srcSubresource <- Ptr ImageSubresourceLayers -> IO ImageSubresourceLayers
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresourceLayers ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageSubresourceLayers))
    Offset3D
srcOffset <- Ptr Offset3D -> IO Offset3D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Offset3D))
    ImageSubresourceLayers
dstSubresource <- Ptr ImageSubresourceLayers -> IO ImageSubresourceLayers
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresourceLayers ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr ImageSubresourceLayers))
    Offset3D
dstOffset <- Ptr Offset3D -> IO Offset3D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Offset3D))
    Extent3D
extent <- Ptr Extent3D -> IO Extent3D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent3D ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr Extent3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr Extent3D))
    ImageResolve2KHR -> IO ImageResolve2KHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ImageResolve2KHR -> IO ImageResolve2KHR)
-> ImageResolve2KHR -> IO ImageResolve2KHR
forall a b. (a -> b) -> a -> b
$ ImageSubresourceLayers
-> Offset3D
-> ImageSubresourceLayers
-> Offset3D
-> Extent3D
-> ImageResolve2KHR
ImageResolve2KHR
             ImageSubresourceLayers
srcSubresource Offset3D
srcOffset ImageSubresourceLayers
dstSubresource Offset3D
dstOffset Extent3D
extent

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

instance Zero ImageResolve2KHR where
  zero :: ImageResolve2KHR
zero = ImageSubresourceLayers
-> Offset3D
-> ImageSubresourceLayers
-> Offset3D
-> Extent3D
-> ImageResolve2KHR
ImageResolve2KHR
           ImageSubresourceLayers
forall a. Zero a => a
zero
           Offset3D
forall a. Zero a => a
zero
           ImageSubresourceLayers
forall a. Zero a => a
zero
           Offset3D
forall a. Zero a => a
zero
           Extent3D
forall a. Zero a => a
zero


-- | VkCopyBufferInfo2KHR - Structure specifying parameters of a buffer copy
-- command
--
-- = Description
--
-- Members defined by this structure with the same name as parameters in
-- 'Vulkan.Core10.CommandBufferBuilding.cmdCopyBuffer' have the identical
-- effect to those parameters; the child structure 'BufferCopy2KHR' is a
-- variant of 'Vulkan.Core10.CommandBufferBuilding.BufferCopy' which
-- includes @sType@ and @pNext@ parameters, allowing it to be extended.
--
-- == Valid Usage
--
-- -   #VUID-VkCopyBufferInfo2KHR-srcOffset-00113# The @srcOffset@ member
--     of each element of @pRegions@ /must/ be less than the size of
--     @srcBuffer@
--
-- -   #VUID-VkCopyBufferInfo2KHR-dstOffset-00114# The @dstOffset@ member
--     of each element of @pRegions@ /must/ be less than the size of
--     @dstBuffer@
--
-- -   #VUID-VkCopyBufferInfo2KHR-size-00115# The @size@ member of each
--     element of @pRegions@ /must/ be less than or equal to the size of
--     @srcBuffer@ minus @srcOffset@
--
-- -   #VUID-VkCopyBufferInfo2KHR-size-00116# The @size@ member of each
--     element of @pRegions@ /must/ be less than or equal to the size of
--     @dstBuffer@ minus @dstOffset@
--
-- -   #VUID-VkCopyBufferInfo2KHR-pRegions-00117# The union of the source
--     regions, and the union of the destination regions, specified by the
--     elements of @pRegions@, /must/ not overlap in memory
--
-- -   #VUID-VkCopyBufferInfo2KHR-srcBuffer-00118# @srcBuffer@ /must/ have
--     been created with
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_TRANSFER_SRC_BIT'
--     usage flag
--
-- -   #VUID-VkCopyBufferInfo2KHR-srcBuffer-00119# If @srcBuffer@ is
--     non-sparse then it /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-VkCopyBufferInfo2KHR-dstBuffer-00120# @dstBuffer@ /must/ have
--     been created with
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_TRANSFER_DST_BIT'
--     usage flag
--
-- -   #VUID-VkCopyBufferInfo2KHR-dstBuffer-00121# If @dstBuffer@ is
--     non-sparse then it /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkCopyBufferInfo2KHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_BUFFER_INFO_2_KHR'
--
-- -   #VUID-VkCopyBufferInfo2KHR-pNext-pNext# @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkCopyBufferInfo2KHR-srcBuffer-parameter# @srcBuffer@ /must/
--     be a valid 'Vulkan.Core10.Handles.Buffer' handle
--
-- -   #VUID-VkCopyBufferInfo2KHR-dstBuffer-parameter# @dstBuffer@ /must/
--     be a valid 'Vulkan.Core10.Handles.Buffer' handle
--
-- -   #VUID-VkCopyBufferInfo2KHR-pRegions-parameter# @pRegions@ /must/ be
--     a valid pointer to an array of @regionCount@ valid 'BufferCopy2KHR'
--     structures
--
-- -   #VUID-VkCopyBufferInfo2KHR-regionCount-arraylength# @regionCount@
--     /must/ be greater than @0@
--
-- -   #VUID-VkCopyBufferInfo2KHR-commonparent# Both of @dstBuffer@, and
--     @srcBuffer@ /must/ have been created, allocated, or retrieved from
--     the same 'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.Buffer', 'BufferCopy2KHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType', 'cmdCopyBuffer2KHR'
data CopyBufferInfo2KHR = CopyBufferInfo2KHR
  { -- | @srcBuffer@ is the source buffer.
    CopyBufferInfo2KHR -> Buffer
srcBuffer :: Buffer
  , -- | @dstBuffer@ is the destination buffer.
    CopyBufferInfo2KHR -> Buffer
dstBuffer :: Buffer
  , -- | @pRegions@ is a pointer to an array of 'BufferCopy2KHR' structures
    -- specifying the regions to copy.
    CopyBufferInfo2KHR -> Vector BufferCopy2KHR
regions :: Vector BufferCopy2KHR
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CopyBufferInfo2KHR)
#endif
deriving instance Show CopyBufferInfo2KHR

instance ToCStruct CopyBufferInfo2KHR where
  withCStruct :: CopyBufferInfo2KHR
-> (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO b) -> IO b
withCStruct x :: CopyBufferInfo2KHR
x f :: ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO b
f = Int
-> Int
-> (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 48 8 ((("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO b) -> IO b)
-> (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p -> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR)
-> CopyBufferInfo2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p CopyBufferInfo2KHR
x (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO b
f "pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p)
  pokeCStruct :: ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR)
-> CopyBufferInfo2KHR -> IO b -> IO b
pokeCStruct p :: "pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p CopyBufferInfo2KHR{..} f :: 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 (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 (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_BUFFER_INFO_2_KHR)
    IO () -> ContT b IO ()
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 (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
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 Buffer -> Buffer -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Buffer)) (Buffer
srcBuffer)
    IO () -> ContT b IO ()
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 Buffer -> Buffer -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Buffer)) (Buffer
dstBuffer)
    IO () -> ContT b IO ()
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 (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector BufferCopy2KHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector BufferCopy2KHR -> Int) -> Vector BufferCopy2KHR -> Int
forall a b. (a -> b) -> a -> b
$ (Vector BufferCopy2KHR
regions)) :: Word32))
    Ptr BufferCopy2KHR
pPRegions' <- ((Ptr BufferCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr BufferCopy2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr BufferCopy2KHR -> IO b) -> IO b)
 -> ContT b IO (Ptr BufferCopy2KHR))
-> ((Ptr BufferCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr BufferCopy2KHR)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr BufferCopy2KHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @BufferCopy2KHR ((Vector BufferCopy2KHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector BufferCopy2KHR
regions)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 40) 8
    IO () -> ContT b IO ()
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 -> BufferCopy2KHR -> IO ()) -> Vector BufferCopy2KHR -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: BufferCopy2KHR
e -> Ptr BufferCopy2KHR -> BufferCopy2KHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr BufferCopy2KHR
pPRegions' Ptr BufferCopy2KHR -> Int -> Ptr BufferCopy2KHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (40 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr BufferCopy2KHR) (BufferCopy2KHR
e)) (Vector BufferCopy2KHR
regions)
    IO () -> ContT b IO ()
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 BufferCopy2KHR) -> Ptr BufferCopy2KHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR)
-> Int -> Ptr (Ptr BufferCopy2KHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr BufferCopy2KHR))) (Ptr BufferCopy2KHR
pPRegions')
    IO b -> ContT b IO b
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 = 48
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> IO b -> IO b
pokeZeroCStruct p :: "pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p f :: 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 (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 (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_BUFFER_INFO_2_KHR)
    IO () -> ContT b IO ()
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 (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
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 Buffer -> Buffer -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Buffer)) (Buffer
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 Buffer -> Buffer -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Buffer)) (Buffer
forall a. Zero a => a
zero)
    Ptr BufferCopy2KHR
pPRegions' <- ((Ptr BufferCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr BufferCopy2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr BufferCopy2KHR -> IO b) -> IO b)
 -> ContT b IO (Ptr BufferCopy2KHR))
-> ((Ptr BufferCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr BufferCopy2KHR)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr BufferCopy2KHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @BufferCopy2KHR ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 40) 8
    IO () -> ContT b IO ()
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 -> BufferCopy2KHR -> IO ()) -> Vector BufferCopy2KHR -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: BufferCopy2KHR
e -> Ptr BufferCopy2KHR -> BufferCopy2KHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr BufferCopy2KHR
pPRegions' Ptr BufferCopy2KHR -> Int -> Ptr BufferCopy2KHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (40 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr BufferCopy2KHR) (BufferCopy2KHR
e)) (Vector BufferCopy2KHR
forall a. Monoid a => a
mempty)
    IO () -> ContT b IO ()
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 BufferCopy2KHR) -> Ptr BufferCopy2KHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR)
-> Int -> Ptr (Ptr BufferCopy2KHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr BufferCopy2KHR))) (Ptr BufferCopy2KHR
pPRegions')
    IO b -> ContT b IO b
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 FromCStruct CopyBufferInfo2KHR where
  peekCStruct :: ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR)
-> IO CopyBufferInfo2KHR
peekCStruct p :: "pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p = do
    Buffer
srcBuffer <- Ptr Buffer -> IO Buffer
forall a. Storable a => Ptr a -> IO a
peek @Buffer (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Buffer))
    Buffer
dstBuffer <- Ptr Buffer -> IO Buffer
forall a. Storable a => Ptr a -> IO a
peek @Buffer (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Buffer))
    Word32
regionCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word32))
    Ptr BufferCopy2KHR
pRegions <- Ptr (Ptr BufferCopy2KHR) -> IO (Ptr BufferCopy2KHR)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr BufferCopy2KHR) (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR
p ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2KHR)
-> Int -> Ptr (Ptr BufferCopy2KHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr BufferCopy2KHR)))
    Vector BufferCopy2KHR
pRegions' <- Int -> (Int -> IO BufferCopy2KHR) -> IO (Vector BufferCopy2KHR)
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
regionCount) (\i :: Int
i -> Ptr BufferCopy2KHR -> IO BufferCopy2KHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @BufferCopy2KHR ((Ptr BufferCopy2KHR
pRegions Ptr BufferCopy2KHR -> Int -> Ptr BufferCopy2KHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (40 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr BufferCopy2KHR)))
    CopyBufferInfo2KHR -> IO CopyBufferInfo2KHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CopyBufferInfo2KHR -> IO CopyBufferInfo2KHR)
-> CopyBufferInfo2KHR -> IO CopyBufferInfo2KHR
forall a b. (a -> b) -> a -> b
$ Buffer -> Buffer -> Vector BufferCopy2KHR -> CopyBufferInfo2KHR
CopyBufferInfo2KHR
             Buffer
srcBuffer Buffer
dstBuffer Vector BufferCopy2KHR
pRegions'

instance Zero CopyBufferInfo2KHR where
  zero :: CopyBufferInfo2KHR
zero = Buffer -> Buffer -> Vector BufferCopy2KHR -> CopyBufferInfo2KHR
CopyBufferInfo2KHR
           Buffer
forall a. Zero a => a
zero
           Buffer
forall a. Zero a => a
zero
           Vector BufferCopy2KHR
forall a. Monoid a => a
mempty


-- | VkCopyImageInfo2KHR - Structure specifying parameters of an image copy
-- command
--
-- == Valid Usage
--
-- -   #VUID-VkCopyImageInfo2KHR-pRegions-00124# The union of all source
--     regions, and the union of all destination regions, specified by the
--     elements of @pRegions@, /must/ not overlap in memory
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-01995# The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-format-features format features>
--     of @srcImage@ /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_TRANSFER_SRC_BIT'
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-00126# @srcImage@ /must/ have
--     been created with
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_TRANSFER_SRC_BIT'
--     usage flag
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-01546# If @srcImage@ is
--     non-sparse then the image or /disjoint/ plane to be copied /must/ be
--     bound completely and contiguously to a single
--     'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImageLayout-00128# @srcImageLayout@
--     /must/ specify the layout of the image subresources of @srcImage@
--     specified in @pRegions@ at the time this command is executed on a
--     'Vulkan.Core10.Handles.Device'
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImageLayout-01917# @srcImageLayout@
--     /must/ be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_GENERAL', or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHARED_PRESENT_KHR'
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImage-01996# The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-format-features format features>
--     of @dstImage@ /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_TRANSFER_DST_BIT'
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImage-00131# @dstImage@ /must/ have
--     been created with
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_TRANSFER_DST_BIT'
--     usage flag
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImage-01547# If @dstImage@ is
--     non-sparse then the image or /disjoint/ plane that is the
--     destination of the copy /must/ be bound completely and contiguously
--     to a single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImageLayout-00133# @dstImageLayout@
--     /must/ specify the layout of the image subresources of @dstImage@
--     specified in @pRegions@ at the time this command is executed on a
--     'Vulkan.Core10.Handles.Device'
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImageLayout-01395# @dstImageLayout@
--     /must/ be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_GENERAL', or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHARED_PRESENT_KHR'
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-01548# If the
--     'Vulkan.Core10.Enums.Format.Format' of each of @srcImage@ and
--     @dstImage@ is not a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>,
--     the 'Vulkan.Core10.Enums.Format.Format' of each of @srcImage@ and
--     @dstImage@ /must/ be compatible, as defined
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#copies-images-format-compatibility above>
--
-- -   #VUID-VkCopyImageInfo2KHR-None-01549# In a copy to or from a plane
--     of a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar image>,
--     the 'Vulkan.Core10.Enums.Format.Format' of the image and plane
--     /must/ be compatible according to
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-compatible-planes the description of compatible planes>
--     for the plane being copied
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-00136# The sample count of
--     @srcImage@ and @dstImage@ /must/ match
--
-- -   #VUID-VkCopyImageInfo2KHR-srcSubresource-01696# The
--     @srcSubresource.mipLevel@ member of each element of @pRegions@
--     /must/ be less than the @mipLevels@ specified in
--     'Vulkan.Core10.Image.ImageCreateInfo' when @srcImage@ was created
--
-- -   #VUID-VkCopyImageInfo2KHR-dstSubresource-01697# The
--     @dstSubresource.mipLevel@ member of each element of @pRegions@
--     /must/ be less than the @mipLevels@ specified in
--     'Vulkan.Core10.Image.ImageCreateInfo' when @dstImage@ was created
--
-- -   #VUID-VkCopyImageInfo2KHR-srcSubresource-01698# The
--     @srcSubresource.baseArrayLayer@ + @srcSubresource.layerCount@ of
--     each element of @pRegions@ /must/ be less than or equal to the
--     @arrayLayers@ specified in 'Vulkan.Core10.Image.ImageCreateInfo'
--     when @srcImage@ was created
--
-- -   #VUID-VkCopyImageInfo2KHR-dstSubresource-01699# The
--     @dstSubresource.baseArrayLayer@ + @dstSubresource.layerCount@ of
--     each element of @pRegions@ /must/ be less than or equal to the
--     @arrayLayers@ specified in 'Vulkan.Core10.Image.ImageCreateInfo'
--     when @dstImage@ was created
--
-- -   #VUID-VkCopyImageInfo2KHR-srcOffset-01783# The @srcOffset@ and
--     @extent@ members of each element of @pRegions@ /must/ respect the
--     image transfer granularity requirements of @commandBuffer@’s command
--     pool’s queue family, as described in
--     'Vulkan.Core10.DeviceInitialization.QueueFamilyProperties'
--
-- -   #VUID-VkCopyImageInfo2KHR-dstOffset-01784# The @dstOffset@ and
--     @extent@ members of each element of @pRegions@ /must/ respect the
--     image transfer granularity requirements of @commandBuffer@’s command
--     pool’s queue family, as described in
--     'Vulkan.Core10.DeviceInitialization.QueueFamilyProperties'
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImage-02542# @dstImage@ and @srcImage@
--     /must/ not have been created with @flags@ containing
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_SUBSAMPLED_BIT_EXT'
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-01551# If neither @srcImage@ nor
--     @dstImage@ has a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar image format>
--     then for each element of @pRegions@, @srcSubresource.aspectMask@ and
--     @dstSubresource.aspectMask@ /must/ match
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-01552# If @srcImage@ has a
--     'Vulkan.Core10.Enums.Format.Format' with
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion two planes>
--     then for each element of @pRegions@, @srcSubresource.aspectMask@
--     /must/ be
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_0_BIT'
--     or
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_1_BIT'
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-01553# If @srcImage@ has a
--     'Vulkan.Core10.Enums.Format.Format' with
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion three planes>
--     then for each element of @pRegions@, @srcSubresource.aspectMask@
--     /must/ be
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_0_BIT',
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_1_BIT',
--     or
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_2_BIT'
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImage-01554# If @dstImage@ has a
--     'Vulkan.Core10.Enums.Format.Format' with
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion two planes>
--     then for each element of @pRegions@, @dstSubresource.aspectMask@
--     /must/ be
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_0_BIT'
--     or
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_1_BIT'
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImage-01555# If @dstImage@ has a
--     'Vulkan.Core10.Enums.Format.Format' with
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion three planes>
--     then for each element of @pRegions@, @dstSubresource.aspectMask@
--     /must/ be
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_0_BIT',
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_1_BIT',
--     or
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_2_BIT'
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-01556# If @srcImage@ has a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar image format>
--     and the @dstImage@ does not have a multi-planar image format, then
--     for each element of @pRegions@, @dstSubresource.aspectMask@ /must/
--     be 'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_COLOR_BIT'
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImage-01557# If @dstImage@ has a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar image format>
--     and the @srcImage@ does not have a multi-planar image format, then
--     for each element of @pRegions@, @srcSubresource.aspectMask@ /must/
--     be 'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_COLOR_BIT'
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-04443# If @srcImage@ is of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_3D', then for each element
--     of @pRegions@, @srcSubresource.baseArrayLayer@ /must/ be @0@ and and
--     @srcSubresource.layerCount@ /must/ be @1@
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImage-04444# If @dstImage@ is of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_3D', then for each element
--     of @pRegions@, @dstSubresource.baseArrayLayer@ /must/ be @0@ and and
--     @dstSubresource.layerCount@ /must/ be @1@
--
-- -   #VUID-VkCopyImageInfo2KHR-aspectMask-00142# For each element of
--     @pRegions@, @srcSubresource.aspectMask@ /must/ specify aspects
--     present in @srcImage@
--
-- -   #VUID-VkCopyImageInfo2KHR-aspectMask-00143# For each element of
--     @pRegions@, @dstSubresource.aspectMask@ /must/ specify aspects
--     present in @dstImage@
--
-- -   #VUID-VkCopyImageInfo2KHR-srcOffset-00144# For each element of
--     @pRegions@, @srcOffset.x@ and (@extent.width@ + @srcOffset.x@)
--     /must/ both be greater than or equal to @0@ and less than or equal
--     to the width of the specified @srcSubresource@ of @srcImage@
--
-- -   #VUID-VkCopyImageInfo2KHR-srcOffset-00145# For each element of
--     @pRegions@, @srcOffset.y@ and (@extent.height@ + @srcOffset.y@)
--     /must/ both be greater than or equal to @0@ and less than or equal
--     to the height of the specified @srcSubresource@ of @srcImage@
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-00146# If @srcImage@ is of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D', then for each element
--     of @pRegions@, @srcOffset.y@ /must/ be @0@ and @extent.height@
--     /must/ be @1@
--
-- -   #VUID-VkCopyImageInfo2KHR-srcOffset-00147# For each element of
--     @pRegions@, @srcOffset.z@ and (@extent.depth@ + @srcOffset.z@)
--     /must/ both be greater than or equal to @0@ and less than or equal
--     to the depth of the specified @srcSubresource@ of @srcImage@
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-01785# If @srcImage@ is of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D', then for each element
--     of @pRegions@, @srcOffset.z@ /must/ be @0@ and @extent.depth@ /must/
--     be @1@
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImage-01786# If @dstImage@ is of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D', then for each element
--     of @pRegions@, @dstOffset.z@ /must/ be @0@ and @extent.depth@ /must/
--     be @1@
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-01787# If @srcImage@ is of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_2D', then for each element
--     of @pRegions@, @srcOffset.z@ /must/ be @0@
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImage-01788# If @dstImage@ is of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_2D', then for each element
--     of @pRegions@, @dstOffset.z@ /must/ be @0@
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-01790# If @srcImage@ and
--     @dstImage@ are both of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_2D', then for each element
--     of @pRegions@, @extent.depth@ /must/ be @1@
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-01791# If @srcImage@ is of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_2D', and @dstImage@ is of
--     type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_3D', then for each
--     element of @pRegions@, @extent.depth@ /must/ equal
--     @srcSubresource.layerCount@
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImage-01792# If @dstImage@ is of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_2D', and @srcImage@ is of
--     type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_3D', then for each
--     element of @pRegions@, @extent.depth@ /must/ equal
--     @dstSubresource.layerCount@
--
-- -   #VUID-VkCopyImageInfo2KHR-dstOffset-00150# For each element of
--     @pRegions@, @dstOffset.x@ and (@extent.width@ + @dstOffset.x@)
--     /must/ both be greater than or equal to @0@ and less than or equal
--     to the width of the specified @dstSubresource@ of @dstImage@
--
-- -   #VUID-VkCopyImageInfo2KHR-dstOffset-00151# For each element of
--     @pRegions@, @dstOffset.y@ and (@extent.height@ + @dstOffset.y@)
--     /must/ both be greater than or equal to @0@ and less than or equal
--     to the height of the specified @dstSubresource@ of @dstImage@
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImage-00152# If @dstImage@ is of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D', then for each element
--     of @pRegions@, @dstOffset.y@ /must/ be @0@ and @extent.height@
--     /must/ be @1@
--
-- -   #VUID-VkCopyImageInfo2KHR-dstOffset-00153# For each element of
--     @pRegions@, @dstOffset.z@ and (@extent.depth@ + @dstOffset.z@)
--     /must/ both be greater than or equal to @0@ and less than or equal
--     to the depth of the specified @dstSubresource@ of @dstImage@
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-01727# If @srcImage@ is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     then for each element of @pRegions@, all members of @srcOffset@
--     /must/ be a multiple of the corresponding dimensions of the
--     compressed texel block
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-01728# If @srcImage@ is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     then for each element of @pRegions@, @extent.width@ /must/ be a
--     multiple of the compressed texel block width or (@extent.width@ +
--     @srcOffset.x@) /must/ equal the width of the specified
--     @srcSubresource@ of @srcImage@
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-01729# If @srcImage@ is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     then for each element of @pRegions@, @extent.height@ /must/ be a
--     multiple of the compressed texel block height or (@extent.height@ +
--     @srcOffset.y@) /must/ equal the height of the specified
--     @srcSubresource@ of @srcImage@
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-01730# If @srcImage@ is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     then for each element of @pRegions@, @extent.depth@ /must/ be a
--     multiple of the compressed texel block depth or (@extent.depth@ +
--     @srcOffset.z@) /must/ equal the depth of the specified
--     @srcSubresource@ of @srcImage@
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImage-01731# If @dstImage@ is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     then for each element of @pRegions@, all members of @dstOffset@
--     /must/ be a multiple of the corresponding dimensions of the
--     compressed texel block
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImage-01732# If @dstImage@ is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     then for each element of @pRegions@, @extent.width@ /must/ be a
--     multiple of the compressed texel block width or (@extent.width@ +
--     @dstOffset.x@) /must/ equal the width of the specified
--     @dstSubresource@ of @dstImage@
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImage-01733# If @dstImage@ is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     then for each element of @pRegions@, @extent.height@ /must/ be a
--     multiple of the compressed texel block height or (@extent.height@ +
--     @dstOffset.y@) /must/ equal the height of the specified
--     @dstSubresource@ of @dstImage@
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImage-01734# If @dstImage@ is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     then for each element of @pRegions@, @extent.depth@ /must/ be a
--     multiple of the compressed texel block depth or (@extent.depth@ +
--     @dstOffset.z@) /must/ equal the depth of the specified
--     @dstSubresource@ of @dstImage@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkCopyImageInfo2KHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_IMAGE_INFO_2_KHR'
--
-- -   #VUID-VkCopyImageInfo2KHR-pNext-pNext# @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImage-parameter# @srcImage@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Image' handle
--
-- -   #VUID-VkCopyImageInfo2KHR-srcImageLayout-parameter# @srcImageLayout@
--     /must/ be a valid 'Vulkan.Core10.Enums.ImageLayout.ImageLayout'
--     value
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImage-parameter# @dstImage@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Image' handle
--
-- -   #VUID-VkCopyImageInfo2KHR-dstImageLayout-parameter# @dstImageLayout@
--     /must/ be a valid 'Vulkan.Core10.Enums.ImageLayout.ImageLayout'
--     value
--
-- -   #VUID-VkCopyImageInfo2KHR-pRegions-parameter# @pRegions@ /must/ be a
--     valid pointer to an array of @regionCount@ valid 'ImageCopy2KHR'
--     structures
--
-- -   #VUID-VkCopyImageInfo2KHR-regionCount-arraylength# @regionCount@
--     /must/ be greater than @0@
--
-- -   #VUID-VkCopyImageInfo2KHR-commonparent# Both of @dstImage@, and
--     @srcImage@ /must/ have been created, allocated, or retrieved from
--     the same 'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.Image', 'ImageCopy2KHR',
-- 'Vulkan.Core10.Enums.ImageLayout.ImageLayout',
-- 'Vulkan.Core10.Enums.StructureType.StructureType', 'cmdCopyImage2KHR'
data CopyImageInfo2KHR = CopyImageInfo2KHR
  { -- | @srcImage@ is the source image.
    CopyImageInfo2KHR -> Image
srcImage :: Image
  , -- | @srcImageLayout@ is the current layout of the source image subresource.
    CopyImageInfo2KHR -> ImageLayout
srcImageLayout :: ImageLayout
  , -- | @dstImage@ is the destination image.
    CopyImageInfo2KHR -> Image
dstImage :: Image
  , -- | @dstImageLayout@ is the current layout of the destination image
    -- subresource.
    CopyImageInfo2KHR -> ImageLayout
dstImageLayout :: ImageLayout
  , -- | @pRegions@ is a pointer to an array of 'ImageCopy2KHR' structures
    -- specifying the regions to copy.
    CopyImageInfo2KHR -> Vector ImageCopy2KHR
regions :: Vector ImageCopy2KHR
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CopyImageInfo2KHR)
#endif
deriving instance Show CopyImageInfo2KHR

instance ToCStruct CopyImageInfo2KHR where
  withCStruct :: CopyImageInfo2KHR
-> (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO b) -> IO b
withCStruct x :: CopyImageInfo2KHR
x f :: ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO b
f = Int
-> Int
-> (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 56 8 ((("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO b) -> IO b)
-> (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p -> ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR)
-> CopyImageInfo2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p CopyImageInfo2KHR
x (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO b
f "pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p)
  pokeCStruct :: ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR)
-> CopyImageInfo2KHR -> IO b -> IO b
pokeCStruct p :: "pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p CopyImageInfo2KHR{..} f :: 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 (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 (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_IMAGE_INFO_2_KHR)
    IO () -> ContT b IO ()
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 (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Image)) (Image
srcImage)
    IO () -> ContT b IO ()
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 ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ImageLayout)) (ImageLayout
srcImageLayout)
    IO () -> ContT b IO ()
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Image)) (Image
dstImage)
    IO () -> ContT b IO ()
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 ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr ImageLayout)) (ImageLayout
dstImageLayout)
    IO () -> ContT b IO ()
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 (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector ImageCopy2KHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ImageCopy2KHR -> Int) -> Vector ImageCopy2KHR -> Int
forall a b. (a -> b) -> a -> b
$ (Vector ImageCopy2KHR
regions)) :: Word32))
    Ptr ImageCopy2KHR
pPRegions' <- ((Ptr ImageCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr ImageCopy2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ImageCopy2KHR -> IO b) -> IO b)
 -> ContT b IO (Ptr ImageCopy2KHR))
-> ((Ptr ImageCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr ImageCopy2KHR)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ImageCopy2KHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @ImageCopy2KHR ((Vector ImageCopy2KHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ImageCopy2KHR
regions)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 88) 8
    IO () -> ContT b IO ()
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 -> ImageCopy2KHR -> IO ()) -> Vector ImageCopy2KHR -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: ImageCopy2KHR
e -> Ptr ImageCopy2KHR -> ImageCopy2KHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ImageCopy2KHR
pPRegions' Ptr ImageCopy2KHR -> Int -> Ptr ImageCopy2KHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (88 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ImageCopy2KHR) (ImageCopy2KHR
e)) (Vector ImageCopy2KHR
regions)
    IO () -> ContT b IO ()
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 ImageCopy2KHR) -> Ptr ImageCopy2KHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR)
-> Int -> Ptr (Ptr ImageCopy2KHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (Ptr ImageCopy2KHR))) (Ptr ImageCopy2KHR
pPRegions')
    IO b -> ContT b IO b
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 = 56
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> IO b -> IO b
pokeZeroCStruct p :: "pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p f :: 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 (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 (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_IMAGE_INFO_2_KHR)
    IO () -> ContT b IO ()
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 (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Image)) (Image
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ImageLayout)) (ImageLayout
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Image)) (Image
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr ImageLayout)) (ImageLayout
forall a. Zero a => a
zero)
    Ptr ImageCopy2KHR
pPRegions' <- ((Ptr ImageCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr ImageCopy2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ImageCopy2KHR -> IO b) -> IO b)
 -> ContT b IO (Ptr ImageCopy2KHR))
-> ((Ptr ImageCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr ImageCopy2KHR)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ImageCopy2KHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @ImageCopy2KHR ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 88) 8
    IO () -> ContT b IO ()
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 -> ImageCopy2KHR -> IO ()) -> Vector ImageCopy2KHR -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: ImageCopy2KHR
e -> Ptr ImageCopy2KHR -> ImageCopy2KHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ImageCopy2KHR
pPRegions' Ptr ImageCopy2KHR -> Int -> Ptr ImageCopy2KHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (88 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ImageCopy2KHR) (ImageCopy2KHR
e)) (Vector ImageCopy2KHR
forall a. Monoid a => a
mempty)
    IO () -> ContT b IO ()
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 ImageCopy2KHR) -> Ptr ImageCopy2KHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR)
-> Int -> Ptr (Ptr ImageCopy2KHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (Ptr ImageCopy2KHR))) (Ptr ImageCopy2KHR
pPRegions')
    IO b -> ContT b IO b
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 FromCStruct CopyImageInfo2KHR where
  peekCStruct :: ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR)
-> IO CopyImageInfo2KHR
peekCStruct p :: "pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p = do
    Image
srcImage <- Ptr Image -> IO Image
forall a. Storable a => Ptr a -> IO a
peek @Image (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Image))
    ImageLayout
srcImageLayout <- Ptr ImageLayout -> IO ImageLayout
forall a. Storable a => Ptr a -> IO a
peek @ImageLayout (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ImageLayout))
    Image
dstImage <- Ptr Image -> IO Image
forall a. Storable a => Ptr a -> IO a
peek @Image (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Image))
    ImageLayout
dstImageLayout <- Ptr ImageLayout -> IO ImageLayout
forall a. Storable a => Ptr a -> IO a
peek @ImageLayout (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr ImageLayout))
    Word32
regionCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32))
    Ptr ImageCopy2KHR
pRegions <- Ptr (Ptr ImageCopy2KHR) -> IO (Ptr ImageCopy2KHR)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ImageCopy2KHR) (("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR
p ("pCopyImageInfo" ::: Ptr CopyImageInfo2KHR)
-> Int -> Ptr (Ptr ImageCopy2KHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (Ptr ImageCopy2KHR)))
    Vector ImageCopy2KHR
pRegions' <- Int -> (Int -> IO ImageCopy2KHR) -> IO (Vector ImageCopy2KHR)
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
regionCount) (\i :: Int
i -> Ptr ImageCopy2KHR -> IO ImageCopy2KHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageCopy2KHR ((Ptr ImageCopy2KHR
pRegions Ptr ImageCopy2KHR -> Int -> Ptr ImageCopy2KHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (88 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ImageCopy2KHR)))
    CopyImageInfo2KHR -> IO CopyImageInfo2KHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CopyImageInfo2KHR -> IO CopyImageInfo2KHR)
-> CopyImageInfo2KHR -> IO CopyImageInfo2KHR
forall a b. (a -> b) -> a -> b
$ Image
-> ImageLayout
-> Image
-> ImageLayout
-> Vector ImageCopy2KHR
-> CopyImageInfo2KHR
CopyImageInfo2KHR
             Image
srcImage ImageLayout
srcImageLayout Image
dstImage ImageLayout
dstImageLayout Vector ImageCopy2KHR
pRegions'

instance Zero CopyImageInfo2KHR where
  zero :: CopyImageInfo2KHR
zero = Image
-> ImageLayout
-> Image
-> ImageLayout
-> Vector ImageCopy2KHR
-> CopyImageInfo2KHR
CopyImageInfo2KHR
           Image
forall a. Zero a => a
zero
           ImageLayout
forall a. Zero a => a
zero
           Image
forall a. Zero a => a
zero
           ImageLayout
forall a. Zero a => a
zero
           Vector ImageCopy2KHR
forall a. Monoid a => a
mempty


-- | VkBlitImageInfo2KHR - Structure specifying parameters of blit image
-- command
--
-- == Valid Usage
--
-- -   #VUID-VkBlitImageInfo2KHR-pRegions-00215# The source region
--     specified by each element of @pRegions@ /must/ be a region that is
--     contained within @srcImage@
--
-- -   #VUID-VkBlitImageInfo2KHR-pRegions-00216# The destination region
--     specified by each element of @pRegions@ /must/ be a region that is
--     contained within @dstImage@
--
-- -   #VUID-VkBlitImageInfo2KHR-pRegions-00217# The union of all
--     destination regions, specified by the elements of @pRegions@, /must/
--     not overlap in memory with any texel that /may/ be sampled during
--     the blit operation
--
-- -   #VUID-VkBlitImageInfo2KHR-srcImage-01999# The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-format-features format features>
--     of @srcImage@ /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_BLIT_SRC_BIT'
--
-- -   #VUID-VkBlitImageInfo2KHR-srcImage-01561# @srcImage@ /must/ not use
--     a format listed in
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion ???>
--
-- -   #VUID-VkBlitImageInfo2KHR-srcImage-00219# @srcImage@ /must/ have
--     been created with
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_TRANSFER_SRC_BIT'
--     usage flag
--
-- -   #VUID-VkBlitImageInfo2KHR-srcImage-00220# If @srcImage@ is
--     non-sparse then it /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-VkBlitImageInfo2KHR-srcImageLayout-00221# @srcImageLayout@
--     /must/ specify the layout of the image subresources of @srcImage@
--     specified in @pRegions@ at the time this command is executed on a
--     'Vulkan.Core10.Handles.Device'
--
-- -   #VUID-VkBlitImageInfo2KHR-srcImageLayout-01398# @srcImageLayout@
--     /must/ be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHARED_PRESENT_KHR',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL'
--     or 'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_GENERAL'
--
-- -   #VUID-VkBlitImageInfo2KHR-dstImage-02000# The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-format-features format features>
--     of @dstImage@ /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_BLIT_DST_BIT'
--
-- -   #VUID-VkBlitImageInfo2KHR-dstImage-01562# @dstImage@ /must/ not use
--     a format listed in
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion ???>
--
-- -   #VUID-VkBlitImageInfo2KHR-dstImage-00224# @dstImage@ /must/ have
--     been created with
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_TRANSFER_DST_BIT'
--     usage flag
--
-- -   #VUID-VkBlitImageInfo2KHR-dstImage-00225# If @dstImage@ is
--     non-sparse then it /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-VkBlitImageInfo2KHR-dstImageLayout-00226# @dstImageLayout@
--     /must/ specify the layout of the image subresources of @dstImage@
--     specified in @pRegions@ at the time this command is executed on a
--     'Vulkan.Core10.Handles.Device'
--
-- -   #VUID-VkBlitImageInfo2KHR-dstImageLayout-01399# @dstImageLayout@
--     /must/ be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHARED_PRESENT_KHR',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL'
--     or 'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_GENERAL'
--
-- -   #VUID-VkBlitImageInfo2KHR-srcImage-00229# If either of @srcImage@ or
--     @dstImage@ was created with a signed integer
--     'Vulkan.Core10.Enums.Format.Format', the other /must/ also have been
--     created with a signed integer 'Vulkan.Core10.Enums.Format.Format'
--
-- -   #VUID-VkBlitImageInfo2KHR-srcImage-00230# If either of @srcImage@ or
--     @dstImage@ was created with an unsigned integer
--     'Vulkan.Core10.Enums.Format.Format', the other /must/ also have been
--     created with an unsigned integer 'Vulkan.Core10.Enums.Format.Format'
--
-- -   #VUID-VkBlitImageInfo2KHR-srcImage-00231# If either of @srcImage@ or
--     @dstImage@ was created with a depth\/stencil format, the other
--     /must/ have exactly the same format
--
-- -   #VUID-VkBlitImageInfo2KHR-srcImage-00232# If @srcImage@ was created
--     with a depth\/stencil format, @filter@ /must/ be
--     'Vulkan.Core10.Enums.Filter.FILTER_NEAREST'
--
-- -   #VUID-VkBlitImageInfo2KHR-srcImage-00233# @srcImage@ /must/ have
--     been created with a @samples@ value of
--     'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_1_BIT'
--
-- -   #VUID-VkBlitImageInfo2KHR-dstImage-00234# @dstImage@ /must/ have
--     been created with a @samples@ value of
--     'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_1_BIT'
--
-- -   #VUID-VkBlitImageInfo2KHR-filter-02001# If @filter@ is
--     'Vulkan.Core10.Enums.Filter.FILTER_LINEAR', then the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-format-features format features>
--     of @srcImage@ /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT'
--
-- -   #VUID-VkBlitImageInfo2KHR-filter-02002# If @filter@ is
--     'Vulkan.Extensions.VK_EXT_filter_cubic.FILTER_CUBIC_EXT', then the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-format-features format features>
--     of @srcImage@ /must/ contain
--     'Vulkan.Extensions.VK_EXT_filter_cubic.FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT'
--
-- -   #VUID-VkBlitImageInfo2KHR-filter-00237# If @filter@ is
--     'Vulkan.Extensions.VK_EXT_filter_cubic.FILTER_CUBIC_EXT', @srcImage@
--     /must/ be of type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_2D'
--
-- -   #VUID-VkBlitImageInfo2KHR-srcSubresource-01705# The
--     @srcSubresource.mipLevel@ member of each element of @pRegions@
--     /must/ be less than the @mipLevels@ specified in
--     'Vulkan.Core10.Image.ImageCreateInfo' when @srcImage@ was created
--
-- -   #VUID-VkBlitImageInfo2KHR-dstSubresource-01706# The
--     @dstSubresource.mipLevel@ member of each element of @pRegions@
--     /must/ be less than the @mipLevels@ specified in
--     'Vulkan.Core10.Image.ImageCreateInfo' when @dstImage@ was created
--
-- -   #VUID-VkBlitImageInfo2KHR-srcSubresource-01707# The
--     @srcSubresource.baseArrayLayer@ + @srcSubresource.layerCount@ of
--     each element of @pRegions@ /must/ be less than or equal to the
--     @arrayLayers@ specified in 'Vulkan.Core10.Image.ImageCreateInfo'
--     when @srcImage@ was created
--
-- -   #VUID-VkBlitImageInfo2KHR-dstSubresource-01708# The
--     @dstSubresource.baseArrayLayer@ + @dstSubresource.layerCount@ of
--     each element of @pRegions@ /must/ be less than or equal to the
--     @arrayLayers@ specified in 'Vulkan.Core10.Image.ImageCreateInfo'
--     when @dstImage@ was created
--
-- -   #VUID-VkBlitImageInfo2KHR-dstImage-02545# @dstImage@ and @srcImage@
--     /must/ not have been created with @flags@ containing
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_SUBSAMPLED_BIT_EXT'
--
-- -   #VUID-VkBlitImageInfo2KHR-srcImage-00240# If either @srcImage@ or
--     @dstImage@ is of type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_3D',
--     then for each element of @pRegions@, @srcSubresource.baseArrayLayer@
--     and @dstSubresource.baseArrayLayer@ /must/ each be @0@, and
--     @srcSubresource.layerCount@ and @dstSubresource.layerCount@ /must/
--     each be @1@.
--
-- -   #VUID-VkBlitImageInfo2KHR-aspectMask-00241# For each element of
--     @pRegions@, @srcSubresource.aspectMask@ /must/ specify aspects
--     present in @srcImage@
--
-- -   #VUID-VkBlitImageInfo2KHR-aspectMask-00242# For each element of
--     @pRegions@, @dstSubresource.aspectMask@ /must/ specify aspects
--     present in @dstImage@
--
-- -   #VUID-VkBlitImageInfo2KHR-srcOffset-00243# For each element of
--     @pRegions@, @srcOffset@[0].x and @srcOffset@[1].x /must/ both be
--     greater than or equal to @0@ and less than or equal to the width of
--     the specified @srcSubresource@ of @srcImage@
--
-- -   #VUID-VkBlitImageInfo2KHR-srcOffset-00244# For each element of
--     @pRegions@, @srcOffset@[0].y and @srcOffset@[1].y /must/ both be
--     greater than or equal to @0@ and less than or equal to the height of
--     the specified @srcSubresource@ of @srcImage@
--
-- -   #VUID-VkBlitImageInfo2KHR-srcImage-00245# If @srcImage@ is of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D', then for each element
--     of @pRegions@, @srcOffset@[0].y /must/ be @0@ and @srcOffset@[1].y
--     /must/ be @1@
--
-- -   #VUID-VkBlitImageInfo2KHR-srcOffset-00246# For each element of
--     @pRegions@, @srcOffset@[0].z and @srcOffset@[1].z /must/ both be
--     greater than or equal to @0@ and less than or equal to the depth of
--     the specified @srcSubresource@ of @srcImage@
--
-- -   #VUID-VkBlitImageInfo2KHR-srcImage-00247# If @srcImage@ is of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D' or
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_2D', then for each element
--     of @pRegions@, @srcOffset@[0].z /must/ be @0@ and @srcOffset@[1].z
--     /must/ be @1@
--
-- -   #VUID-VkBlitImageInfo2KHR-dstOffset-00248# For each element of
--     @pRegions@, @dstOffset@[0].x and @dstOffset@[1].x /must/ both be
--     greater than or equal to @0@ and less than or equal to the width of
--     the specified @dstSubresource@ of @dstImage@
--
-- -   #VUID-VkBlitImageInfo2KHR-dstOffset-00249# For each element of
--     @pRegions@, @dstOffset@[0].y and @dstOffset@[1].y /must/ both be
--     greater than or equal to @0@ and less than or equal to the height of
--     the specified @dstSubresource@ of @dstImage@
--
-- -   #VUID-VkBlitImageInfo2KHR-dstImage-00250# If @dstImage@ is of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D', then for each element
--     of @pRegions@, @dstOffset@[0].y /must/ be @0@ and @dstOffset@[1].y
--     /must/ be @1@
--
-- -   #VUID-VkBlitImageInfo2KHR-dstOffset-00251# For each element of
--     @pRegions@, @dstOffset@[0].z and @dstOffset@[1].z /must/ both be
--     greater than or equal to @0@ and less than or equal to the depth of
--     the specified @dstSubresource@ of @dstImage@
--
-- -   #VUID-VkBlitImageInfo2KHR-dstImage-00252# If @dstImage@ is of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D' or
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_2D', then for each element
--     of @pRegions@, @dstOffset@[0].z /must/ be @0@ and @dstOffset@[1].z
--     /must/ be @1@
--
-- -   #VUID-VkBlitImageInfo2KHR-pRegions-04561# If any element of
--     @pRegions@ contains
--     'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM'
--     in its @pNext@ chain, then @srcImage@ and @dstImage@ /must/ not be a
--     block-compressed image.
--
-- -   #VUID-VkBlitImageInfo2KHR-pRegions-04562# If any element of
--     @pRegions@ contains
--     'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM'
--     in its @pNext@ chain, then the @srcImage@ /must/ be of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_2D' and /must/ not be a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkBlitImageInfo2KHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BLIT_IMAGE_INFO_2_KHR'
--
-- -   #VUID-VkBlitImageInfo2KHR-pNext-pNext# @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkBlitImageInfo2KHR-srcImage-parameter# @srcImage@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Image' handle
--
-- -   #VUID-VkBlitImageInfo2KHR-srcImageLayout-parameter# @srcImageLayout@
--     /must/ be a valid 'Vulkan.Core10.Enums.ImageLayout.ImageLayout'
--     value
--
-- -   #VUID-VkBlitImageInfo2KHR-dstImage-parameter# @dstImage@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Image' handle
--
-- -   #VUID-VkBlitImageInfo2KHR-dstImageLayout-parameter# @dstImageLayout@
--     /must/ be a valid 'Vulkan.Core10.Enums.ImageLayout.ImageLayout'
--     value
--
-- -   #VUID-VkBlitImageInfo2KHR-pRegions-parameter# @pRegions@ /must/ be a
--     valid pointer to an array of @regionCount@ valid 'ImageBlit2KHR'
--     structures
--
-- -   #VUID-VkBlitImageInfo2KHR-filter-parameter# @filter@ /must/ be a
--     valid 'Vulkan.Core10.Enums.Filter.Filter' value
--
-- -   #VUID-VkBlitImageInfo2KHR-regionCount-arraylength# @regionCount@
--     /must/ be greater than @0@
--
-- -   #VUID-VkBlitImageInfo2KHR-commonparent# Both of @dstImage@, and
--     @srcImage@ /must/ have been created, allocated, or retrieved from
--     the same 'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- 'Vulkan.Core10.Enums.Filter.Filter', 'Vulkan.Core10.Handles.Image',
-- 'ImageBlit2KHR', 'Vulkan.Core10.Enums.ImageLayout.ImageLayout',
-- 'Vulkan.Core10.Enums.StructureType.StructureType', 'cmdBlitImage2KHR'
data BlitImageInfo2KHR = BlitImageInfo2KHR
  { -- | @srcImage@ is the source image.
    BlitImageInfo2KHR -> Image
srcImage :: Image
  , -- | @srcImageLayout@ is the layout of the source image subresources for the
    -- blit.
    BlitImageInfo2KHR -> ImageLayout
srcImageLayout :: ImageLayout
  , -- | @dstImage@ is the destination image.
    BlitImageInfo2KHR -> Image
dstImage :: Image
  , -- | @dstImageLayout@ is the layout of the destination image subresources for
    -- the blit.
    BlitImageInfo2KHR -> ImageLayout
dstImageLayout :: ImageLayout
  , -- | @pRegions@ is a pointer to an array of 'ImageBlit2KHR' structures
    -- specifying the regions to blit.
    BlitImageInfo2KHR -> Vector (SomeStruct ImageBlit2KHR)
regions :: Vector (SomeStruct ImageBlit2KHR)
  , -- | @filter@ is a 'Vulkan.Core10.Enums.Filter.Filter' specifying the filter
    -- to apply if the blits require scaling.
    BlitImageInfo2KHR -> Filter
filter' :: Filter
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BlitImageInfo2KHR)
#endif
deriving instance Show BlitImageInfo2KHR

instance ToCStruct BlitImageInfo2KHR where
  withCStruct :: BlitImageInfo2KHR
-> (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO b) -> IO b
withCStruct x :: BlitImageInfo2KHR
x f :: ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO b
f = Int
-> Int
-> (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 64 8 ((("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO b) -> IO b)
-> (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p -> ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR)
-> BlitImageInfo2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p BlitImageInfo2KHR
x (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO b
f "pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p)
  pokeCStruct :: ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR)
-> BlitImageInfo2KHR -> IO b -> IO b
pokeCStruct p :: "pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p BlitImageInfo2KHR{..} f :: 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 (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 (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BLIT_IMAGE_INFO_2_KHR)
    IO () -> ContT b IO ()
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 (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Image)) (Image
srcImage)
    IO () -> ContT b IO ()
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 ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ImageLayout)) (ImageLayout
srcImageLayout)
    IO () -> ContT b IO ()
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Image)) (Image
dstImage)
    IO () -> ContT b IO ()
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 ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr ImageLayout)) (ImageLayout
dstImageLayout)
    IO () -> ContT b IO ()
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 (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector (SomeStruct ImageBlit2KHR) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct ImageBlit2KHR) -> Int)
-> Vector (SomeStruct ImageBlit2KHR) -> Int
forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct ImageBlit2KHR)
regions)) :: Word32))
    Ptr (ImageBlit2KHR Any)
pPRegions' <- ((Ptr (ImageBlit2KHR Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (ImageBlit2KHR Any))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (ImageBlit2KHR Any) -> IO b) -> IO b)
 -> ContT b IO (Ptr (ImageBlit2KHR Any)))
-> ((Ptr (ImageBlit2KHR Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (ImageBlit2KHR Any))
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr (ImageBlit2KHR Any) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @(ImageBlit2KHR _) ((Vector (SomeStruct ImageBlit2KHR) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct ImageBlit2KHR)
regions)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 96) 8
    (Int -> SomeStruct ImageBlit2KHR -> ContT b IO ())
-> Vector (SomeStruct ImageBlit2KHR) -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: SomeStruct ImageBlit2KHR
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 ImageBlit2KHR)
-> SomeStruct ImageBlit2KHR -> 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 (ImageBlit2KHR Any) -> Ptr (SomeStruct ImageBlit2KHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (ImageBlit2KHR Any)
pPRegions' Ptr (ImageBlit2KHR Any) -> Int -> Ptr (ImageBlit2KHR _)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (96 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (ImageBlit2KHR _))) (SomeStruct ImageBlit2KHR
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 ImageBlit2KHR)
regions)
    IO () -> ContT b IO ()
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 (ImageBlit2KHR Any)) -> Ptr (ImageBlit2KHR Any) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR)
-> Int -> Ptr (Ptr (ImageBlit2KHR _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (Ptr (ImageBlit2KHR _)))) (Ptr (ImageBlit2KHR Any)
pPRegions')
    IO () -> ContT b IO ()
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 Filter -> Filter -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> Int -> Ptr Filter
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Filter)) (Filter
filter')
    IO b -> ContT b IO b
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 = 64
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> IO b -> IO b
pokeZeroCStruct p :: "pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p f :: 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 (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 (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BLIT_IMAGE_INFO_2_KHR)
    IO () -> ContT b IO ()
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 (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Image)) (Image
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ImageLayout)) (ImageLayout
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Image)) (Image
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr ImageLayout)) (ImageLayout
forall a. Zero a => a
zero)
    Ptr (ImageBlit2KHR Any)
pPRegions' <- ((Ptr (ImageBlit2KHR Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (ImageBlit2KHR Any))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (ImageBlit2KHR Any) -> IO b) -> IO b)
 -> ContT b IO (Ptr (ImageBlit2KHR Any)))
-> ((Ptr (ImageBlit2KHR Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (ImageBlit2KHR Any))
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr (ImageBlit2KHR Any) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @(ImageBlit2KHR _) ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 96) 8
    (Int -> SomeStruct ImageBlit2KHR -> ContT b IO ())
-> Vector (SomeStruct ImageBlit2KHR) -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: SomeStruct ImageBlit2KHR
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 ImageBlit2KHR)
-> SomeStruct ImageBlit2KHR -> 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 (ImageBlit2KHR Any) -> Ptr (SomeStruct ImageBlit2KHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (ImageBlit2KHR Any)
pPRegions' Ptr (ImageBlit2KHR Any) -> Int -> Ptr (ImageBlit2KHR _)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (96 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (ImageBlit2KHR _))) (SomeStruct ImageBlit2KHR
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 ImageBlit2KHR)
forall a. Monoid a => a
mempty)
    IO () -> ContT b IO ()
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 (ImageBlit2KHR Any)) -> Ptr (ImageBlit2KHR Any) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR)
-> Int -> Ptr (Ptr (ImageBlit2KHR _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (Ptr (ImageBlit2KHR _)))) (Ptr (ImageBlit2KHR Any)
pPRegions')
    IO () -> ContT b IO ()
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 Filter -> Filter -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> Int -> Ptr Filter
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Filter)) (Filter
forall a. Zero a => a
zero)
    IO b -> ContT b IO b
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 FromCStruct BlitImageInfo2KHR where
  peekCStruct :: ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR)
-> IO BlitImageInfo2KHR
peekCStruct p :: "pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p = do
    Image
srcImage <- Ptr Image -> IO Image
forall a. Storable a => Ptr a -> IO a
peek @Image (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Image))
    ImageLayout
srcImageLayout <- Ptr ImageLayout -> IO ImageLayout
forall a. Storable a => Ptr a -> IO a
peek @ImageLayout (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ImageLayout))
    Image
dstImage <- Ptr Image -> IO Image
forall a. Storable a => Ptr a -> IO a
peek @Image (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Image))
    ImageLayout
dstImageLayout <- Ptr ImageLayout -> IO ImageLayout
forall a. Storable a => Ptr a -> IO a
peek @ImageLayout (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr ImageLayout))
    Word32
regionCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32))
    Ptr (ImageBlit2KHR Any)
pRegions <- Ptr (Ptr (ImageBlit2KHR Any)) -> IO (Ptr (ImageBlit2KHR Any))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr (ImageBlit2KHR _)) (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR)
-> Int -> Ptr (Ptr (ImageBlit2KHR _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (Ptr (ImageBlit2KHR _))))
    Vector (SomeStruct ImageBlit2KHR)
pRegions' <- Int
-> (Int -> IO (SomeStruct ImageBlit2KHR))
-> IO (Vector (SomeStruct ImageBlit2KHR))
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
regionCount) (\i :: Int
i -> Ptr (SomeStruct ImageBlit2KHR) -> IO (SomeStruct ImageBlit2KHR)
forall (a :: [*] -> *).
(Extensible a,
 forall (es :: [*]).
 (Extendss a es, PeekChain es) =>
 FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (ImageBlit2KHR Any) -> Ptr (SomeStruct ImageBlit2KHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (ImageBlit2KHR Any)
pRegions Ptr (ImageBlit2KHR Any) -> Int -> Ptr (ImageBlit2KHR Any)
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (96 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (ImageBlit2KHR _)))))
    Filter
filter' <- Ptr Filter -> IO Filter
forall a. Storable a => Ptr a -> IO a
peek @Filter (("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR
p ("pBlitImageInfo" ::: Ptr BlitImageInfo2KHR) -> Int -> Ptr Filter
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Filter))
    BlitImageInfo2KHR -> IO BlitImageInfo2KHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (BlitImageInfo2KHR -> IO BlitImageInfo2KHR)
-> BlitImageInfo2KHR -> IO BlitImageInfo2KHR
forall a b. (a -> b) -> a -> b
$ Image
-> ImageLayout
-> Image
-> ImageLayout
-> Vector (SomeStruct ImageBlit2KHR)
-> Filter
-> BlitImageInfo2KHR
BlitImageInfo2KHR
             Image
srcImage ImageLayout
srcImageLayout Image
dstImage ImageLayout
dstImageLayout Vector (SomeStruct ImageBlit2KHR)
pRegions' Filter
filter'

instance Zero BlitImageInfo2KHR where
  zero :: BlitImageInfo2KHR
zero = Image
-> ImageLayout
-> Image
-> ImageLayout
-> Vector (SomeStruct ImageBlit2KHR)
-> Filter
-> BlitImageInfo2KHR
BlitImageInfo2KHR
           Image
forall a. Zero a => a
zero
           ImageLayout
forall a. Zero a => a
zero
           Image
forall a. Zero a => a
zero
           ImageLayout
forall a. Zero a => a
zero
           Vector (SomeStruct ImageBlit2KHR)
forall a. Monoid a => a
mempty
           Filter
forall a. Zero a => a
zero


-- | VkCopyBufferToImageInfo2KHR - Structure specifying parameters of a
-- buffer to image copy command
--
-- == Valid Usage
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-pRegions-04565# If the image
--     region specified by each element of @pRegions@ does not contain
--     'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM'
--     in its @pNext@ chain, it /must/ be a region that is contained within
--     @dstImage@ if the @dstImage@’s 'Vulkan.Core10.Enums.Format.Format'
--     is not a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>,
--     and /must/ be a region that is contained within the plane being
--     copied to if the @dstImage@’s 'Vulkan.Core10.Enums.Format.Format' is
--     a multi-planar format
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-pRegions-04554# If the image
--     region specified by each element of @pRegions@ does contain
--     'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM'
--     in its @pNext@ chain, the rotated destination region as described in
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#copies-buffers-images-rotation-addressing>
--     /must/ be contained within @dstImage@.
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-pRegions-04555# If any element of
--     @pRegions@ contains
--     'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM'
--     in its @pNext@ chain, then the @dstImage@ /must/ not be a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>.
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-pRegions-04556# If any element of
--     @pRegions@ contains
--     'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM'
--     in its @pNext@ chain, then the @dstImage@ /must/ be of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_2D' and /must/ not be a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>.
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-pRegions-00171# @srcBuffer@ /must/
--     be large enough to contain all buffer locations that are accessed
--     according to
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#copies-buffers-images-addressing Buffer and Image Addressing>,
--     for each element of @pRegions@
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-pRegions-00173# The union of all
--     source regions, and the union of all destination regions, specified
--     by the elements of @pRegions@, /must/ not overlap in memory
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-srcBuffer-00174# @srcBuffer@
--     /must/ have been created with
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_TRANSFER_SRC_BIT'
--     usage flag
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-dstImage-01997# The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-format-features format features>
--     of @dstImage@ /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_TRANSFER_DST_BIT'
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-srcBuffer-00176# If @srcBuffer@ is
--     non-sparse then it /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-dstImage-00177# @dstImage@ /must/
--     have been created with
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_TRANSFER_DST_BIT'
--     usage flag
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-dstImage-00178# If @dstImage@ is
--     non-sparse then it /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-dstImage-00179# @dstImage@ /must/
--     have a sample count equal to
--     'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_1_BIT'
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-dstImageLayout-00180#
--     @dstImageLayout@ /must/ specify the layout of the image subresources
--     of @dstImage@ specified in @pRegions@ at the time this command is
--     executed on a 'Vulkan.Core10.Handles.Device'
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-dstImageLayout-01396#
--     @dstImageLayout@ /must/ be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_GENERAL', or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHARED_PRESENT_KHR'
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-imageSubresource-01701# The
--     @imageSubresource.mipLevel@ member of each element of @pRegions@
--     /must/ be less than the @mipLevels@ specified in
--     'Vulkan.Core10.Image.ImageCreateInfo' when @dstImage@ was created
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-imageSubresource-01702# The
--     @imageSubresource.baseArrayLayer@ + @imageSubresource.layerCount@ of
--     each element of @pRegions@ /must/ be less than or equal to the
--     @arrayLayers@ specified in 'Vulkan.Core10.Image.ImageCreateInfo'
--     when @dstImage@ was created
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-imageOffset-01793# The
--     @imageOffset@ and @imageExtent@ members of each element of
--     @pRegions@ /must/ respect the image transfer granularity
--     requirements of @commandBuffer@’s command pool’s queue family, as
--     described in
--     'Vulkan.Core10.DeviceInitialization.QueueFamilyProperties'
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-dstImage-02543# @dstImage@ /must/
--     not have been created with @flags@ containing
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_SUBSAMPLED_BIT_EXT'
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-commandBuffer-04052# If the queue
--     family used to create the 'Vulkan.Core10.Handles.CommandPool' which
--     @commandBuffer@ was allocated from does not support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT' or
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_COMPUTE_BIT', the
--     @bufferOffset@ member of any element of @pRegions@ /must/ be a
--     multiple of @4@
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-dstImage-04053# If @dstImage@ has
--     a depth\/stencil format, the @bufferOffset@ member of any element of
--     @pRegions@ /must/ be a multiple of @4@
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-commandBuffer-04477# If the queue
--     family used to create the 'Vulkan.Core10.Handles.CommandPool' which
--     @commandBuffer@ was allocated from does not support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT', for each
--     element of @pRegions@, the @aspectMask@ member of @imageSubresource@
--     /must/ not be
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_DEPTH_BIT' or
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_STENCIL_BIT'.
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-imageOffset-00197# For each
--     element of @pRegions@ not containing
--     'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM'
--     in its @pNext@ chain, , @imageOffset.x@ and (@imageExtent.width@ +
--     @imageOffset.x@) /must/ both be greater than or equal to @0@ and
--     less than or equal to the width of the specified @imageSubresource@
--     of @dstImage@ where this refers to the width of the /plane/ of the
--     image involved in the copy in the case of a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-imageOffset-00198# For each
--     element of @pRegions@ not containing
--     'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM'
--     in its @pNext@ chain, , @imageOffset.y@ and (imageExtent.height +
--     @imageOffset.y@) /must/ both be greater than or equal to @0@ and
--     less than or equal to the height of the specified @imageSubresource@
--     of @dstImage@ where this refers to the height of the /plane/ of the
--     image involved in the copy in the case of a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-bufferOffset-01558# If @dstImage@
--     does not have either a depth\/stencil or a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>,
--     then for each element of @pRegions@, @bufferOffset@ /must/ be a
--     multiple of the format’s texel block size
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-bufferOffset-01559# If @dstImage@
--     has a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>,
--     then for each element of @pRegions@, @bufferOffset@ /must/ be a
--     multiple of the element size of the compatible format for the format
--     and the @aspectMask@ of the @imageSubresource@ as defined in
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-compatible-planes ???>
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-srcImage-00199# If @dstImage@ is
--     of type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D', then for each
--     element of @pRegions@, @imageOffset.y@ /must/ be @0@ and
--     @imageExtent.height@ /must/ be @1@
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-imageOffset-00200# For each
--     element of @pRegions@, @imageOffset.z@ and (imageExtent.depth +
--     @imageOffset.z@) /must/ both be greater than or equal to @0@ and
--     less than or equal to the depth of the specified @imageSubresource@
--     of @dstImage@
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-srcImage-00201# If @dstImage@ is
--     of type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D' or
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_2D', then for each element
--     of @pRegions@, @imageOffset.z@ /must/ be @0@ and @imageExtent.depth@
--     /must/ be @1@
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-bufferRowLength-00203# If
--     @dstImage@ is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     for each element of @pRegions@, @bufferRowLength@ /must/ be a
--     multiple of the compressed texel block width
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-bufferImageHeight-00204# If
--     @dstImage@ is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     for each element of @pRegions@, @bufferImageHeight@ /must/ be a
--     multiple of the compressed texel block height
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-imageOffset-00205# If @dstImage@
--     is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     for each element of @pRegions@, all members of @imageOffset@ /must/
--     be a multiple of the corresponding dimensions of the compressed
--     texel block
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-bufferOffset-00206# If @dstImage@
--     is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     for each element of @pRegions@, @bufferOffset@ /must/ be a multiple
--     of the compressed texel block size in bytes
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-imageExtent-00207# If @dstImage@
--     is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     for each element of @pRegions@, @imageExtent.width@ /must/ be a
--     multiple of the compressed texel block width or (@imageExtent.width@
--     + @imageOffset.x@) /must/ equal the width of the specified
--     @imageSubresource@ of @dstImage@
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-imageExtent-00208# If @dstImage@
--     is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     for each element of @pRegions@, @imageExtent.height@ /must/ be a
--     multiple of the compressed texel block height or
--     (@imageExtent.height@ + @imageOffset.y@) /must/ equal the height of
--     the specified @imageSubresource@ of @dstImage@
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-imageExtent-00209# If @dstImage@
--     is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     for each element of @pRegions@, @imageExtent.depth@ /must/ be a
--     multiple of the compressed texel block depth or (@imageExtent.depth@
--     + @imageOffset.z@) /must/ equal the depth of the specified
--     @imageSubresource@ of @dstImage@
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-aspectMask-00211# For each element
--     of @pRegions@, @imageSubresource.aspectMask@ /must/ specify aspects
--     present in @dstImage@
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-aspectMask-01560# If @dstImage@
--     has a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>,
--     then for each element of @pRegions@, @imageSubresource.aspectMask@
--     /must/ be
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_0_BIT',
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_1_BIT',
--     or
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_2_BIT'
--     (with
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_2_BIT'
--     valid only for image formats with three planes)
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-baseArrayLayer-00213# If
--     @dstImage@ is of type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_3D',
--     for each element of @pRegions@, @imageSubresource.baseArrayLayer@
--     /must/ be @0@ and @imageSubresource.layerCount@ /must/ be @1@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2_KHR'
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-pNext-pNext# @pNext@ /must/ be
--     @NULL@
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-srcBuffer-parameter# @srcBuffer@
--     /must/ be a valid 'Vulkan.Core10.Handles.Buffer' handle
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-dstImage-parameter# @dstImage@
--     /must/ be a valid 'Vulkan.Core10.Handles.Image' handle
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-dstImageLayout-parameter#
--     @dstImageLayout@ /must/ be a valid
--     'Vulkan.Core10.Enums.ImageLayout.ImageLayout' value
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-pRegions-parameter# @pRegions@
--     /must/ be a valid pointer to an array of @regionCount@ valid
--     'BufferImageCopy2KHR' structures
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-regionCount-arraylength#
--     @regionCount@ /must/ be greater than @0@
--
-- -   #VUID-VkCopyBufferToImageInfo2KHR-commonparent# Both of @dstImage@,
--     and @srcBuffer@ /must/ have been created, allocated, or retrieved
--     from the same 'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.Buffer', 'BufferImageCopy2KHR',
-- 'Vulkan.Core10.Handles.Image',
-- 'Vulkan.Core10.Enums.ImageLayout.ImageLayout',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdCopyBufferToImage2KHR'
data CopyBufferToImageInfo2KHR = CopyBufferToImageInfo2KHR
  { -- | @srcBuffer@ is the source buffer.
    CopyBufferToImageInfo2KHR -> Buffer
srcBuffer :: Buffer
  , -- | @dstImage@ is the destination image.
    CopyBufferToImageInfo2KHR -> Image
dstImage :: Image
  , -- | @dstImageLayout@ is the layout of the destination image subresources for
    -- the copy.
    CopyBufferToImageInfo2KHR -> ImageLayout
dstImageLayout :: ImageLayout
  , -- | @pRegions@ is a pointer to an array of 'BufferImageCopy2KHR' structures
    -- specifying the regions to copy.
    CopyBufferToImageInfo2KHR
-> Vector (SomeStruct BufferImageCopy2KHR)
regions :: Vector (SomeStruct BufferImageCopy2KHR)
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CopyBufferToImageInfo2KHR)
#endif
deriving instance Show CopyBufferToImageInfo2KHR

instance ToCStruct CopyBufferToImageInfo2KHR where
  withCStruct :: CopyBufferToImageInfo2KHR
-> (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
    -> IO b)
-> IO b
withCStruct x :: CopyBufferToImageInfo2KHR
x f :: ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> IO b
f = Int
-> Int
-> (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
    -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 48 8 ((("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
  -> IO b)
 -> IO b)
-> (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
    -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p -> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> CopyBufferToImageInfo2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p CopyBufferToImageInfo2KHR
x (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> IO b
f "pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p)
  pokeCStruct :: ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> CopyBufferToImageInfo2KHR -> IO b -> IO b
pokeCStruct p :: "pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p CopyBufferToImageInfo2KHR{..} f :: 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 (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 (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2_KHR)
    IO () -> ContT b IO ()
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 (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
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 Buffer -> Buffer -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Buffer)) (Buffer
srcBuffer)
    IO () -> ContT b IO ()
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Image)) (Image
dstImage)
    IO () -> ContT b IO ()
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 ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr ImageLayout)) (ImageLayout
dstImageLayout)
    IO () -> ContT b IO ()
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 (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 36 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector (SomeStruct BufferImageCopy2KHR) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct BufferImageCopy2KHR) -> Int)
-> Vector (SomeStruct BufferImageCopy2KHR) -> Int
forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct BufferImageCopy2KHR)
regions)) :: Word32))
    Ptr (BufferImageCopy2KHR Any)
pPRegions' <- ((Ptr (BufferImageCopy2KHR Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (BufferImageCopy2KHR Any))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (BufferImageCopy2KHR Any) -> IO b) -> IO b)
 -> ContT b IO (Ptr (BufferImageCopy2KHR Any)))
-> ((Ptr (BufferImageCopy2KHR Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (BufferImageCopy2KHR Any))
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr (BufferImageCopy2KHR Any) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @(BufferImageCopy2KHR _) ((Vector (SomeStruct BufferImageCopy2KHR) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct BufferImageCopy2KHR)
regions)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 72) 8
    (Int -> SomeStruct BufferImageCopy2KHR -> ContT b IO ())
-> Vector (SomeStruct BufferImageCopy2KHR) -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: SomeStruct BufferImageCopy2KHR
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 BufferImageCopy2KHR)
-> SomeStruct BufferImageCopy2KHR -> 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 (BufferImageCopy2KHR Any)
-> Ptr (SomeStruct BufferImageCopy2KHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (BufferImageCopy2KHR Any)
pPRegions' Ptr (BufferImageCopy2KHR Any) -> Int -> Ptr (BufferImageCopy2KHR _)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (72 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (BufferImageCopy2KHR _))) (SomeStruct BufferImageCopy2KHR
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 BufferImageCopy2KHR)
regions)
    IO () -> ContT b IO ()
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 (BufferImageCopy2KHR Any))
-> Ptr (BufferImageCopy2KHR Any) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr (Ptr (BufferImageCopy2KHR _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr (BufferImageCopy2KHR _)))) (Ptr (BufferImageCopy2KHR Any)
pPRegions')
    IO b -> ContT b IO b
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 = 48
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> IO b -> IO b
pokeZeroCStruct p :: "pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p f :: 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 (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 (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2_KHR)
    IO () -> ContT b IO ()
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 (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
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 Buffer -> Buffer -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Buffer)) (Buffer
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Image)) (Image
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr ImageLayout)) (ImageLayout
forall a. Zero a => a
zero)
    Ptr (BufferImageCopy2KHR Any)
pPRegions' <- ((Ptr (BufferImageCopy2KHR Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (BufferImageCopy2KHR Any))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (BufferImageCopy2KHR Any) -> IO b) -> IO b)
 -> ContT b IO (Ptr (BufferImageCopy2KHR Any)))
-> ((Ptr (BufferImageCopy2KHR Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (BufferImageCopy2KHR Any))
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr (BufferImageCopy2KHR Any) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @(BufferImageCopy2KHR _) ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 72) 8
    (Int -> SomeStruct BufferImageCopy2KHR -> ContT b IO ())
-> Vector (SomeStruct BufferImageCopy2KHR) -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: SomeStruct BufferImageCopy2KHR
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 BufferImageCopy2KHR)
-> SomeStruct BufferImageCopy2KHR -> 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 (BufferImageCopy2KHR Any)
-> Ptr (SomeStruct BufferImageCopy2KHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (BufferImageCopy2KHR Any)
pPRegions' Ptr (BufferImageCopy2KHR Any) -> Int -> Ptr (BufferImageCopy2KHR _)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (72 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (BufferImageCopy2KHR _))) (SomeStruct BufferImageCopy2KHR
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 BufferImageCopy2KHR)
forall a. Monoid a => a
mempty)
    IO () -> ContT b IO ()
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 (BufferImageCopy2KHR Any))
-> Ptr (BufferImageCopy2KHR Any) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr (Ptr (BufferImageCopy2KHR _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr (BufferImageCopy2KHR _)))) (Ptr (BufferImageCopy2KHR Any)
pPRegions')
    IO b -> ContT b IO b
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 FromCStruct CopyBufferToImageInfo2KHR where
  peekCStruct :: ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> IO CopyBufferToImageInfo2KHR
peekCStruct p :: "pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p = do
    Buffer
srcBuffer <- Ptr Buffer -> IO Buffer
forall a. Storable a => Ptr a -> IO a
peek @Buffer (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Buffer))
    Image
dstImage <- Ptr Image -> IO Image
forall a. Storable a => Ptr a -> IO a
peek @Image (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Image))
    ImageLayout
dstImageLayout <- Ptr ImageLayout -> IO ImageLayout
forall a. Storable a => Ptr a -> IO a
peek @ImageLayout (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr ImageLayout))
    Word32
regionCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 36 :: Ptr Word32))
    Ptr (BufferImageCopy2KHR Any)
pRegions <- Ptr (Ptr (BufferImageCopy2KHR Any))
-> IO (Ptr (BufferImageCopy2KHR Any))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr (BufferImageCopy2KHR _)) (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR
p ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2KHR)
-> Int -> Ptr (Ptr (BufferImageCopy2KHR _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr (BufferImageCopy2KHR _))))
    Vector (SomeStruct BufferImageCopy2KHR)
pRegions' <- Int
-> (Int -> IO (SomeStruct BufferImageCopy2KHR))
-> IO (Vector (SomeStruct BufferImageCopy2KHR))
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
regionCount) (\i :: Int
i -> Ptr (SomeStruct BufferImageCopy2KHR)
-> IO (SomeStruct BufferImageCopy2KHR)
forall (a :: [*] -> *).
(Extensible a,
 forall (es :: [*]).
 (Extendss a es, PeekChain es) =>
 FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (BufferImageCopy2KHR Any)
-> Ptr (SomeStruct BufferImageCopy2KHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (BufferImageCopy2KHR Any)
pRegions Ptr (BufferImageCopy2KHR Any)
-> Int -> Ptr (BufferImageCopy2KHR Any)
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (72 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (BufferImageCopy2KHR _)))))
    CopyBufferToImageInfo2KHR -> IO CopyBufferToImageInfo2KHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CopyBufferToImageInfo2KHR -> IO CopyBufferToImageInfo2KHR)
-> CopyBufferToImageInfo2KHR -> IO CopyBufferToImageInfo2KHR
forall a b. (a -> b) -> a -> b
$ Buffer
-> Image
-> ImageLayout
-> Vector (SomeStruct BufferImageCopy2KHR)
-> CopyBufferToImageInfo2KHR
CopyBufferToImageInfo2KHR
             Buffer
srcBuffer Image
dstImage ImageLayout
dstImageLayout Vector (SomeStruct BufferImageCopy2KHR)
pRegions'

instance Zero CopyBufferToImageInfo2KHR where
  zero :: CopyBufferToImageInfo2KHR
zero = Buffer
-> Image
-> ImageLayout
-> Vector (SomeStruct BufferImageCopy2KHR)
-> CopyBufferToImageInfo2KHR
CopyBufferToImageInfo2KHR
           Buffer
forall a. Zero a => a
zero
           Image
forall a. Zero a => a
zero
           ImageLayout
forall a. Zero a => a
zero
           Vector (SomeStruct BufferImageCopy2KHR)
forall a. Monoid a => a
mempty


-- | VkCopyImageToBufferInfo2KHR - Structure specifying parameters of a image
-- to buffer copy command
--
-- == Valid Usage
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-pRegions-04566# If the image
--     region specified by each element of @pRegions@ does not contain
--     'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM'
--     in its @pNext@ chain, it /must/ be a region that is contained within
--     @srcImage@ if the @srcImage@’s 'Vulkan.Core10.Enums.Format.Format'
--     is not a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>,
--     and /must/ be a region that is contained within the plane being
--     copied if the @srcImage@’s 'Vulkan.Core10.Enums.Format.Format' is a
--     multi-planar format
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-pRegions-04557# If the image
--     region specified by each element of @pRegions@ does contain
--     'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM'
--     in its @pNext@ chain, the rotated source region as described in
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#copies-buffers-images-rotation-addressing>
--     /must/ be contained within @srcImage@.
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-pRegions-04558# If any element of
--     @pRegions@ contains
--     'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM'
--     in its @pNext@ chain, then the @srcImage@ /must/ not be a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-pRegions-04559# If any element of
--     @pRegions@ contains
--     'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM'
--     in its @pNext@ chain, then the @srcImage@ /must/ be of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_2D', and /must/ not be a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>.
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-pRegions-00183# @dstBuffer@ /must/
--     be large enough to contain all buffer locations that are accessed
--     according to
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#copies-buffers-images-addressing Buffer and Image Addressing>,
--     for each element of @pRegions@
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-pRegions-00184# The union of all
--     source regions, and the union of all destination regions, specified
--     by the elements of @pRegions@, /must/ not overlap in memory
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-srcImage-00186# @srcImage@ /must/
--     have been created with
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_TRANSFER_SRC_BIT'
--     usage flag
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-srcImage-01998# The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-format-features format features>
--     of @srcImage@ /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_TRANSFER_SRC_BIT'
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-srcImage-00187# If @srcImage@ is
--     non-sparse then it /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-dstBuffer-00191# @dstBuffer@
--     /must/ have been created with
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_TRANSFER_DST_BIT'
--     usage flag
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-dstBuffer-00192# If @dstBuffer@ is
--     non-sparse then it /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-srcImage-00188# @srcImage@ /must/
--     have a sample count equal to
--     'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_1_BIT'
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-srcImageLayout-00189#
--     @srcImageLayout@ /must/ specify the layout of the image subresources
--     of @srcImage@ specified in @pRegions@ at the time this command is
--     executed on a 'Vulkan.Core10.Handles.Device'
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-srcImageLayout-01397#
--     @srcImageLayout@ /must/ be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_GENERAL', or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHARED_PRESENT_KHR'
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-imageSubresource-01703# The
--     @imageSubresource.mipLevel@ member of each element of @pRegions@
--     /must/ be less than the @mipLevels@ specified in
--     'Vulkan.Core10.Image.ImageCreateInfo' when @srcImage@ was created
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-imageSubresource-01704# The
--     @imageSubresource.baseArrayLayer@ + @imageSubresource.layerCount@ of
--     each element of @pRegions@ /must/ be less than or equal to the
--     @arrayLayers@ specified in 'Vulkan.Core10.Image.ImageCreateInfo'
--     when @srcImage@ was created
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-imageOffset-01794# The
--     @imageOffset@ and @imageExtent@ members of each element of
--     @pRegions@ /must/ respect the image transfer granularity
--     requirements of @commandBuffer@’s command pool’s queue family, as
--     described in
--     'Vulkan.Core10.DeviceInitialization.QueueFamilyProperties'
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-srcImage-02544# @srcImage@ /must/
--     not have been created with @flags@ containing
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_SUBSAMPLED_BIT_EXT'
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-commandBuffer-04054# If the queue
--     family used to create the 'Vulkan.Core10.Handles.CommandPool' which
--     @commandBuffer@ was allocated from does not support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT' or
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_COMPUTE_BIT', the
--     @bufferOffset@ member of any element of @pRegions@ /must/ be a
--     multiple of @4@
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-srcImage-04055# If @srcImage@ has
--     a depth\/stencil format, the @bufferOffset@ member of any element of
--     @pRegions@ /must/ be a multiple of @4@
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-imageOffset-00197# For each
--     element of @pRegions@ not containing
--     'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM'
--     in its @pNext@ chain, , @imageOffset.x@ and (@imageExtent.width@ +
--     @imageOffset.x@) /must/ both be greater than or equal to @0@ and
--     less than or equal to the width of the specified @imageSubresource@
--     of @srcImage@ where this refers to the width of the /plane/ of the
--     image involved in the copy in the case of a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-imageOffset-00198# For each
--     element of @pRegions@ not containing
--     'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM'
--     in its @pNext@ chain, , @imageOffset.y@ and (imageExtent.height +
--     @imageOffset.y@) /must/ both be greater than or equal to @0@ and
--     less than or equal to the height of the specified @imageSubresource@
--     of @srcImage@ where this refers to the height of the /plane/ of the
--     image involved in the copy in the case of a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-bufferOffset-01558# If
--     {imageparam} does not have either a depth\/stencil or a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>,
--     then for each element of @pRegions@, @bufferOffset@ /must/ be a
--     multiple of the format’s texel block size
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-bufferOffset-01559# If
--     {imageparam} has a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>,
--     then for each element of @pRegions@, @bufferOffset@ /must/ be a
--     multiple of the element size of the compatible format for the format
--     and the @aspectMask@ of the @imageSubresource@ as defined in
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-compatible-planes ???>
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-srcImage-00199# If {imageparam} is
--     of type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D', then for each
--     element of @pRegions@, @imageOffset.y@ /must/ be @0@ and
--     @imageExtent.height@ /must/ be @1@
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-imageOffset-00200# For each
--     element of @pRegions@, @imageOffset.z@ and (imageExtent.depth +
--     @imageOffset.z@) /must/ both be greater than or equal to @0@ and
--     less than or equal to the depth of the specified @imageSubresource@
--     of {imageparam}
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-srcImage-00201# If {imageparam} is
--     of type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D' or
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_2D', then for each element
--     of @pRegions@, @imageOffset.z@ /must/ be @0@ and @imageExtent.depth@
--     /must/ be @1@
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-bufferRowLength-00203# If
--     {imageparam} is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     for each element of @pRegions@, @bufferRowLength@ /must/ be a
--     multiple of the compressed texel block width
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-bufferImageHeight-00204# If
--     {imageparam} is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     for each element of @pRegions@, @bufferImageHeight@ /must/ be a
--     multiple of the compressed texel block height
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-imageOffset-00205# If {imageparam}
--     is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     for each element of @pRegions@, all members of @imageOffset@ /must/
--     be a multiple of the corresponding dimensions of the compressed
--     texel block
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-bufferOffset-00206# If
--     {imageparam} is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     for each element of @pRegions@, @bufferOffset@ /must/ be a multiple
--     of the compressed texel block size in bytes
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-imageExtent-00207# If {imageparam}
--     is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     for each element of @pRegions@, @imageExtent.width@ /must/ be a
--     multiple of the compressed texel block width or (@imageExtent.width@
--     + @imageOffset.x@) /must/ equal the width of the specified
--     @imageSubresource@ of {imageparam}
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-imageExtent-00208# If {imageparam}
--     is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     for each element of @pRegions@, @imageExtent.height@ /must/ be a
--     multiple of the compressed texel block height or
--     (@imageExtent.height@ + @imageOffset.y@) /must/ equal the height of
--     the specified @imageSubresource@ of {imageparam}
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-imageExtent-00209# If {imageparam}
--     is a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#blocked-image blocked image>,
--     for each element of @pRegions@, @imageExtent.depth@ /must/ be a
--     multiple of the compressed texel block depth or (@imageExtent.depth@
--     + @imageOffset.z@) /must/ equal the depth of the specified
--     @imageSubresource@ of {imageparam}
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-aspectMask-00211# For each element
--     of @pRegions@, @imageSubresource.aspectMask@ /must/ specify aspects
--     present in {imageparam}
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-aspectMask-01560# If {imageparam}
--     has a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>,
--     then for each element of @pRegions@, @imageSubresource.aspectMask@
--     /must/ be
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_0_BIT',
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_1_BIT',
--     or
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_2_BIT'
--     (with
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_PLANE_2_BIT'
--     valid only for image formats with three planes)
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-baseArrayLayer-00213# If
--     {imageparam} is of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_3D', for each element of
--     @pRegions@, @imageSubresource.baseArrayLayer@ /must/ be @0@ and
--     @imageSubresource.layerCount@ /must/ be @1@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR'
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-pNext-pNext# @pNext@ /must/ be
--     @NULL@
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-srcImage-parameter# @srcImage@
--     /must/ be a valid 'Vulkan.Core10.Handles.Image' handle
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-srcImageLayout-parameter#
--     @srcImageLayout@ /must/ be a valid
--     'Vulkan.Core10.Enums.ImageLayout.ImageLayout' value
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-dstBuffer-parameter# @dstBuffer@
--     /must/ be a valid 'Vulkan.Core10.Handles.Buffer' handle
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-pRegions-parameter# @pRegions@
--     /must/ be a valid pointer to an array of @regionCount@ valid
--     'BufferImageCopy2KHR' structures
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-regionCount-arraylength#
--     @regionCount@ /must/ be greater than @0@
--
-- -   #VUID-VkCopyImageToBufferInfo2KHR-commonparent# Both of @dstBuffer@,
--     and @srcImage@ /must/ have been created, allocated, or retrieved
--     from the same 'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.Buffer', 'BufferImageCopy2KHR',
-- 'Vulkan.Core10.Handles.Image',
-- 'Vulkan.Core10.Enums.ImageLayout.ImageLayout',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdCopyImageToBuffer2KHR'
data CopyImageToBufferInfo2KHR = CopyImageToBufferInfo2KHR
  { -- | @srcImage@ is the source image.
    CopyImageToBufferInfo2KHR -> Image
srcImage :: Image
  , -- | @srcImageLayout@ is the layout of the source image subresources for the
    -- copy.
    CopyImageToBufferInfo2KHR -> ImageLayout
srcImageLayout :: ImageLayout
  , -- | @dstBuffer@ is the destination buffer.
    CopyImageToBufferInfo2KHR -> Buffer
dstBuffer :: Buffer
  , -- | @pRegions@ is a pointer to an array of 'BufferImageCopy2KHR' structures
    -- specifying the regions to copy.
    CopyImageToBufferInfo2KHR
-> Vector (SomeStruct BufferImageCopy2KHR)
regions :: Vector (SomeStruct BufferImageCopy2KHR)
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CopyImageToBufferInfo2KHR)
#endif
deriving instance Show CopyImageToBufferInfo2KHR

instance ToCStruct CopyImageToBufferInfo2KHR where
  withCStruct :: CopyImageToBufferInfo2KHR
-> (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
    -> IO b)
-> IO b
withCStruct x :: CopyImageToBufferInfo2KHR
x f :: ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> IO b
f = Int
-> Int
-> (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
    -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 56 8 ((("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
  -> IO b)
 -> IO b)
-> (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
    -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p -> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> CopyImageToBufferInfo2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p CopyImageToBufferInfo2KHR
x (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> IO b
f "pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p)
  pokeCStruct :: ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> CopyImageToBufferInfo2KHR -> IO b -> IO b
pokeCStruct p :: "pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p CopyImageToBufferInfo2KHR{..} f :: 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 (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 (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR)
    IO () -> ContT b IO ()
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 (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Image)) (Image
srcImage)
    IO () -> ContT b IO ()
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 ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ImageLayout)) (ImageLayout
srcImageLayout)
    IO () -> ContT b IO ()
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 Buffer -> Buffer -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Buffer)) (Buffer
dstBuffer)
    IO () -> ContT b IO ()
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 (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector (SomeStruct BufferImageCopy2KHR) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct BufferImageCopy2KHR) -> Int)
-> Vector (SomeStruct BufferImageCopy2KHR) -> Int
forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct BufferImageCopy2KHR)
regions)) :: Word32))
    Ptr (BufferImageCopy2KHR Any)
pPRegions' <- ((Ptr (BufferImageCopy2KHR Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (BufferImageCopy2KHR Any))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (BufferImageCopy2KHR Any) -> IO b) -> IO b)
 -> ContT b IO (Ptr (BufferImageCopy2KHR Any)))
-> ((Ptr (BufferImageCopy2KHR Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (BufferImageCopy2KHR Any))
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr (BufferImageCopy2KHR Any) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @(BufferImageCopy2KHR _) ((Vector (SomeStruct BufferImageCopy2KHR) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct BufferImageCopy2KHR)
regions)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 72) 8
    (Int -> SomeStruct BufferImageCopy2KHR -> ContT b IO ())
-> Vector (SomeStruct BufferImageCopy2KHR) -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: SomeStruct BufferImageCopy2KHR
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 BufferImageCopy2KHR)
-> SomeStruct BufferImageCopy2KHR -> 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 (BufferImageCopy2KHR Any)
-> Ptr (SomeStruct BufferImageCopy2KHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (BufferImageCopy2KHR Any)
pPRegions' Ptr (BufferImageCopy2KHR Any) -> Int -> Ptr (BufferImageCopy2KHR _)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (72 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (BufferImageCopy2KHR _))) (SomeStruct BufferImageCopy2KHR
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 BufferImageCopy2KHR)
regions)
    IO () -> ContT b IO ()
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 (BufferImageCopy2KHR Any))
-> Ptr (BufferImageCopy2KHR Any) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr (Ptr (BufferImageCopy2KHR _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (Ptr (BufferImageCopy2KHR _)))) (Ptr (BufferImageCopy2KHR Any)
pPRegions')
    IO b -> ContT b IO b
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 = 56
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> IO b -> IO b
pokeZeroCStruct p :: "pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p f :: 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 (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 (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR)
    IO () -> ContT b IO ()
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 (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Image)) (Image
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ImageLayout)) (ImageLayout
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 Buffer -> Buffer -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Buffer)) (Buffer
forall a. Zero a => a
zero)
    Ptr (BufferImageCopy2KHR Any)
pPRegions' <- ((Ptr (BufferImageCopy2KHR Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (BufferImageCopy2KHR Any))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (BufferImageCopy2KHR Any) -> IO b) -> IO b)
 -> ContT b IO (Ptr (BufferImageCopy2KHR Any)))
-> ((Ptr (BufferImageCopy2KHR Any) -> IO b) -> IO b)
-> ContT b IO (Ptr (BufferImageCopy2KHR Any))
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr (BufferImageCopy2KHR Any) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @(BufferImageCopy2KHR _) ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 72) 8
    (Int -> SomeStruct BufferImageCopy2KHR -> ContT b IO ())
-> Vector (SomeStruct BufferImageCopy2KHR) -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: SomeStruct BufferImageCopy2KHR
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 BufferImageCopy2KHR)
-> SomeStruct BufferImageCopy2KHR -> 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 (BufferImageCopy2KHR Any)
-> Ptr (SomeStruct BufferImageCopy2KHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (BufferImageCopy2KHR Any)
pPRegions' Ptr (BufferImageCopy2KHR Any) -> Int -> Ptr (BufferImageCopy2KHR _)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (72 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (BufferImageCopy2KHR _))) (SomeStruct BufferImageCopy2KHR
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 BufferImageCopy2KHR)
forall a. Monoid a => a
mempty)
    IO () -> ContT b IO ()
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 (BufferImageCopy2KHR Any))
-> Ptr (BufferImageCopy2KHR Any) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr (Ptr (BufferImageCopy2KHR _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (Ptr (BufferImageCopy2KHR _)))) (Ptr (BufferImageCopy2KHR Any)
pPRegions')
    IO b -> ContT b IO b
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 FromCStruct CopyImageToBufferInfo2KHR where
  peekCStruct :: ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> IO CopyImageToBufferInfo2KHR
peekCStruct p :: "pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p = do
    Image
srcImage <- Ptr Image -> IO Image
forall a. Storable a => Ptr a -> IO a
peek @Image (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Image))
    ImageLayout
srcImageLayout <- Ptr ImageLayout -> IO ImageLayout
forall a. Storable a => Ptr a -> IO a
peek @ImageLayout (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ImageLayout))
    Buffer
dstBuffer <- Ptr Buffer -> IO Buffer
forall a. Storable a => Ptr a -> IO a
peek @Buffer (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr Buffer
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Buffer))
    Word32
regionCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32))
    Ptr (BufferImageCopy2KHR Any)
pRegions <- Ptr (Ptr (BufferImageCopy2KHR Any))
-> IO (Ptr (BufferImageCopy2KHR Any))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr (BufferImageCopy2KHR _)) (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR
p ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2KHR)
-> Int -> Ptr (Ptr (BufferImageCopy2KHR _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (Ptr (BufferImageCopy2KHR _))))
    Vector (SomeStruct BufferImageCopy2KHR)
pRegions' <- Int
-> (Int -> IO (SomeStruct BufferImageCopy2KHR))
-> IO (Vector (SomeStruct BufferImageCopy2KHR))
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
regionCount) (\i :: Int
i -> Ptr (SomeStruct BufferImageCopy2KHR)
-> IO (SomeStruct BufferImageCopy2KHR)
forall (a :: [*] -> *).
(Extensible a,
 forall (es :: [*]).
 (Extendss a es, PeekChain es) =>
 FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (BufferImageCopy2KHR Any)
-> Ptr (SomeStruct BufferImageCopy2KHR)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (BufferImageCopy2KHR Any)
pRegions Ptr (BufferImageCopy2KHR Any)
-> Int -> Ptr (BufferImageCopy2KHR Any)
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (72 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (BufferImageCopy2KHR _)))))
    CopyImageToBufferInfo2KHR -> IO CopyImageToBufferInfo2KHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CopyImageToBufferInfo2KHR -> IO CopyImageToBufferInfo2KHR)
-> CopyImageToBufferInfo2KHR -> IO CopyImageToBufferInfo2KHR
forall a b. (a -> b) -> a -> b
$ Image
-> ImageLayout
-> Buffer
-> Vector (SomeStruct BufferImageCopy2KHR)
-> CopyImageToBufferInfo2KHR
CopyImageToBufferInfo2KHR
             Image
srcImage ImageLayout
srcImageLayout Buffer
dstBuffer Vector (SomeStruct BufferImageCopy2KHR)
pRegions'

instance Zero CopyImageToBufferInfo2KHR where
  zero :: CopyImageToBufferInfo2KHR
zero = Image
-> ImageLayout
-> Buffer
-> Vector (SomeStruct BufferImageCopy2KHR)
-> CopyImageToBufferInfo2KHR
CopyImageToBufferInfo2KHR
           Image
forall a. Zero a => a
zero
           ImageLayout
forall a. Zero a => a
zero
           Buffer
forall a. Zero a => a
zero
           Vector (SomeStruct BufferImageCopy2KHR)
forall a. Monoid a => a
mempty


-- | VkResolveImageInfo2KHR - Structure specifying parameters of resolve
-- image command
--
-- == Valid Usage
--
-- -   #VUID-VkResolveImageInfo2KHR-pRegions-00255# The union of all source
--     regions, and the union of all destination regions, specified by the
--     elements of @pRegions@, /must/ not overlap in memory
--
-- -   #VUID-VkResolveImageInfo2KHR-srcImage-00256# If @srcImage@ is
--     non-sparse then it /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-VkResolveImageInfo2KHR-srcImage-00257# @srcImage@ /must/ have
--     a sample count equal to any valid sample count value other than
--     'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_1_BIT'
--
-- -   #VUID-VkResolveImageInfo2KHR-dstImage-00258# If @dstImage@ is
--     non-sparse then it /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-VkResolveImageInfo2KHR-dstImage-00259# @dstImage@ /must/ have
--     a sample count equal to
--     'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_1_BIT'
--
-- -   #VUID-VkResolveImageInfo2KHR-srcImageLayout-00260# @srcImageLayout@
--     /must/ specify the layout of the image subresources of @srcImage@
--     specified in @pRegions@ at the time this command is executed on a
--     'Vulkan.Core10.Handles.Device'
--
-- -   #VUID-VkResolveImageInfo2KHR-srcImageLayout-01400# @srcImageLayout@
--     /must/ be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHARED_PRESENT_KHR',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL'
--     or 'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_GENERAL'
--
-- -   #VUID-VkResolveImageInfo2KHR-dstImageLayout-00262# @dstImageLayout@
--     /must/ specify the layout of the image subresources of @dstImage@
--     specified in @pRegions@ at the time this command is executed on a
--     'Vulkan.Core10.Handles.Device'
--
-- -   #VUID-VkResolveImageInfo2KHR-dstImageLayout-01401# @dstImageLayout@
--     /must/ be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHARED_PRESENT_KHR',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL'
--     or 'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_GENERAL'
--
-- -   #VUID-VkResolveImageInfo2KHR-dstImage-02003# The
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-format-features format features>
--     of @dstImage@ /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_COLOR_ATTACHMENT_BIT'
--
-- -   #VUID-VkResolveImageInfo2KHR-srcImage-01386# @srcImage@ and
--     @dstImage@ /must/ have been created with the same image format
--
-- -   #VUID-VkResolveImageInfo2KHR-srcSubresource-01709# The
--     @srcSubresource.mipLevel@ member of each element of @pRegions@
--     /must/ be less than the @mipLevels@ specified in
--     'Vulkan.Core10.Image.ImageCreateInfo' when @srcImage@ was created
--
-- -   #VUID-VkResolveImageInfo2KHR-dstSubresource-01710# The
--     @dstSubresource.mipLevel@ member of each element of @pRegions@
--     /must/ be less than the @mipLevels@ specified in
--     'Vulkan.Core10.Image.ImageCreateInfo' when @dstImage@ was created
--
-- -   #VUID-VkResolveImageInfo2KHR-srcSubresource-01711# The
--     @srcSubresource.baseArrayLayer@ + @srcSubresource.layerCount@ of
--     each element of @pRegions@ /must/ be less than or equal to the
--     @arrayLayers@ specified in 'Vulkan.Core10.Image.ImageCreateInfo'
--     when @srcImage@ was created
--
-- -   #VUID-VkResolveImageInfo2KHR-dstSubresource-01712# The
--     @dstSubresource.baseArrayLayer@ + @dstSubresource.layerCount@ of
--     each element of @pRegions@ /must/ be less than or equal to the
--     @arrayLayers@ specified in 'Vulkan.Core10.Image.ImageCreateInfo'
--     when @dstImage@ was created
--
-- -   #VUID-VkResolveImageInfo2KHR-dstImage-02546# @dstImage@ and
--     @srcImage@ /must/ not have been created with @flags@ containing
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_SUBSAMPLED_BIT_EXT'
--
-- -   #VUID-VkResolveImageInfo2KHR-srcImage-04446# If either @srcImage@ or
--     @dstImage@ are of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_3D', then for each element
--     of @pRegions@, @srcSubresource.baseArrayLayer@ /must/ be @0@ and
--     @srcSubresource.layerCount@ /must/ be @1@
--
-- -   #VUID-VkResolveImageInfo2KHR-srcImage-04447# If either @srcImage@ or
--     @dstImage@ are of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_3D', then for each element
--     of @pRegions@, @dstSubresource.baseArrayLayer@ /must/ be @0@ and
--     @dstSubresource.layerCount@ /must/ be @1@
--
-- -   #VUID-VkResolveImageInfo2KHR-srcOffset-00269# For each element of
--     @pRegions@, @srcOffset.x@ and (@extent.width@ + @srcOffset.x@)
--     /must/ both be greater than or equal to @0@ and less than or equal
--     to the width of the specified @srcSubresource@ of @srcImage@
--
-- -   #VUID-VkResolveImageInfo2KHR-srcOffset-00270# For each element of
--     @pRegions@, @srcOffset.y@ and (@extent.height@ + @srcOffset.y@)
--     /must/ both be greater than or equal to @0@ and less than or equal
--     to the height of the specified @srcSubresource@ of @srcImage@
--
-- -   #VUID-VkResolveImageInfo2KHR-srcImage-00271# If @srcImage@ is of
--     type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D', then for each
--     element of @pRegions@, @srcOffset.y@ /must/ be @0@ and
--     @extent.height@ /must/ be @1@
--
-- -   #VUID-VkResolveImageInfo2KHR-srcOffset-00272# For each element of
--     @pRegions@, @srcOffset.z@ and (@extent.depth@ + @srcOffset.z@)
--     /must/ both be greater than or equal to @0@ and less than or equal
--     to the depth of the specified @srcSubresource@ of @srcImage@
--
-- -   #VUID-VkResolveImageInfo2KHR-srcImage-00273# If @srcImage@ is of
--     type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D' or
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_2D', then for each element
--     of @pRegions@, @srcOffset.z@ /must/ be @0@ and @extent.depth@ /must/
--     be @1@
--
-- -   #VUID-VkResolveImageInfo2KHR-dstOffset-00274# For each element of
--     @pRegions@, @dstOffset.x@ and (@extent.width@ + @dstOffset.x@)
--     /must/ both be greater than or equal to @0@ and less than or equal
--     to the width of the specified @dstSubresource@ of @dstImage@
--
-- -   #VUID-VkResolveImageInfo2KHR-dstOffset-00275# For each element of
--     @pRegions@, @dstOffset.y@ and (@extent.height@ + @dstOffset.y@)
--     /must/ both be greater than or equal to @0@ and less than or equal
--     to the height of the specified @dstSubresource@ of @dstImage@
--
-- -   #VUID-VkResolveImageInfo2KHR-dstImage-00276# If @dstImage@ is of
--     type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D', then for each
--     element of @pRegions@, @dstOffset.y@ /must/ be @0@ and
--     @extent.height@ /must/ be @1@
--
-- -   #VUID-VkResolveImageInfo2KHR-dstOffset-00277# For each element of
--     @pRegions@, @dstOffset.z@ and (@extent.depth@ + @dstOffset.z@)
--     /must/ both be greater than or equal to @0@ and less than or equal
--     to the depth of the specified @dstSubresource@ of @dstImage@
--
-- -   #VUID-VkResolveImageInfo2KHR-dstImage-00278# If @dstImage@ is of
--     type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D' or
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_2D', then for each element
--     of @pRegions@, @dstOffset.z@ /must/ be @0@ and @extent.depth@ /must/
--     be @1@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkResolveImageInfo2KHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2_KHR'
--
-- -   #VUID-VkResolveImageInfo2KHR-pNext-pNext# @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkResolveImageInfo2KHR-srcImage-parameter# @srcImage@ /must/
--     be a valid 'Vulkan.Core10.Handles.Image' handle
--
-- -   #VUID-VkResolveImageInfo2KHR-srcImageLayout-parameter#
--     @srcImageLayout@ /must/ be a valid
--     'Vulkan.Core10.Enums.ImageLayout.ImageLayout' value
--
-- -   #VUID-VkResolveImageInfo2KHR-dstImage-parameter# @dstImage@ /must/
--     be a valid 'Vulkan.Core10.Handles.Image' handle
--
-- -   #VUID-VkResolveImageInfo2KHR-dstImageLayout-parameter#
--     @dstImageLayout@ /must/ be a valid
--     'Vulkan.Core10.Enums.ImageLayout.ImageLayout' value
--
-- -   #VUID-VkResolveImageInfo2KHR-pRegions-parameter# @pRegions@ /must/
--     be a valid pointer to an array of @regionCount@ valid
--     'ImageResolve2KHR' structures
--
-- -   #VUID-VkResolveImageInfo2KHR-regionCount-arraylength# @regionCount@
--     /must/ be greater than @0@
--
-- -   #VUID-VkResolveImageInfo2KHR-commonparent# Both of @dstImage@, and
--     @srcImage@ /must/ have been created, allocated, or retrieved from
--     the same 'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.Image',
-- 'Vulkan.Core10.Enums.ImageLayout.ImageLayout', 'ImageResolve2KHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType', 'cmdResolveImage2KHR'
data ResolveImageInfo2KHR = ResolveImageInfo2KHR
  { -- | @srcImage@ is the source image.
    ResolveImageInfo2KHR -> Image
srcImage :: Image
  , -- | @srcImageLayout@ is the layout of the source image subresources for the
    -- resolve.
    ResolveImageInfo2KHR -> ImageLayout
srcImageLayout :: ImageLayout
  , -- | @dstImage@ is the destination image.
    ResolveImageInfo2KHR -> Image
dstImage :: Image
  , -- | @dstImageLayout@ is the layout of the destination image subresources for
    -- the resolve.
    ResolveImageInfo2KHR -> ImageLayout
dstImageLayout :: ImageLayout
  , -- | @pRegions@ is a pointer to an array of 'ImageResolve2KHR' structures
    -- specifying the regions to resolve.
    ResolveImageInfo2KHR -> Vector ImageResolve2KHR
regions :: Vector ImageResolve2KHR
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ResolveImageInfo2KHR)
#endif
deriving instance Show ResolveImageInfo2KHR

instance ToCStruct ResolveImageInfo2KHR where
  withCStruct :: ResolveImageInfo2KHR
-> (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO b)
-> IO b
withCStruct x :: ResolveImageInfo2KHR
x f :: ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO b
f = Int
-> Int
-> (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 56 8 ((("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO b)
 -> IO b)
-> (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p -> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> ResolveImageInfo2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ResolveImageInfo2KHR
x (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO b
f "pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p)
  pokeCStruct :: ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> ResolveImageInfo2KHR -> IO b -> IO b
pokeCStruct p :: "pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ResolveImageInfo2KHR{..} f :: 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 (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 (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2_KHR)
    IO () -> ContT b IO ()
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 (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Image)) (Image
srcImage)
    IO () -> ContT b IO ()
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 ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ImageLayout)) (ImageLayout
srcImageLayout)
    IO () -> ContT b IO ()
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Image)) (Image
dstImage)
    IO () -> ContT b IO ()
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 ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr ImageLayout)) (ImageLayout
dstImageLayout)
    IO () -> ContT b IO ()
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 (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector ImageResolve2KHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ImageResolve2KHR -> Int) -> Vector ImageResolve2KHR -> Int
forall a b. (a -> b) -> a -> b
$ (Vector ImageResolve2KHR
regions)) :: Word32))
    Ptr ImageResolve2KHR
pPRegions' <- ((Ptr ImageResolve2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr ImageResolve2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ImageResolve2KHR -> IO b) -> IO b)
 -> ContT b IO (Ptr ImageResolve2KHR))
-> ((Ptr ImageResolve2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr ImageResolve2KHR)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ImageResolve2KHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @ImageResolve2KHR ((Vector ImageResolve2KHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ImageResolve2KHR
regions)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 88) 8
    IO () -> ContT b IO ()
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 -> ImageResolve2KHR -> IO ())
-> Vector ImageResolve2KHR -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: ImageResolve2KHR
e -> Ptr ImageResolve2KHR -> ImageResolve2KHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ImageResolve2KHR
pPRegions' Ptr ImageResolve2KHR -> Int -> Ptr ImageResolve2KHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (88 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ImageResolve2KHR) (ImageResolve2KHR
e)) (Vector ImageResolve2KHR
regions)
    IO () -> ContT b IO ()
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 ImageResolve2KHR) -> Ptr ImageResolve2KHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr (Ptr ImageResolve2KHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (Ptr ImageResolve2KHR))) (Ptr ImageResolve2KHR
pPRegions')
    IO b -> ContT b IO b
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 = 56
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR) -> IO b -> IO b
pokeZeroCStruct p :: "pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p f :: 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 (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 (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2_KHR)
    IO () -> ContT b IO ()
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 (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Image)) (Image
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ImageLayout)) (ImageLayout
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Image)) (Image
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
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 ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr ImageLayout)) (ImageLayout
forall a. Zero a => a
zero)
    Ptr ImageResolve2KHR
pPRegions' <- ((Ptr ImageResolve2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr ImageResolve2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ImageResolve2KHR -> IO b) -> IO b)
 -> ContT b IO (Ptr ImageResolve2KHR))
-> ((Ptr ImageResolve2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr ImageResolve2KHR)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ImageResolve2KHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @ImageResolve2KHR ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 88) 8
    IO () -> ContT b IO ()
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 -> ImageResolve2KHR -> IO ())
-> Vector ImageResolve2KHR -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: ImageResolve2KHR
e -> Ptr ImageResolve2KHR -> ImageResolve2KHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ImageResolve2KHR
pPRegions' Ptr ImageResolve2KHR -> Int -> Ptr ImageResolve2KHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (88 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ImageResolve2KHR) (ImageResolve2KHR
e)) (Vector ImageResolve2KHR
forall a. Monoid a => a
mempty)
    IO () -> ContT b IO ()
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 ImageResolve2KHR) -> Ptr ImageResolve2KHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr (Ptr ImageResolve2KHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (Ptr ImageResolve2KHR))) (Ptr ImageResolve2KHR
pPRegions')
    IO b -> ContT b IO b
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 FromCStruct ResolveImageInfo2KHR where
  peekCStruct :: ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> IO ResolveImageInfo2KHR
peekCStruct p :: "pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p = do
    Image
srcImage <- Ptr Image -> IO Image
forall a. Storable a => Ptr a -> IO a
peek @Image (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Image))
    ImageLayout
srcImageLayout <- Ptr ImageLayout -> IO ImageLayout
forall a. Storable a => Ptr a -> IO a
peek @ImageLayout (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ImageLayout))
    Image
dstImage <- Ptr Image -> IO Image
forall a. Storable a => Ptr a -> IO a
peek @Image (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Image))
    ImageLayout
dstImageLayout <- Ptr ImageLayout -> IO ImageLayout
forall a. Storable a => Ptr a -> IO a
peek @ImageLayout (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr ImageLayout))
    Word32
regionCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32))
    Ptr ImageResolve2KHR
pRegions <- Ptr (Ptr ImageResolve2KHR) -> IO (Ptr ImageResolve2KHR)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ImageResolve2KHR) (("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR
p ("pResolveImageInfo" ::: Ptr ResolveImageInfo2KHR)
-> Int -> Ptr (Ptr ImageResolve2KHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (Ptr ImageResolve2KHR)))
    Vector ImageResolve2KHR
pRegions' <- Int -> (Int -> IO ImageResolve2KHR) -> IO (Vector ImageResolve2KHR)
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
regionCount) (\i :: Int
i -> Ptr ImageResolve2KHR -> IO ImageResolve2KHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageResolve2KHR ((Ptr ImageResolve2KHR
pRegions Ptr ImageResolve2KHR -> Int -> Ptr ImageResolve2KHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (88 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ImageResolve2KHR)))
    ResolveImageInfo2KHR -> IO ResolveImageInfo2KHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ResolveImageInfo2KHR -> IO ResolveImageInfo2KHR)
-> ResolveImageInfo2KHR -> IO ResolveImageInfo2KHR
forall a b. (a -> b) -> a -> b
$ Image
-> ImageLayout
-> Image
-> ImageLayout
-> Vector ImageResolve2KHR
-> ResolveImageInfo2KHR
ResolveImageInfo2KHR
             Image
srcImage ImageLayout
srcImageLayout Image
dstImage ImageLayout
dstImageLayout Vector ImageResolve2KHR
pRegions'

instance Zero ResolveImageInfo2KHR where
  zero :: ResolveImageInfo2KHR
zero = Image
-> ImageLayout
-> Image
-> ImageLayout
-> Vector ImageResolve2KHR
-> ResolveImageInfo2KHR
ResolveImageInfo2KHR
           Image
forall a. Zero a => a
zero
           ImageLayout
forall a. Zero a => a
zero
           Image
forall a. Zero a => a
zero
           ImageLayout
forall a. Zero a => a
zero
           Vector ImageResolve2KHR
forall a. Monoid a => a
mempty


type KHR_COPY_COMMANDS_2_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_KHR_COPY_COMMANDS_2_SPEC_VERSION"
pattern KHR_COPY_COMMANDS_2_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_COPY_COMMANDS_2_SPEC_VERSION :: a
$mKHR_COPY_COMMANDS_2_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
KHR_COPY_COMMANDS_2_SPEC_VERSION = 1


type KHR_COPY_COMMANDS_2_EXTENSION_NAME = "VK_KHR_copy_commands2"

-- No documentation found for TopLevel "VK_KHR_COPY_COMMANDS_2_EXTENSION_NAME"
pattern KHR_COPY_COMMANDS_2_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_COPY_COMMANDS_2_EXTENSION_NAME :: a
$mKHR_COPY_COMMANDS_2_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
KHR_COPY_COMMANDS_2_EXTENSION_NAME = "VK_KHR_copy_commands2"