{-# language CPP #-}
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 Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytesAligned)
import GHC.IO (throwIO)
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 Control.Monad.IO.Class (MonadIO)
import Data.String (IsString)
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.Utils (lowerArrayPtr)
import Vulkan.Core10.Handles (Buffer)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer_T)
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.Core10.FundamentalTypes (Extent3D)
import Vulkan.Core10.Enums.Filter (Filter)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.Core10.Handles (Image)
import Vulkan.Core10.Enums.ImageLayout (ImageLayout)
import Vulkan.Core10.CommandBufferBuilding (ImageSubresourceLayers)
import Vulkan.Core10.FundamentalTypes (Offset3D)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
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 ()
cmdCopyBuffer2KHR :: forall io
. (MonadIO io)
=>
CommandBuffer
->
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
$ 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 ()
cmdCopyImage2KHR :: forall io
. (MonadIO io)
=>
CommandBuffer
->
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
$ 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 ()
cmdBlitImage2KHR :: forall io
. (MonadIO io)
=>
CommandBuffer
->
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
$ 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 ()
cmdCopyBufferToImage2KHR :: forall io
. (MonadIO io)
=>
CommandBuffer
->
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
$ 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 ()
cmdCopyImageToBuffer2KHR :: forall io
. (MonadIO io)
=>
CommandBuffer
->
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
$ 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 ()
cmdResolveImage2KHR :: forall io
. (MonadIO io)
=>
CommandBuffer
->
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
$ 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
$ ()
data BufferCopy2KHR = BufferCopy2KHR
{
BufferCopy2KHR -> DeviceSize
srcOffset :: DeviceSize
,
BufferCopy2KHR -> DeviceSize
dstOffset :: DeviceSize
,
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
data ImageCopy2KHR = ImageCopy2KHR
{
ImageCopy2KHR -> ImageSubresourceLayers
srcSubresource :: ImageSubresourceLayers
,
ImageCopy2KHR -> Offset3D
srcOffset :: Offset3D
,
ImageCopy2KHR -> ImageSubresourceLayers
dstSubresource :: ImageSubresourceLayers
,
ImageCopy2KHR -> Offset3D
dstOffset :: Offset3D
,
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 = 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 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)
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 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)
((() -> 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 ImageSubresourceLayers
-> ImageSubresourceLayers -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
srcSubresource) (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
$ ())
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Offset3D)) (Offset3D
srcOffset) (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
$ ())
((() -> 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 ImageSubresourceLayers
-> ImageSubresourceLayers -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
dstSubresource) (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
$ ())
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Offset3D)) (Offset3D
dstOffset) (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
$ ())
((() -> 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 Extent3D -> Extent3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr ImageCopy2KHR
p Ptr ImageCopy2KHR -> Int -> Ptr Extent3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr Extent3D)) (Extent3D
extent) (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
$ ())
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 = 88
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr ImageCopy2KHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr ImageCopy2KHR
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 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)
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 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)
((() -> 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 ImageSubresourceLayers
-> ImageSubresourceLayers -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((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) (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
$ ())
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((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) (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
$ ())
((() -> 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 ImageSubresourceLayers
-> ImageSubresourceLayers -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((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) (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
$ ())
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((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) (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
$ ())
((() -> 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 Extent3D -> Extent3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((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 -> 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
$ ())
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 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 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
data ImageBlit2KHR = ImageBlit2KHR
{
ImageBlit2KHR -> ImageSubresourceLayers
srcSubresource :: ImageSubresourceLayers
,
ImageBlit2KHR -> (Offset3D, Offset3D)
srcOffsets :: (Offset3D, Offset3D)
,
ImageBlit2KHR -> ImageSubresourceLayers
dstSubresource :: ImageSubresourceLayers
,
ImageBlit2KHR -> (Offset3D, Offset3D)
dstOffsets :: (Offset3D, Offset3D)
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImageBlit2KHR)
#endif
deriving instance Show ImageBlit2KHR
instance ToCStruct ImageBlit2KHR where
withCStruct :: ImageBlit2KHR -> (Ptr ImageBlit2KHR -> IO b) -> IO b
withCStruct x :: ImageBlit2KHR
x f :: Ptr ImageBlit2KHR -> IO b
f = Int -> Int -> (Ptr ImageBlit2KHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 96 8 ((Ptr ImageBlit2KHR -> IO b) -> IO b)
-> (Ptr ImageBlit2KHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr ImageBlit2KHR
p -> Ptr ImageBlit2KHR -> ImageBlit2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageBlit2KHR
p ImageBlit2KHR
x (Ptr ImageBlit2KHR -> IO b
f Ptr ImageBlit2KHR
p)
pokeCStruct :: Ptr ImageBlit2KHR -> ImageBlit2KHR -> IO b -> IO b
pokeCStruct p :: Ptr ImageBlit2KHR
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
p Ptr ImageBlit2KHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_BLIT_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 ((Ptr ImageBlit2KHR
p Ptr ImageBlit2KHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
((() -> 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 ImageSubresourceLayers
-> ImageSubresourceLayers -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr ImageBlit2KHR
p Ptr ImageBlit2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
srcSubresource) (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
$ ())
let pSrcOffsets' :: Ptr Offset3D
pSrcOffsets' = Ptr (FixedArray 2 Offset3D) -> Ptr Offset3D
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr ImageBlit2KHR
p Ptr ImageBlit2KHR -> Int -> Ptr (FixedArray 2 Offset3D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (FixedArray 2 Offset3D)))
case ((Offset3D, Offset3D)
srcOffsets) of
(e0 :: Offset3D
e0, e1 :: Offset3D
e1) -> do
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr Offset3D
pSrcOffsets' :: Ptr Offset3D) (Offset3D
e0) (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
$ ())
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr Offset3D
pSrcOffsets' Ptr Offset3D -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Offset3D) (Offset3D
e1) (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
$ ())
((() -> 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 ImageSubresourceLayers
-> ImageSubresourceLayers -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr ImageBlit2KHR
p Ptr ImageBlit2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
dstSubresource) (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
$ ())
let pDstOffsets' :: Ptr Offset3D
pDstOffsets' = Ptr (FixedArray 2 Offset3D) -> Ptr Offset3D
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr ImageBlit2KHR
p Ptr ImageBlit2KHR -> Int -> Ptr (FixedArray 2 Offset3D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr (FixedArray 2 Offset3D)))
case ((Offset3D, Offset3D)
dstOffsets) of
(e0 :: Offset3D
e0, e1 :: Offset3D
e1) -> do
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr Offset3D
pDstOffsets' :: Ptr Offset3D) (Offset3D
e0) (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
$ ())
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr Offset3D
pDstOffsets' Ptr Offset3D -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Offset3D) (Offset3D
e1) (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
$ ())
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 -> IO b -> IO b
pokeZeroCStruct p :: Ptr ImageBlit2KHR
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
p Ptr ImageBlit2KHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_BLIT_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 ((Ptr ImageBlit2KHR
p Ptr ImageBlit2KHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
((() -> 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 ImageSubresourceLayers
-> ImageSubresourceLayers -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr ImageBlit2KHR
p Ptr ImageBlit2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
forall a. Zero a => a
zero) (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
$ ())
let pSrcOffsets' :: Ptr Offset3D
pSrcOffsets' = Ptr (FixedArray 2 Offset3D) -> Ptr Offset3D
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr ImageBlit2KHR
p Ptr ImageBlit2KHR -> Int -> Ptr (FixedArray 2 Offset3D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (FixedArray 2 Offset3D)))
case ((Offset3D
forall a. Zero a => a
zero, Offset3D
forall a. Zero a => a
zero)) of
(e0 :: Offset3D
e0, e1 :: Offset3D
e1) -> do
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr Offset3D
pSrcOffsets' :: Ptr Offset3D) (Offset3D
e0) (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
$ ())
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr Offset3D
pSrcOffsets' Ptr Offset3D -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Offset3D) (Offset3D
e1) (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
$ ())
((() -> 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 ImageSubresourceLayers
-> ImageSubresourceLayers -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr ImageBlit2KHR
p Ptr ImageBlit2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
forall a. Zero a => a
zero) (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
$ ())
let pDstOffsets' :: Ptr Offset3D
pDstOffsets' = Ptr (FixedArray 2 Offset3D) -> Ptr Offset3D
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr ImageBlit2KHR
p Ptr ImageBlit2KHR -> Int -> Ptr (FixedArray 2 Offset3D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr (FixedArray 2 Offset3D)))
case ((Offset3D
forall a. Zero a => a
zero, Offset3D
forall a. Zero a => a
zero)) of
(e0 :: Offset3D
e0, e1 :: Offset3D
e1) -> do
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr Offset3D
pDstOffsets' :: Ptr Offset3D) (Offset3D
e0) (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
$ ())
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr Offset3D
pDstOffsets' Ptr Offset3D -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Offset3D) (Offset3D
e1) (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
$ ())
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 ImageBlit2KHR where
peekCStruct :: Ptr ImageBlit2KHR -> IO ImageBlit2KHR
peekCStruct p :: Ptr ImageBlit2KHR
p = do
ImageSubresourceLayers
srcSubresource <- Ptr ImageSubresourceLayers -> IO ImageSubresourceLayers
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresourceLayers ((Ptr ImageBlit2KHR
p Ptr ImageBlit2KHR -> 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
p Ptr ImageBlit2KHR -> 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
p Ptr ImageBlit2KHR -> 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
p Ptr ImageBlit2KHR -> 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 -> IO ImageBlit2KHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ImageBlit2KHR -> IO ImageBlit2KHR)
-> ImageBlit2KHR -> IO ImageBlit2KHR
forall a b. (a -> b) -> a -> b
$ ImageSubresourceLayers
-> (Offset3D, Offset3D)
-> ImageSubresourceLayers
-> (Offset3D, Offset3D)
-> ImageBlit2KHR
ImageBlit2KHR
ImageSubresourceLayers
srcSubresource ((Offset3D
srcOffsets0, Offset3D
srcOffsets1)) ImageSubresourceLayers
dstSubresource ((Offset3D
dstOffsets0, Offset3D
dstOffsets1))
instance Zero ImageBlit2KHR where
zero :: ImageBlit2KHR
zero = ImageSubresourceLayers
-> (Offset3D, Offset3D)
-> ImageSubresourceLayers
-> (Offset3D, Offset3D)
-> ImageBlit2KHR
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)
data BufferImageCopy2KHR = BufferImageCopy2KHR
{
BufferImageCopy2KHR -> DeviceSize
bufferOffset :: DeviceSize
,
BufferImageCopy2KHR -> Word32
bufferRowLength :: Word32
,
BufferImageCopy2KHR -> Word32
bufferImageHeight :: Word32
,
BufferImageCopy2KHR -> ImageSubresourceLayers
imageSubresource :: ImageSubresourceLayers
,
BufferImageCopy2KHR -> Offset3D
imageOffset :: Offset3D
,
BufferImageCopy2KHR -> Extent3D
imageExtent :: Extent3D
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BufferImageCopy2KHR)
#endif
deriving instance Show BufferImageCopy2KHR
instance ToCStruct BufferImageCopy2KHR where
withCStruct :: BufferImageCopy2KHR -> (Ptr BufferImageCopy2KHR -> IO b) -> IO b
withCStruct x :: BufferImageCopy2KHR
x f :: Ptr BufferImageCopy2KHR -> IO b
f = Int -> Int -> (Ptr BufferImageCopy2KHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 72 8 ((Ptr BufferImageCopy2KHR -> IO b) -> IO b)
-> (Ptr BufferImageCopy2KHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr BufferImageCopy2KHR
p -> Ptr BufferImageCopy2KHR -> BufferImageCopy2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BufferImageCopy2KHR
p BufferImageCopy2KHR
x (Ptr BufferImageCopy2KHR -> IO b
f Ptr BufferImageCopy2KHR
p)
pokeCStruct :: Ptr BufferImageCopy2KHR -> BufferImageCopy2KHR -> IO b -> IO b
pokeCStruct p :: Ptr BufferImageCopy2KHR
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
p Ptr BufferImageCopy2KHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_IMAGE_COPY_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 ((Ptr BufferImageCopy2KHR
p Ptr BufferImageCopy2KHR -> 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 DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferImageCopy2KHR
p Ptr BufferImageCopy2KHR -> 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
p Ptr BufferImageCopy2KHR -> 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
p Ptr BufferImageCopy2KHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32)) (Word32
bufferImageHeight)
((() -> 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 ImageSubresourceLayers
-> ImageSubresourceLayers -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr BufferImageCopy2KHR
p Ptr BufferImageCopy2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
imageSubresource) (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
$ ())
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr BufferImageCopy2KHR
p Ptr BufferImageCopy2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Offset3D)) (Offset3D
imageOffset) (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
$ ())
((() -> 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 Extent3D -> Extent3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr BufferImageCopy2KHR
p Ptr BufferImageCopy2KHR -> Int -> Ptr Extent3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Extent3D)) (Extent3D
imageExtent) (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
$ ())
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 -> IO b -> IO b
pokeZeroCStruct p :: Ptr BufferImageCopy2KHR
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
p Ptr BufferImageCopy2KHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_IMAGE_COPY_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 ((Ptr BufferImageCopy2KHR
p Ptr BufferImageCopy2KHR -> 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 DeviceSize -> DeviceSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferImageCopy2KHR
p Ptr BufferImageCopy2KHR -> 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
p Ptr BufferImageCopy2KHR -> 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
p Ptr BufferImageCopy2KHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
((() -> 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 ImageSubresourceLayers
-> ImageSubresourceLayers -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr BufferImageCopy2KHR
p Ptr BufferImageCopy2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
forall a. Zero a => a
zero) (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
$ ())
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr BufferImageCopy2KHR
p Ptr BufferImageCopy2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Offset3D)) (Offset3D
forall a. Zero a => a
zero) (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
$ ())
((() -> 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 Extent3D -> Extent3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr BufferImageCopy2KHR
p Ptr BufferImageCopy2KHR -> Int -> Ptr Extent3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Extent3D)) (Extent3D
forall a. Zero a => a
zero) (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
$ ())
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 BufferImageCopy2KHR where
peekCStruct :: Ptr BufferImageCopy2KHR -> IO BufferImageCopy2KHR
peekCStruct p :: Ptr BufferImageCopy2KHR
p = do
DeviceSize
bufferOffset <- Ptr DeviceSize -> IO DeviceSize
forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr BufferImageCopy2KHR
p Ptr BufferImageCopy2KHR -> 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
p Ptr BufferImageCopy2KHR -> 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
p Ptr BufferImageCopy2KHR -> 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
p Ptr BufferImageCopy2KHR -> 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
p Ptr BufferImageCopy2KHR -> 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
p Ptr BufferImageCopy2KHR -> Int -> Ptr Extent3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Extent3D))
BufferImageCopy2KHR -> IO BufferImageCopy2KHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (BufferImageCopy2KHR -> IO BufferImageCopy2KHR)
-> BufferImageCopy2KHR -> IO BufferImageCopy2KHR
forall a b. (a -> b) -> a -> b
$ DeviceSize
-> Word32
-> Word32
-> ImageSubresourceLayers
-> Offset3D
-> Extent3D
-> BufferImageCopy2KHR
BufferImageCopy2KHR
DeviceSize
bufferOffset Word32
bufferRowLength Word32
bufferImageHeight ImageSubresourceLayers
imageSubresource Offset3D
imageOffset Extent3D
imageExtent
instance Zero BufferImageCopy2KHR where
zero :: BufferImageCopy2KHR
zero = DeviceSize
-> Word32
-> Word32
-> ImageSubresourceLayers
-> Offset3D
-> Extent3D
-> BufferImageCopy2KHR
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
data ImageResolve2KHR = ImageResolve2KHR
{
ImageResolve2KHR -> ImageSubresourceLayers
srcSubresource :: ImageSubresourceLayers
,
ImageResolve2KHR -> Offset3D
srcOffset :: Offset3D
,
ImageResolve2KHR -> ImageSubresourceLayers
dstSubresource :: ImageSubresourceLayers
,
ImageResolve2KHR -> Offset3D
dstOffset :: Offset3D
,
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 = 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 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)
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 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)
((() -> 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 ImageSubresourceLayers
-> ImageSubresourceLayers -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
srcSubresource) (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
$ ())
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Offset3D)) (Offset3D
srcOffset) (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
$ ())
((() -> 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 ImageSubresourceLayers
-> ImageSubresourceLayers -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
dstSubresource) (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
$ ())
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Offset3D)) (Offset3D
dstOffset) (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
$ ())
((() -> 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 Extent3D -> Extent3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr ImageResolve2KHR
p Ptr ImageResolve2KHR -> Int -> Ptr Extent3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr Extent3D)) (Extent3D
extent) (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
$ ())
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 = 88
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr ImageResolve2KHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr ImageResolve2KHR
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 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)
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 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)
((() -> 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 ImageSubresourceLayers
-> ImageSubresourceLayers -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((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) (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
$ ())
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((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) (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
$ ())
((() -> 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 ImageSubresourceLayers
-> ImageSubresourceLayers -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((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) (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
$ ())
((() -> 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 Offset3D -> Offset3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((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) (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
$ ())
((() -> 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 Extent3D -> Extent3D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((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 -> 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
$ ())
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 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 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
data CopyBufferInfo2KHR = CopyBufferInfo2KHR
{
CopyBufferInfo2KHR -> Buffer
srcBuffer :: Buffer
,
CopyBufferInfo2KHR -> Buffer
dstBuffer :: Buffer
,
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
(Int -> BufferCopy2KHR -> ContT b IO ())
-> Vector BufferCopy2KHR -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: BufferCopy2KHR
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 BufferCopy2KHR -> BufferCopy2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (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) (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 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
(Int -> BufferCopy2KHR -> ContT b IO ())
-> Vector BufferCopy2KHR -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: BufferCopy2KHR
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 BufferCopy2KHR -> BufferCopy2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (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) (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 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
data CopyImageInfo2KHR = CopyImageInfo2KHR
{
CopyImageInfo2KHR -> Image
srcImage :: Image
,
CopyImageInfo2KHR -> ImageLayout
srcImageLayout :: ImageLayout
,
CopyImageInfo2KHR -> Image
dstImage :: Image
,
CopyImageInfo2KHR -> ImageLayout
dstImageLayout :: ImageLayout
,
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
(Int -> ImageCopy2KHR -> ContT b IO ())
-> Vector ImageCopy2KHR -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: ImageCopy2KHR
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 ImageCopy2KHR -> ImageCopy2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (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) (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 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
(Int -> ImageCopy2KHR -> ContT b IO ())
-> Vector ImageCopy2KHR -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: ImageCopy2KHR
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 ImageCopy2KHR -> ImageCopy2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (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) (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 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
data BlitImageInfo2KHR = BlitImageInfo2KHR
{
BlitImageInfo2KHR -> Image
srcImage :: Image
,
BlitImageInfo2KHR -> ImageLayout
srcImageLayout :: ImageLayout
,
BlitImageInfo2KHR -> Image
dstImage :: Image
,
BlitImageInfo2KHR -> ImageLayout
dstImageLayout :: ImageLayout
,
BlitImageInfo2KHR -> Vector ImageBlit2KHR
regions :: Vector ImageBlit2KHR
,
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 ImageBlit2KHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ImageBlit2KHR -> Int) -> Vector ImageBlit2KHR -> Int
forall a b. (a -> b) -> a -> b
$ (Vector ImageBlit2KHR
regions)) :: Word32))
Ptr ImageBlit2KHR
pPRegions' <- ((Ptr ImageBlit2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr ImageBlit2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ImageBlit2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr ImageBlit2KHR))
-> ((Ptr ImageBlit2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr ImageBlit2KHR)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ImageBlit2KHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @ImageBlit2KHR ((Vector ImageBlit2KHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ImageBlit2KHR
regions)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 96) 8
(Int -> ImageBlit2KHR -> ContT b IO ())
-> Vector ImageBlit2KHR -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: 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 ImageBlit2KHR -> ImageBlit2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr ImageBlit2KHR
pPRegions' Ptr ImageBlit2KHR -> 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) (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 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) -> Ptr ImageBlit2KHR -> 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
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
pPRegions' <- ((Ptr ImageBlit2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr ImageBlit2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ImageBlit2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr ImageBlit2KHR))
-> ((Ptr ImageBlit2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr ImageBlit2KHR)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ImageBlit2KHR -> 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 -> ImageBlit2KHR -> ContT b IO ())
-> Vector ImageBlit2KHR -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: 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 ImageBlit2KHR -> ImageBlit2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr ImageBlit2KHR
pPRegions' Ptr ImageBlit2KHR -> 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) (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 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) -> Ptr ImageBlit2KHR -> 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
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
pRegions <- Ptr (Ptr ImageBlit2KHR) -> IO (Ptr ImageBlit2KHR)
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 ImageBlit2KHR
pRegions' <- Int -> (Int -> IO ImageBlit2KHR) -> IO (Vector 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 ImageBlit2KHR -> IO ImageBlit2KHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageBlit2KHR ((Ptr ImageBlit2KHR
pRegions Ptr ImageBlit2KHR -> Int -> Ptr ImageBlit2KHR
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 ImageBlit2KHR
-> Filter
-> BlitImageInfo2KHR
BlitImageInfo2KHR
Image
srcImage ImageLayout
srcImageLayout Image
dstImage ImageLayout
dstImageLayout Vector ImageBlit2KHR
pRegions' Filter
filter'
instance Zero BlitImageInfo2KHR where
zero :: BlitImageInfo2KHR
zero = Image
-> ImageLayout
-> Image
-> ImageLayout
-> Vector 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 ImageBlit2KHR
forall a. Monoid a => a
mempty
Filter
forall a. Zero a => a
zero
data CopyBufferToImageInfo2KHR = CopyBufferToImageInfo2KHR
{
CopyBufferToImageInfo2KHR -> Buffer
srcBuffer :: Buffer
,
CopyBufferToImageInfo2KHR -> Image
dstImage :: Image
,
CopyBufferToImageInfo2KHR -> ImageLayout
dstImageLayout :: ImageLayout
,
CopyBufferToImageInfo2KHR -> Vector BufferImageCopy2KHR
regions :: Vector 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 BufferImageCopy2KHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector BufferImageCopy2KHR -> Int)
-> Vector BufferImageCopy2KHR -> Int
forall a b. (a -> b) -> a -> b
$ (Vector BufferImageCopy2KHR
regions)) :: Word32))
Ptr BufferImageCopy2KHR
pPRegions' <- ((Ptr BufferImageCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr BufferImageCopy2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr BufferImageCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr BufferImageCopy2KHR))
-> ((Ptr BufferImageCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr BufferImageCopy2KHR)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr BufferImageCopy2KHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @BufferImageCopy2KHR ((Vector BufferImageCopy2KHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector BufferImageCopy2KHR
regions)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 72) 8
(Int -> BufferImageCopy2KHR -> ContT b IO ())
-> Vector BufferImageCopy2KHR -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: 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 BufferImageCopy2KHR -> BufferImageCopy2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr BufferImageCopy2KHR
pPRegions' Ptr BufferImageCopy2KHR -> 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) (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 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) -> Ptr BufferImageCopy2KHR -> 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
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
pPRegions' <- ((Ptr BufferImageCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr BufferImageCopy2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr BufferImageCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr BufferImageCopy2KHR))
-> ((Ptr BufferImageCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr BufferImageCopy2KHR)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr BufferImageCopy2KHR -> 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 -> BufferImageCopy2KHR -> ContT b IO ())
-> Vector BufferImageCopy2KHR -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: 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 BufferImageCopy2KHR -> BufferImageCopy2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr BufferImageCopy2KHR
pPRegions' Ptr BufferImageCopy2KHR -> 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) (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 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) -> Ptr BufferImageCopy2KHR -> 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
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
pRegions <- Ptr (Ptr BufferImageCopy2KHR) -> IO (Ptr BufferImageCopy2KHR)
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 BufferImageCopy2KHR
pRegions' <- Int
-> (Int -> IO BufferImageCopy2KHR)
-> IO (Vector 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 BufferImageCopy2KHR -> IO BufferImageCopy2KHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @BufferImageCopy2KHR ((Ptr BufferImageCopy2KHR
pRegions Ptr BufferImageCopy2KHR -> Int -> Ptr BufferImageCopy2KHR
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 BufferImageCopy2KHR
-> CopyBufferToImageInfo2KHR
CopyBufferToImageInfo2KHR
Buffer
srcBuffer Image
dstImage ImageLayout
dstImageLayout Vector BufferImageCopy2KHR
pRegions'
instance Zero CopyBufferToImageInfo2KHR where
zero :: CopyBufferToImageInfo2KHR
zero = Buffer
-> Image
-> ImageLayout
-> Vector 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 BufferImageCopy2KHR
forall a. Monoid a => a
mempty
data CopyImageToBufferInfo2KHR = CopyImageToBufferInfo2KHR
{
CopyImageToBufferInfo2KHR -> Image
srcImage :: Image
,
CopyImageToBufferInfo2KHR -> ImageLayout
srcImageLayout :: ImageLayout
,
CopyImageToBufferInfo2KHR -> Buffer
dstBuffer :: Buffer
,
CopyImageToBufferInfo2KHR -> Vector BufferImageCopy2KHR
regions :: Vector 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 BufferImageCopy2KHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector BufferImageCopy2KHR -> Int)
-> Vector BufferImageCopy2KHR -> Int
forall a b. (a -> b) -> a -> b
$ (Vector BufferImageCopy2KHR
regions)) :: Word32))
Ptr BufferImageCopy2KHR
pPRegions' <- ((Ptr BufferImageCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr BufferImageCopy2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr BufferImageCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr BufferImageCopy2KHR))
-> ((Ptr BufferImageCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr BufferImageCopy2KHR)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr BufferImageCopy2KHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @BufferImageCopy2KHR ((Vector BufferImageCopy2KHR -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector BufferImageCopy2KHR
regions)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 72) 8
(Int -> BufferImageCopy2KHR -> ContT b IO ())
-> Vector BufferImageCopy2KHR -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: 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 BufferImageCopy2KHR -> BufferImageCopy2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr BufferImageCopy2KHR
pPRegions' Ptr BufferImageCopy2KHR -> 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) (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 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) -> Ptr BufferImageCopy2KHR -> 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
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
pPRegions' <- ((Ptr BufferImageCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr BufferImageCopy2KHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr BufferImageCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr BufferImageCopy2KHR))
-> ((Ptr BufferImageCopy2KHR -> IO b) -> IO b)
-> ContT b IO (Ptr BufferImageCopy2KHR)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr BufferImageCopy2KHR -> 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 -> BufferImageCopy2KHR -> ContT b IO ())
-> Vector BufferImageCopy2KHR -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: 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 BufferImageCopy2KHR -> BufferImageCopy2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr BufferImageCopy2KHR
pPRegions' Ptr BufferImageCopy2KHR -> 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) (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 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) -> Ptr BufferImageCopy2KHR -> 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
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
pRegions <- Ptr (Ptr BufferImageCopy2KHR) -> IO (Ptr BufferImageCopy2KHR)
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 BufferImageCopy2KHR
pRegions' <- Int
-> (Int -> IO BufferImageCopy2KHR)
-> IO (Vector 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 BufferImageCopy2KHR -> IO BufferImageCopy2KHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @BufferImageCopy2KHR ((Ptr BufferImageCopy2KHR
pRegions Ptr BufferImageCopy2KHR -> Int -> Ptr BufferImageCopy2KHR
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 BufferImageCopy2KHR
-> CopyImageToBufferInfo2KHR
CopyImageToBufferInfo2KHR
Image
srcImage ImageLayout
srcImageLayout Buffer
dstBuffer Vector BufferImageCopy2KHR
pRegions'
instance Zero CopyImageToBufferInfo2KHR where
zero :: CopyImageToBufferInfo2KHR
zero = Image
-> ImageLayout
-> Buffer
-> Vector 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 BufferImageCopy2KHR
forall a. Monoid a => a
mempty
data ResolveImageInfo2KHR = ResolveImageInfo2KHR
{
ResolveImageInfo2KHR -> Image
srcImage :: Image
,
ResolveImageInfo2KHR -> ImageLayout
srcImageLayout :: ImageLayout
,
ResolveImageInfo2KHR -> Image
dstImage :: Image
,
ResolveImageInfo2KHR -> ImageLayout
dstImageLayout :: ImageLayout
,
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
(Int -> ImageResolve2KHR -> ContT b IO ())
-> Vector ImageResolve2KHR -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: ImageResolve2KHR
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 ImageResolve2KHR -> ImageResolve2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (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) (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 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
(Int -> ImageResolve2KHR -> ContT b IO ())
-> Vector ImageResolve2KHR -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: ImageResolve2KHR
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 ImageResolve2KHR -> ImageResolve2KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (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) (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 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
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"
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"