{-# language CPP #-}
module Vulkan.Core13.Promoted_From_VK_KHR_copy_commands2 ( cmdCopyBuffer2
, cmdCopyImage2
, cmdBlitImage2
, cmdCopyBufferToImage2
, cmdCopyImageToBuffer2
, cmdResolveImage2
, BufferCopy2(..)
, ImageCopy2(..)
, ImageBlit2(..)
, BufferImageCopy2(..)
, ImageResolve2(..)
, CopyBufferInfo2(..)
, CopyImageInfo2(..)
, BlitImageInfo2(..)
, CopyBufferToImageInfo2(..)
, CopyImageToBufferInfo2(..)
, ResolveImageInfo2(..)
, StructureType(..)
) where
import Vulkan.CStruct.Utils (FixedArray)
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytes)
import GHC.IO (throwIO)
import GHC.Ptr (castPtr)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.Type.Equality ((:~:)(Refl))
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.CStruct.Utils (lowerArrayPtr)
import Vulkan.CStruct.Extends (peekSomeCStruct)
import Vulkan.CStruct.Extends (pokeSomeCStruct)
import {-# SOURCE #-} Vulkan.Extensions.VK_QCOM_filter_cubic_weights (BlitImageCubicWeightsInfoQCOM)
import Vulkan.Core10.Handles (Buffer)
import Vulkan.CStruct.Extends (Chain)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer(CommandBuffer))
import Vulkan.Core10.Handles (CommandBuffer_T)
import {-# SOURCE #-} Vulkan.Extensions.VK_QCOM_rotated_copy_commands (CopyCommandTransformInfoQCOM)
import Vulkan.Dynamic (DeviceCmds(pVkCmdBlitImage2))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyBuffer2))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyBufferToImage2))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyImage2))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyImageToBuffer2))
import Vulkan.Dynamic (DeviceCmds(pVkCmdResolveImage2))
import Vulkan.Core10.FundamentalTypes (DeviceSize)
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import Vulkan.Core10.FundamentalTypes (Extent3D)
import Vulkan.Core10.Enums.Filter (Filter)
import Vulkan.Core10.Handles (Image)
import Vulkan.Core10.Enums.ImageLayout (ImageLayout)
import Vulkan.Core10.CommandBufferBuilding (ImageSubresourceLayers)
import Vulkan.Core10.FundamentalTypes (Offset3D)
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PeekChain(..))
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BLIT_IMAGE_INFO_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BUFFER_COPY_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COPY_BUFFER_INFO_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COPY_IMAGE_INFO_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMAGE_BLIT_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMAGE_COPY_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMAGE_RESOLVE_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2))
import Vulkan.Core10.Enums.StructureType (StructureType(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdCopyBuffer2
:: FunPtr (Ptr CommandBuffer_T -> Ptr CopyBufferInfo2 -> IO ()) -> Ptr CommandBuffer_T -> Ptr CopyBufferInfo2 -> IO ()
cmdCopyBuffer2 :: forall io
. (MonadIO io)
=>
CommandBuffer
->
CopyBufferInfo2
-> io ()
cmdCopyBuffer2 :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer -> CopyBufferInfo2 -> io ()
cmdCopyBuffer2 CommandBuffer
commandBuffer CopyBufferInfo2
copyBufferInfo = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
let vkCmdCopyBuffer2Ptr :: FunPtr
(Ptr CommandBuffer_T
-> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2) -> IO ())
vkCmdCopyBuffer2Ptr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2) -> IO ())
pVkCmdCopyBuffer2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2) -> IO ())
vkCmdCopyBuffer2Ptr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdCopyBuffer2 is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCmdCopyBuffer2' :: Ptr CommandBuffer_T
-> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2) -> IO ()
vkCmdCopyBuffer2' = FunPtr
(Ptr CommandBuffer_T
-> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2) -> IO ())
-> Ptr CommandBuffer_T
-> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2)
-> IO ()
mkVkCmdCopyBuffer2 FunPtr
(Ptr CommandBuffer_T
-> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2) -> IO ())
vkCmdCopyBuffer2Ptr
"pCopyBufferInfo" ::: Ptr CopyBufferInfo2
pCopyBufferInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyBufferInfo2
copyBufferInfo)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdCopyBuffer2" (Ptr CommandBuffer_T
-> ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2) -> IO ()
vkCmdCopyBuffer2'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
"pCopyBufferInfo" ::: Ptr CopyBufferInfo2
pCopyBufferInfo)
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdCopyImage2
:: FunPtr (Ptr CommandBuffer_T -> Ptr CopyImageInfo2 -> IO ()) -> Ptr CommandBuffer_T -> Ptr CopyImageInfo2 -> IO ()
cmdCopyImage2 :: forall io
. (MonadIO io)
=>
CommandBuffer
->
CopyImageInfo2
-> io ()
cmdCopyImage2 :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer -> CopyImageInfo2 -> io ()
cmdCopyImage2 CommandBuffer
commandBuffer CopyImageInfo2
copyImageInfo = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
let vkCmdCopyImage2Ptr :: FunPtr
(Ptr CommandBuffer_T
-> ("pCopyImageInfo" ::: Ptr CopyImageInfo2) -> IO ())
vkCmdCopyImage2Ptr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("pCopyImageInfo" ::: Ptr CopyImageInfo2) -> IO ())
pVkCmdCopyImage2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("pCopyImageInfo" ::: Ptr CopyImageInfo2) -> IO ())
vkCmdCopyImage2Ptr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdCopyImage2 is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCmdCopyImage2' :: Ptr CommandBuffer_T
-> ("pCopyImageInfo" ::: Ptr CopyImageInfo2) -> IO ()
vkCmdCopyImage2' = FunPtr
(Ptr CommandBuffer_T
-> ("pCopyImageInfo" ::: Ptr CopyImageInfo2) -> IO ())
-> Ptr CommandBuffer_T
-> ("pCopyImageInfo" ::: Ptr CopyImageInfo2)
-> IO ()
mkVkCmdCopyImage2 FunPtr
(Ptr CommandBuffer_T
-> ("pCopyImageInfo" ::: Ptr CopyImageInfo2) -> IO ())
vkCmdCopyImage2Ptr
"pCopyImageInfo" ::: Ptr CopyImageInfo2
pCopyImageInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyImageInfo2
copyImageInfo)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdCopyImage2" (Ptr CommandBuffer_T
-> ("pCopyImageInfo" ::: Ptr CopyImageInfo2) -> IO ()
vkCmdCopyImage2'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
"pCopyImageInfo" ::: Ptr CopyImageInfo2
pCopyImageInfo)
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdBlitImage2
:: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct BlitImageInfo2) -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct BlitImageInfo2) -> IO ()
cmdBlitImage2 :: forall a io
. (Extendss BlitImageInfo2 a, PokeChain a, MonadIO io)
=>
CommandBuffer
->
(BlitImageInfo2 a)
-> io ()
cmdBlitImage2 :: forall (a :: [*]) (io :: * -> *).
(Extendss BlitImageInfo2 a, PokeChain a, MonadIO io) =>
CommandBuffer -> BlitImageInfo2 a -> io ()
cmdBlitImage2 CommandBuffer
commandBuffer BlitImageInfo2 a
blitImageInfo = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
let vkCmdBlitImage2Ptr :: FunPtr
(Ptr CommandBuffer_T
-> ("pBlitImageInfo" ::: Ptr (SomeStruct BlitImageInfo2)) -> IO ())
vkCmdBlitImage2Ptr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("pBlitImageInfo" ::: Ptr (SomeStruct BlitImageInfo2)) -> IO ())
pVkCmdBlitImage2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("pBlitImageInfo" ::: Ptr (SomeStruct BlitImageInfo2)) -> IO ())
vkCmdBlitImage2Ptr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdBlitImage2 is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCmdBlitImage2' :: Ptr CommandBuffer_T
-> ("pBlitImageInfo" ::: Ptr (SomeStruct BlitImageInfo2)) -> IO ()
vkCmdBlitImage2' = FunPtr
(Ptr CommandBuffer_T
-> ("pBlitImageInfo" ::: Ptr (SomeStruct BlitImageInfo2)) -> IO ())
-> Ptr CommandBuffer_T
-> ("pBlitImageInfo" ::: Ptr (SomeStruct BlitImageInfo2))
-> IO ()
mkVkCmdBlitImage2 FunPtr
(Ptr CommandBuffer_T
-> ("pBlitImageInfo" ::: Ptr (SomeStruct BlitImageInfo2)) -> IO ())
vkCmdBlitImage2Ptr
Ptr (BlitImageInfo2 a)
pBlitImageInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (BlitImageInfo2 a
blitImageInfo)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdBlitImage2" (Ptr CommandBuffer_T
-> ("pBlitImageInfo" ::: Ptr (SomeStruct BlitImageInfo2)) -> IO ()
vkCmdBlitImage2'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (BlitImageInfo2 a)
pBlitImageInfo))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdCopyBufferToImage2
:: FunPtr (Ptr CommandBuffer_T -> Ptr CopyBufferToImageInfo2 -> IO ()) -> Ptr CommandBuffer_T -> Ptr CopyBufferToImageInfo2 -> IO ()
cmdCopyBufferToImage2 :: forall io
. (MonadIO io)
=>
CommandBuffer
->
CopyBufferToImageInfo2
-> io ()
cmdCopyBufferToImage2 :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer -> CopyBufferToImageInfo2 -> io ()
cmdCopyBufferToImage2 CommandBuffer
commandBuffer
CopyBufferToImageInfo2
copyBufferToImageInfo = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
let vkCmdCopyBufferToImage2Ptr :: FunPtr
(Ptr CommandBuffer_T
-> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2)
-> IO ())
vkCmdCopyBufferToImage2Ptr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2)
-> IO ())
pVkCmdCopyBufferToImage2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2)
-> IO ())
vkCmdCopyBufferToImage2Ptr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdCopyBufferToImage2 is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCmdCopyBufferToImage2' :: Ptr CommandBuffer_T
-> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2)
-> IO ()
vkCmdCopyBufferToImage2' = FunPtr
(Ptr CommandBuffer_T
-> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2)
-> IO ())
-> Ptr CommandBuffer_T
-> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2)
-> IO ()
mkVkCmdCopyBufferToImage2 FunPtr
(Ptr CommandBuffer_T
-> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2)
-> IO ())
vkCmdCopyBufferToImage2Ptr
"pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
pCopyBufferToImageInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyBufferToImageInfo2
copyBufferToImageInfo)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdCopyBufferToImage2" (Ptr CommandBuffer_T
-> ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2)
-> IO ()
vkCmdCopyBufferToImage2'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
"pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
pCopyBufferToImageInfo)
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdCopyImageToBuffer2
:: FunPtr (Ptr CommandBuffer_T -> Ptr CopyImageToBufferInfo2 -> IO ()) -> Ptr CommandBuffer_T -> Ptr CopyImageToBufferInfo2 -> IO ()
cmdCopyImageToBuffer2 :: forall io
. (MonadIO io)
=>
CommandBuffer
->
CopyImageToBufferInfo2
-> io ()
cmdCopyImageToBuffer2 :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer -> CopyImageToBufferInfo2 -> io ()
cmdCopyImageToBuffer2 CommandBuffer
commandBuffer
CopyImageToBufferInfo2
copyImageToBufferInfo = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
let vkCmdCopyImageToBuffer2Ptr :: FunPtr
(Ptr CommandBuffer_T
-> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2)
-> IO ())
vkCmdCopyImageToBuffer2Ptr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2)
-> IO ())
pVkCmdCopyImageToBuffer2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2)
-> IO ())
vkCmdCopyImageToBuffer2Ptr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdCopyImageToBuffer2 is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCmdCopyImageToBuffer2' :: Ptr CommandBuffer_T
-> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2)
-> IO ()
vkCmdCopyImageToBuffer2' = FunPtr
(Ptr CommandBuffer_T
-> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2)
-> IO ())
-> Ptr CommandBuffer_T
-> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2)
-> IO ()
mkVkCmdCopyImageToBuffer2 FunPtr
(Ptr CommandBuffer_T
-> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2)
-> IO ())
vkCmdCopyImageToBuffer2Ptr
"pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
pCopyImageToBufferInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (CopyImageToBufferInfo2
copyImageToBufferInfo)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdCopyImageToBuffer2" (Ptr CommandBuffer_T
-> ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2)
-> IO ()
vkCmdCopyImageToBuffer2'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
"pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
pCopyImageToBufferInfo)
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdResolveImage2
:: FunPtr (Ptr CommandBuffer_T -> Ptr ResolveImageInfo2 -> IO ()) -> Ptr CommandBuffer_T -> Ptr ResolveImageInfo2 -> IO ()
cmdResolveImage2 :: forall io
. (MonadIO io)
=>
CommandBuffer
->
ResolveImageInfo2
-> io ()
cmdResolveImage2 :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer -> ResolveImageInfo2 -> io ()
cmdResolveImage2 CommandBuffer
commandBuffer ResolveImageInfo2
resolveImageInfo = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
let vkCmdResolveImage2Ptr :: FunPtr
(Ptr CommandBuffer_T
-> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2) -> IO ())
vkCmdResolveImage2Ptr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2) -> IO ())
pVkCmdResolveImage2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2) -> IO ())
vkCmdResolveImage2Ptr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdResolveImage2 is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCmdResolveImage2' :: Ptr CommandBuffer_T
-> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2) -> IO ()
vkCmdResolveImage2' = FunPtr
(Ptr CommandBuffer_T
-> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2) -> IO ())
-> Ptr CommandBuffer_T
-> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2)
-> IO ()
mkVkCmdResolveImage2 FunPtr
(Ptr CommandBuffer_T
-> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2) -> IO ())
vkCmdResolveImage2Ptr
"pResolveImageInfo" ::: Ptr ResolveImageInfo2
pResolveImageInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (ResolveImageInfo2
resolveImageInfo)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdResolveImage2" (Ptr CommandBuffer_T
-> ("pResolveImageInfo" ::: Ptr ResolveImageInfo2) -> IO ()
vkCmdResolveImage2'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
"pResolveImageInfo" ::: Ptr ResolveImageInfo2
pResolveImageInfo)
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
data BufferCopy2 = BufferCopy2
{
BufferCopy2 -> DeviceSize
srcOffset :: DeviceSize
,
BufferCopy2 -> DeviceSize
dstOffset :: DeviceSize
,
BufferCopy2 -> DeviceSize
size :: DeviceSize
}
deriving (Typeable, BufferCopy2 -> BufferCopy2 -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BufferCopy2 -> BufferCopy2 -> Bool
$c/= :: BufferCopy2 -> BufferCopy2 -> Bool
== :: BufferCopy2 -> BufferCopy2 -> Bool
$c== :: BufferCopy2 -> BufferCopy2 -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BufferCopy2)
#endif
deriving instance Show BufferCopy2
instance ToCStruct BufferCopy2 where
withCStruct :: forall b. BufferCopy2 -> (Ptr BufferCopy2 -> IO b) -> IO b
withCStruct BufferCopy2
x Ptr BufferCopy2 -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 forall a b. (a -> b) -> a -> b
$ \Ptr BufferCopy2
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BufferCopy2
p BufferCopy2
x (Ptr BufferCopy2 -> IO b
f Ptr BufferCopy2
p)
pokeCStruct :: forall b. Ptr BufferCopy2 -> BufferCopy2 -> IO b -> IO b
pokeCStruct Ptr BufferCopy2
p BufferCopy2{DeviceSize
size :: DeviceSize
dstOffset :: DeviceSize
srcOffset :: DeviceSize
$sel:size:BufferCopy2 :: BufferCopy2 -> DeviceSize
$sel:dstOffset:BufferCopy2 :: BufferCopy2 -> DeviceSize
$sel:srcOffset:BufferCopy2 :: BufferCopy2 -> DeviceSize
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_COPY_2)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (DeviceSize
srcOffset)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize)) (DeviceSize
dstOffset)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize)) (DeviceSize
size)
IO b
f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr BufferCopy2 -> IO b -> IO b
pokeZeroCStruct Ptr BufferCopy2
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_COPY_2)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct BufferCopy2 where
peekCStruct :: Ptr BufferCopy2 -> IO BufferCopy2
peekCStruct Ptr BufferCopy2
p = do
DeviceSize
srcOffset <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr BufferCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize))
DeviceSize
dstOffset <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr BufferCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize))
DeviceSize
size <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr BufferCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ DeviceSize -> DeviceSize -> DeviceSize -> BufferCopy2
BufferCopy2
DeviceSize
srcOffset DeviceSize
dstOffset DeviceSize
size
instance Storable BufferCopy2 where
sizeOf :: BufferCopy2 -> Int
sizeOf ~BufferCopy2
_ = Int
40
alignment :: BufferCopy2 -> Int
alignment ~BufferCopy2
_ = Int
8
peek :: Ptr BufferCopy2 -> IO BufferCopy2
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr BufferCopy2 -> BufferCopy2 -> IO ()
poke Ptr BufferCopy2
ptr BufferCopy2
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BufferCopy2
ptr BufferCopy2
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero BufferCopy2 where
zero :: BufferCopy2
zero = DeviceSize -> DeviceSize -> DeviceSize -> BufferCopy2
BufferCopy2
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data ImageCopy2 = ImageCopy2
{
ImageCopy2 -> ImageSubresourceLayers
srcSubresource :: ImageSubresourceLayers
,
ImageCopy2 -> Offset3D
srcOffset :: Offset3D
,
ImageCopy2 -> ImageSubresourceLayers
dstSubresource :: ImageSubresourceLayers
,
ImageCopy2 -> Offset3D
dstOffset :: Offset3D
,
ImageCopy2 -> Extent3D
extent :: Extent3D
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImageCopy2)
#endif
deriving instance Show ImageCopy2
instance ToCStruct ImageCopy2 where
withCStruct :: forall b. ImageCopy2 -> (Ptr ImageCopy2 -> IO b) -> IO b
withCStruct ImageCopy2
x Ptr ImageCopy2 -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
88 forall a b. (a -> b) -> a -> b
$ \Ptr ImageCopy2
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageCopy2
p ImageCopy2
x (Ptr ImageCopy2 -> IO b
f Ptr ImageCopy2
p)
pokeCStruct :: forall b. Ptr ImageCopy2 -> ImageCopy2 -> IO b -> IO b
pokeCStruct Ptr ImageCopy2
p ImageCopy2{ImageSubresourceLayers
Offset3D
Extent3D
extent :: Extent3D
dstOffset :: Offset3D
dstSubresource :: ImageSubresourceLayers
srcOffset :: Offset3D
srcSubresource :: ImageSubresourceLayers
$sel:extent:ImageCopy2 :: ImageCopy2 -> Extent3D
$sel:dstOffset:ImageCopy2 :: ImageCopy2 -> Offset3D
$sel:dstSubresource:ImageCopy2 :: ImageCopy2 -> ImageSubresourceLayers
$sel:srcOffset:ImageCopy2 :: ImageCopy2 -> Offset3D
$sel:srcSubresource:ImageCopy2 :: ImageCopy2 -> ImageSubresourceLayers
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_COPY_2)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
srcSubresource)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Offset3D)) (Offset3D
srcOffset)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
dstSubresource)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr Offset3D)) (Offset3D
dstOffset)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Extent3D)) (Extent3D
extent)
IO b
f
cStructSize :: Int
cStructSize = Int
88
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr ImageCopy2 -> IO b -> IO b
pokeZeroCStruct Ptr ImageCopy2
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_COPY_2)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageSubresourceLayers)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Offset3D)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ImageSubresourceLayers)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr Offset3D)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Extent3D)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ImageCopy2 where
peekCStruct :: Ptr ImageCopy2 -> IO ImageCopy2
peekCStruct Ptr ImageCopy2
p = do
ImageSubresourceLayers
srcSubresource <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresourceLayers ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageSubresourceLayers))
Offset3D
srcOffset <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Offset3D))
ImageSubresourceLayers
dstSubresource <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresourceLayers ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ImageSubresourceLayers))
Offset3D
dstOffset <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr Offset3D))
Extent3D
extent <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent3D ((Ptr ImageCopy2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Extent3D))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ImageSubresourceLayers
-> Offset3D
-> ImageSubresourceLayers
-> Offset3D
-> Extent3D
-> ImageCopy2
ImageCopy2
ImageSubresourceLayers
srcSubresource Offset3D
srcOffset ImageSubresourceLayers
dstSubresource Offset3D
dstOffset Extent3D
extent
instance Storable ImageCopy2 where
sizeOf :: ImageCopy2 -> Int
sizeOf ~ImageCopy2
_ = Int
88
alignment :: ImageCopy2 -> Int
alignment ~ImageCopy2
_ = Int
8
peek :: Ptr ImageCopy2 -> IO ImageCopy2
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ImageCopy2 -> ImageCopy2 -> IO ()
poke Ptr ImageCopy2
ptr ImageCopy2
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageCopy2
ptr ImageCopy2
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ImageCopy2 where
zero :: ImageCopy2
zero = ImageSubresourceLayers
-> Offset3D
-> ImageSubresourceLayers
-> Offset3D
-> Extent3D
-> ImageCopy2
ImageCopy2
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data ImageBlit2 (es :: [Type]) = ImageBlit2
{
forall (es :: [*]). ImageBlit2 es -> Chain es
next :: Chain es
,
forall (es :: [*]). ImageBlit2 es -> ImageSubresourceLayers
srcSubresource :: ImageSubresourceLayers
,
forall (es :: [*]). ImageBlit2 es -> (Offset3D, Offset3D)
srcOffsets :: (Offset3D, Offset3D)
,
forall (es :: [*]). ImageBlit2 es -> ImageSubresourceLayers
dstSubresource :: ImageSubresourceLayers
,
forall (es :: [*]). ImageBlit2 es -> (Offset3D, Offset3D)
dstOffsets :: (Offset3D, Offset3D)
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImageBlit2 (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (ImageBlit2 es)
instance Extensible ImageBlit2 where
extensibleTypeName :: String
extensibleTypeName = String
"ImageBlit2"
setNext :: forall (ds :: [*]) (es :: [*]).
ImageBlit2 ds -> Chain es -> ImageBlit2 es
setNext ImageBlit2{(Offset3D, Offset3D)
Chain ds
ImageSubresourceLayers
dstOffsets :: (Offset3D, Offset3D)
dstSubresource :: ImageSubresourceLayers
srcOffsets :: (Offset3D, Offset3D)
srcSubresource :: ImageSubresourceLayers
next :: Chain ds
$sel:dstOffsets:ImageBlit2 :: forall (es :: [*]). ImageBlit2 es -> (Offset3D, Offset3D)
$sel:dstSubresource:ImageBlit2 :: forall (es :: [*]). ImageBlit2 es -> ImageSubresourceLayers
$sel:srcOffsets:ImageBlit2 :: forall (es :: [*]). ImageBlit2 es -> (Offset3D, Offset3D)
$sel:srcSubresource:ImageBlit2 :: forall (es :: [*]). ImageBlit2 es -> ImageSubresourceLayers
$sel:next:ImageBlit2 :: forall (es :: [*]). ImageBlit2 es -> Chain es
..} Chain es
next' = ImageBlit2{$sel:next:ImageBlit2 :: Chain es
next = Chain es
next', (Offset3D, Offset3D)
ImageSubresourceLayers
dstOffsets :: (Offset3D, Offset3D)
dstSubresource :: ImageSubresourceLayers
srcOffsets :: (Offset3D, Offset3D)
srcSubresource :: ImageSubresourceLayers
$sel:dstOffsets:ImageBlit2 :: (Offset3D, Offset3D)
$sel:dstSubresource:ImageBlit2 :: ImageSubresourceLayers
$sel:srcOffsets:ImageBlit2 :: (Offset3D, Offset3D)
$sel:srcSubresource:ImageBlit2 :: ImageSubresourceLayers
..}
getNext :: forall (es :: [*]). ImageBlit2 es -> Chain es
getNext ImageBlit2{(Offset3D, Offset3D)
Chain es
ImageSubresourceLayers
dstOffsets :: (Offset3D, Offset3D)
dstSubresource :: ImageSubresourceLayers
srcOffsets :: (Offset3D, Offset3D)
srcSubresource :: ImageSubresourceLayers
next :: Chain es
$sel:dstOffsets:ImageBlit2 :: forall (es :: [*]). ImageBlit2 es -> (Offset3D, Offset3D)
$sel:dstSubresource:ImageBlit2 :: forall (es :: [*]). ImageBlit2 es -> ImageSubresourceLayers
$sel:srcOffsets:ImageBlit2 :: forall (es :: [*]). ImageBlit2 es -> (Offset3D, Offset3D)
$sel:srcSubresource:ImageBlit2 :: forall (es :: [*]). ImageBlit2 es -> ImageSubresourceLayers
$sel:next:ImageBlit2 :: forall (es :: [*]). ImageBlit2 es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends ImageBlit2 e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends ImageBlit2 e => b) -> Maybe b
extends proxy e
_ Extends ImageBlit2 e => b
f
| Just e :~: CopyCommandTransformInfoQCOM
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @CopyCommandTransformInfoQCOM = forall a. a -> Maybe a
Just Extends ImageBlit2 e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss ImageBlit2 es
, PokeChain es ) => ToCStruct (ImageBlit2 es) where
withCStruct :: forall b. ImageBlit2 es -> (Ptr (ImageBlit2 es) -> IO b) -> IO b
withCStruct ImageBlit2 es
x Ptr (ImageBlit2 es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
96 forall a b. (a -> b) -> a -> b
$ \Ptr (ImageBlit2 es)
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (ImageBlit2 es)
p ImageBlit2 es
x (Ptr (ImageBlit2 es) -> IO b
f Ptr (ImageBlit2 es)
p)
pokeCStruct :: forall b. Ptr (ImageBlit2 es) -> ImageBlit2 es -> IO b -> IO b
pokeCStruct Ptr (ImageBlit2 es)
p ImageBlit2{(Offset3D, Offset3D)
Chain es
ImageSubresourceLayers
dstOffsets :: (Offset3D, Offset3D)
dstSubresource :: ImageSubresourceLayers
srcOffsets :: (Offset3D, Offset3D)
srcSubresource :: ImageSubresourceLayers
next :: Chain es
$sel:dstOffsets:ImageBlit2 :: forall (es :: [*]). ImageBlit2 es -> (Offset3D, Offset3D)
$sel:dstSubresource:ImageBlit2 :: forall (es :: [*]). ImageBlit2 es -> ImageSubresourceLayers
$sel:srcOffsets:ImageBlit2 :: forall (es :: [*]). ImageBlit2 es -> (Offset3D, Offset3D)
$sel:srcSubresource:ImageBlit2 :: forall (es :: [*]). ImageBlit2 es -> ImageSubresourceLayers
$sel:next:ImageBlit2 :: forall (es :: [*]). ImageBlit2 es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageBlit2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_BLIT_2)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageBlit2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageBlit2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
srcSubresource)
let pSrcOffsets' :: Ptr Offset3D
pSrcOffsets' = forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr (ImageBlit2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (FixedArray 2 Offset3D)))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ case ((Offset3D, Offset3D)
srcOffsets) of
(Offset3D
e0, Offset3D
e1) -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset3D
pSrcOffsets' :: Ptr Offset3D) (Offset3D
e0)
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset3D
pSrcOffsets' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr Offset3D) (Offset3D
e1)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageBlit2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
dstSubresource)
let pDstOffsets' :: Ptr Offset3D
pDstOffsets' = forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr (ImageBlit2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr (FixedArray 2 Offset3D)))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ case ((Offset3D, Offset3D)
dstOffsets) of
(Offset3D
e0, Offset3D
e1) -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset3D
pDstOffsets' :: Ptr Offset3D) (Offset3D
e0)
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset3D
pDstOffsets' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr Offset3D) (Offset3D
e1)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
96
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (ImageBlit2 es) -> IO b -> IO b
pokeZeroCStruct Ptr (ImageBlit2 es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageBlit2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_BLIT_2)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageBlit2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageBlit2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageSubresourceLayers)) (forall a. Zero a => a
zero)
let pSrcOffsets' :: Ptr Offset3D
pSrcOffsets' = forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr (ImageBlit2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (FixedArray 2 Offset3D)))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ case ((forall a. Zero a => a
zero, forall a. Zero a => a
zero)) of
(Offset3D
e0, Offset3D
e1) -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset3D
pSrcOffsets' :: Ptr Offset3D) (Offset3D
e0)
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset3D
pSrcOffsets' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr Offset3D) (Offset3D
e1)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (ImageBlit2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr ImageSubresourceLayers)) (forall a. Zero a => a
zero)
let pDstOffsets' :: Ptr Offset3D
pDstOffsets' = forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr (ImageBlit2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr (FixedArray 2 Offset3D)))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ case ((forall a. Zero a => a
zero, forall a. Zero a => a
zero)) of
(Offset3D
e0, Offset3D
e1) -> do
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset3D
pDstOffsets' :: Ptr Offset3D) (Offset3D
e0)
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset3D
pDstOffsets' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr Offset3D) (Offset3D
e1)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
instance ( Extendss ImageBlit2 es
, PeekChain es ) => FromCStruct (ImageBlit2 es) where
peekCStruct :: Ptr (ImageBlit2 es) -> IO (ImageBlit2 es)
peekCStruct Ptr (ImageBlit2 es)
p = do
Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (ImageBlit2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
ImageSubresourceLayers
srcSubresource <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresourceLayers ((Ptr (ImageBlit2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageSubresourceLayers))
let psrcOffsets :: Ptr Offset3D
psrcOffsets = forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr @Offset3D ((Ptr (ImageBlit2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (FixedArray 2 Offset3D)))
Offset3D
srcOffsets0 <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr Offset3D
psrcOffsets forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` Int
0 :: Ptr Offset3D))
Offset3D
srcOffsets1 <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr Offset3D
psrcOffsets forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` Int
12 :: Ptr Offset3D))
ImageSubresourceLayers
dstSubresource <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresourceLayers ((Ptr (ImageBlit2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr ImageSubresourceLayers))
let pdstOffsets :: Ptr Offset3D
pdstOffsets = forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr @Offset3D ((Ptr (ImageBlit2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr (FixedArray 2 Offset3D)))
Offset3D
dstOffsets0 <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr Offset3D
pdstOffsets forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` Int
0 :: Ptr Offset3D))
Offset3D
dstOffsets1 <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr Offset3D
pdstOffsets forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` Int
12 :: Ptr Offset3D))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]).
Chain es
-> ImageSubresourceLayers
-> (Offset3D, Offset3D)
-> ImageSubresourceLayers
-> (Offset3D, Offset3D)
-> ImageBlit2 es
ImageBlit2
Chain es
next
ImageSubresourceLayers
srcSubresource
((Offset3D
srcOffsets0, Offset3D
srcOffsets1))
ImageSubresourceLayers
dstSubresource
((Offset3D
dstOffsets0, Offset3D
dstOffsets1))
instance es ~ '[] => Zero (ImageBlit2 es) where
zero :: ImageBlit2 es
zero = forall (es :: [*]).
Chain es
-> ImageSubresourceLayers
-> (Offset3D, Offset3D)
-> ImageSubresourceLayers
-> (Offset3D, Offset3D)
-> ImageBlit2 es
ImageBlit2
()
forall a. Zero a => a
zero
(forall a. Zero a => a
zero, forall a. Zero a => a
zero)
forall a. Zero a => a
zero
(forall a. Zero a => a
zero, forall a. Zero a => a
zero)
data BufferImageCopy2 (es :: [Type]) = BufferImageCopy2
{
forall (es :: [*]). BufferImageCopy2 es -> Chain es
next :: Chain es
,
forall (es :: [*]). BufferImageCopy2 es -> DeviceSize
bufferOffset :: DeviceSize
,
forall (es :: [*]). BufferImageCopy2 es -> Word32
bufferRowLength :: Word32
,
forall (es :: [*]). BufferImageCopy2 es -> Word32
bufferImageHeight :: Word32
,
forall (es :: [*]). BufferImageCopy2 es -> ImageSubresourceLayers
imageSubresource :: ImageSubresourceLayers
,
forall (es :: [*]). BufferImageCopy2 es -> Offset3D
imageOffset :: Offset3D
,
forall (es :: [*]). BufferImageCopy2 es -> Extent3D
imageExtent :: Extent3D
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BufferImageCopy2 (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (BufferImageCopy2 es)
instance Extensible BufferImageCopy2 where
extensibleTypeName :: String
extensibleTypeName = String
"BufferImageCopy2"
setNext :: forall (ds :: [*]) (es :: [*]).
BufferImageCopy2 ds -> Chain es -> BufferImageCopy2 es
setNext BufferImageCopy2{Word32
DeviceSize
Chain ds
ImageSubresourceLayers
Offset3D
Extent3D
imageExtent :: Extent3D
imageOffset :: Offset3D
imageSubresource :: ImageSubresourceLayers
bufferImageHeight :: Word32
bufferRowLength :: Word32
bufferOffset :: DeviceSize
next :: Chain ds
$sel:imageExtent:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> Extent3D
$sel:imageOffset:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> Offset3D
$sel:imageSubresource:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> ImageSubresourceLayers
$sel:bufferImageHeight:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> Word32
$sel:bufferRowLength:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> Word32
$sel:bufferOffset:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> DeviceSize
$sel:next:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> Chain es
..} Chain es
next' = BufferImageCopy2{$sel:next:BufferImageCopy2 :: Chain es
next = Chain es
next', Word32
DeviceSize
ImageSubresourceLayers
Offset3D
Extent3D
imageExtent :: Extent3D
imageOffset :: Offset3D
imageSubresource :: ImageSubresourceLayers
bufferImageHeight :: Word32
bufferRowLength :: Word32
bufferOffset :: DeviceSize
$sel:imageExtent:BufferImageCopy2 :: Extent3D
$sel:imageOffset:BufferImageCopy2 :: Offset3D
$sel:imageSubresource:BufferImageCopy2 :: ImageSubresourceLayers
$sel:bufferImageHeight:BufferImageCopy2 :: Word32
$sel:bufferRowLength:BufferImageCopy2 :: Word32
$sel:bufferOffset:BufferImageCopy2 :: DeviceSize
..}
getNext :: forall (es :: [*]). BufferImageCopy2 es -> Chain es
getNext BufferImageCopy2{Word32
DeviceSize
Chain es
ImageSubresourceLayers
Offset3D
Extent3D
imageExtent :: Extent3D
imageOffset :: Offset3D
imageSubresource :: ImageSubresourceLayers
bufferImageHeight :: Word32
bufferRowLength :: Word32
bufferOffset :: DeviceSize
next :: Chain es
$sel:imageExtent:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> Extent3D
$sel:imageOffset:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> Offset3D
$sel:imageSubresource:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> ImageSubresourceLayers
$sel:bufferImageHeight:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> Word32
$sel:bufferRowLength:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> Word32
$sel:bufferOffset:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> DeviceSize
$sel:next:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends BufferImageCopy2 e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends BufferImageCopy2 e => b) -> Maybe b
extends proxy e
_ Extends BufferImageCopy2 e => b
f
| Just e :~: CopyCommandTransformInfoQCOM
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @CopyCommandTransformInfoQCOM = forall a. a -> Maybe a
Just Extends BufferImageCopy2 e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss BufferImageCopy2 es
, PokeChain es ) => ToCStruct (BufferImageCopy2 es) where
withCStruct :: forall b.
BufferImageCopy2 es -> (Ptr (BufferImageCopy2 es) -> IO b) -> IO b
withCStruct BufferImageCopy2 es
x Ptr (BufferImageCopy2 es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
72 forall a b. (a -> b) -> a -> b
$ \Ptr (BufferImageCopy2 es)
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (BufferImageCopy2 es)
p BufferImageCopy2 es
x (Ptr (BufferImageCopy2 es) -> IO b
f Ptr (BufferImageCopy2 es)
p)
pokeCStruct :: forall b.
Ptr (BufferImageCopy2 es) -> BufferImageCopy2 es -> IO b -> IO b
pokeCStruct Ptr (BufferImageCopy2 es)
p BufferImageCopy2{Word32
DeviceSize
Chain es
ImageSubresourceLayers
Offset3D
Extent3D
imageExtent :: Extent3D
imageOffset :: Offset3D
imageSubresource :: ImageSubresourceLayers
bufferImageHeight :: Word32
bufferRowLength :: Word32
bufferOffset :: DeviceSize
next :: Chain es
$sel:imageExtent:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> Extent3D
$sel:imageOffset:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> Offset3D
$sel:imageSubresource:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> ImageSubresourceLayers
$sel:bufferImageHeight:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> Word32
$sel:bufferRowLength:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> Word32
$sel:bufferOffset:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> DeviceSize
$sel:next:BufferImageCopy2 :: forall (es :: [*]). BufferImageCopy2 es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (DeviceSize
bufferOffset)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Word32
bufferRowLength)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) (Word32
bufferImageHeight)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
imageSubresource)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Offset3D)) (Offset3D
imageOffset)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr Extent3D)) (Extent3D
imageExtent)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
72
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (BufferImageCopy2 es) -> IO b -> IO b
pokeZeroCStruct Ptr (BufferImageCopy2 es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr ImageSubresourceLayers)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Offset3D)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr Extent3D)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
instance ( Extendss BufferImageCopy2 es
, PeekChain es ) => FromCStruct (BufferImageCopy2 es) where
peekCStruct :: Ptr (BufferImageCopy2 es) -> IO (BufferImageCopy2 es)
peekCStruct Ptr (BufferImageCopy2 es)
p = do
Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
DeviceSize
bufferOffset <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize))
Word32
bufferRowLength <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
Word32
bufferImageHeight <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32))
ImageSubresourceLayers
imageSubresource <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresourceLayers ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr ImageSubresourceLayers))
Offset3D
imageOffset <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Offset3D))
Extent3D
imageExtent <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent3D ((Ptr (BufferImageCopy2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr Extent3D))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]).
Chain es
-> DeviceSize
-> Word32
-> Word32
-> ImageSubresourceLayers
-> Offset3D
-> Extent3D
-> BufferImageCopy2 es
BufferImageCopy2
Chain es
next
DeviceSize
bufferOffset
Word32
bufferRowLength
Word32
bufferImageHeight
ImageSubresourceLayers
imageSubresource
Offset3D
imageOffset
Extent3D
imageExtent
instance es ~ '[] => Zero (BufferImageCopy2 es) where
zero :: BufferImageCopy2 es
zero = forall (es :: [*]).
Chain es
-> DeviceSize
-> Word32
-> Word32
-> ImageSubresourceLayers
-> Offset3D
-> Extent3D
-> BufferImageCopy2 es
BufferImageCopy2
()
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data ImageResolve2 = ImageResolve2
{
ImageResolve2 -> ImageSubresourceLayers
srcSubresource :: ImageSubresourceLayers
,
ImageResolve2 -> Offset3D
srcOffset :: Offset3D
,
ImageResolve2 -> ImageSubresourceLayers
dstSubresource :: ImageSubresourceLayers
,
ImageResolve2 -> Offset3D
dstOffset :: Offset3D
,
ImageResolve2 -> Extent3D
extent :: Extent3D
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImageResolve2)
#endif
deriving instance Show ImageResolve2
instance ToCStruct ImageResolve2 where
withCStruct :: forall b. ImageResolve2 -> (Ptr ImageResolve2 -> IO b) -> IO b
withCStruct ImageResolve2
x Ptr ImageResolve2 -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
88 forall a b. (a -> b) -> a -> b
$ \Ptr ImageResolve2
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageResolve2
p ImageResolve2
x (Ptr ImageResolve2 -> IO b
f Ptr ImageResolve2
p)
pokeCStruct :: forall b. Ptr ImageResolve2 -> ImageResolve2 -> IO b -> IO b
pokeCStruct Ptr ImageResolve2
p ImageResolve2{ImageSubresourceLayers
Offset3D
Extent3D
extent :: Extent3D
dstOffset :: Offset3D
dstSubresource :: ImageSubresourceLayers
srcOffset :: Offset3D
srcSubresource :: ImageSubresourceLayers
$sel:extent:ImageResolve2 :: ImageResolve2 -> Extent3D
$sel:dstOffset:ImageResolve2 :: ImageResolve2 -> Offset3D
$sel:dstSubresource:ImageResolve2 :: ImageResolve2 -> ImageSubresourceLayers
$sel:srcOffset:ImageResolve2 :: ImageResolve2 -> Offset3D
$sel:srcSubresource:ImageResolve2 :: ImageResolve2 -> ImageSubresourceLayers
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_RESOLVE_2)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
srcSubresource)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Offset3D)) (Offset3D
srcOffset)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
dstSubresource)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr Offset3D)) (Offset3D
dstOffset)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Extent3D)) (Extent3D
extent)
IO b
f
cStructSize :: Int
cStructSize = Int
88
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr ImageResolve2 -> IO b -> IO b
pokeZeroCStruct Ptr ImageResolve2
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_RESOLVE_2)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageSubresourceLayers)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Offset3D)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ImageSubresourceLayers)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr Offset3D)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Extent3D)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ImageResolve2 where
peekCStruct :: Ptr ImageResolve2 -> IO ImageResolve2
peekCStruct Ptr ImageResolve2
p = do
ImageSubresourceLayers
srcSubresource <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresourceLayers ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageSubresourceLayers))
Offset3D
srcOffset <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Offset3D))
ImageSubresourceLayers
dstSubresource <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresourceLayers ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ImageSubresourceLayers))
Offset3D
dstOffset <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset3D ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr Offset3D))
Extent3D
extent <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent3D ((Ptr ImageResolve2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Extent3D))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ImageSubresourceLayers
-> Offset3D
-> ImageSubresourceLayers
-> Offset3D
-> Extent3D
-> ImageResolve2
ImageResolve2
ImageSubresourceLayers
srcSubresource Offset3D
srcOffset ImageSubresourceLayers
dstSubresource Offset3D
dstOffset Extent3D
extent
instance Storable ImageResolve2 where
sizeOf :: ImageResolve2 -> Int
sizeOf ~ImageResolve2
_ = Int
88
alignment :: ImageResolve2 -> Int
alignment ~ImageResolve2
_ = Int
8
peek :: Ptr ImageResolve2 -> IO ImageResolve2
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ImageResolve2 -> ImageResolve2 -> IO ()
poke Ptr ImageResolve2
ptr ImageResolve2
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageResolve2
ptr ImageResolve2
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ImageResolve2 where
zero :: ImageResolve2
zero = ImageSubresourceLayers
-> Offset3D
-> ImageSubresourceLayers
-> Offset3D
-> Extent3D
-> ImageResolve2
ImageResolve2
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data CopyBufferInfo2 = CopyBufferInfo2
{
CopyBufferInfo2 -> Buffer
srcBuffer :: Buffer
,
CopyBufferInfo2 -> Buffer
dstBuffer :: Buffer
,
CopyBufferInfo2 -> Vector BufferCopy2
regions :: Vector BufferCopy2
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CopyBufferInfo2)
#endif
deriving instance Show CopyBufferInfo2
instance ToCStruct CopyBufferInfo2 where
withCStruct :: forall b.
CopyBufferInfo2
-> (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2) -> IO b) -> IO b
withCStruct CopyBufferInfo2
x ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 forall a b. (a -> b) -> a -> b
$ \"pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p CopyBufferInfo2
x (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2) -> IO b
f "pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p)
pokeCStruct :: forall b.
("pCopyBufferInfo" ::: Ptr CopyBufferInfo2)
-> CopyBufferInfo2 -> IO b -> IO b
pokeCStruct "pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p CopyBufferInfo2{Vector BufferCopy2
Buffer
regions :: Vector BufferCopy2
dstBuffer :: Buffer
srcBuffer :: Buffer
$sel:regions:CopyBufferInfo2 :: CopyBufferInfo2 -> Vector BufferCopy2
$sel:dstBuffer:CopyBufferInfo2 :: CopyBufferInfo2 -> Buffer
$sel:srcBuffer:CopyBufferInfo2 :: CopyBufferInfo2 -> Buffer
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_BUFFER_INFO_2)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Buffer)) (Buffer
srcBuffer)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Buffer)) (Buffer
dstBuffer)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector BufferCopy2
regions)) :: Word32))
Ptr BufferCopy2
pPRegions' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @BufferCopy2 ((forall a. Vector a -> Int
Data.Vector.length (Vector BufferCopy2
regions)) forall a. Num a => a -> a -> a
* Int
40)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i BufferCopy2
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr BufferCopy2
pPRegions' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
40 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr BufferCopy2) (BufferCopy2
e)) (Vector BufferCopy2
regions)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr BufferCopy2))) (Ptr BufferCopy2
pPRegions')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
("pCopyBufferInfo" ::: Ptr CopyBufferInfo2) -> IO b -> IO b
pokeZeroCStruct "pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_BUFFER_INFO_2)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Buffer)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Buffer)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct CopyBufferInfo2 where
peekCStruct :: ("pCopyBufferInfo" ::: Ptr CopyBufferInfo2) -> IO CopyBufferInfo2
peekCStruct "pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p = do
Buffer
srcBuffer <- forall a. Storable a => Ptr a -> IO a
peek @Buffer (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Buffer))
Buffer
dstBuffer <- forall a. Storable a => Ptr a -> IO a
peek @Buffer (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Buffer))
Word32
regionCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32))
Ptr BufferCopy2
pRegions <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr BufferCopy2) (("pCopyBufferInfo" ::: Ptr CopyBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr BufferCopy2)))
Vector BufferCopy2
pRegions' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
regionCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @BufferCopy2 ((Ptr BufferCopy2
pRegions forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
40 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr BufferCopy2)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Buffer -> Buffer -> Vector BufferCopy2 -> CopyBufferInfo2
CopyBufferInfo2
Buffer
srcBuffer Buffer
dstBuffer Vector BufferCopy2
pRegions'
instance Zero CopyBufferInfo2 where
zero :: CopyBufferInfo2
zero = Buffer -> Buffer -> Vector BufferCopy2 -> CopyBufferInfo2
CopyBufferInfo2
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty
data CopyImageInfo2 = CopyImageInfo2
{
CopyImageInfo2 -> Image
srcImage :: Image
,
CopyImageInfo2 -> ImageLayout
srcImageLayout :: ImageLayout
,
CopyImageInfo2 -> Image
dstImage :: Image
,
CopyImageInfo2 -> ImageLayout
dstImageLayout :: ImageLayout
,
CopyImageInfo2 -> Vector ImageCopy2
regions :: Vector ImageCopy2
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CopyImageInfo2)
#endif
deriving instance Show CopyImageInfo2
instance ToCStruct CopyImageInfo2 where
withCStruct :: forall b.
CopyImageInfo2
-> (("pCopyImageInfo" ::: Ptr CopyImageInfo2) -> IO b) -> IO b
withCStruct CopyImageInfo2
x ("pCopyImageInfo" ::: Ptr CopyImageInfo2) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 forall a b. (a -> b) -> a -> b
$ \"pCopyImageInfo" ::: Ptr CopyImageInfo2
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCopyImageInfo" ::: Ptr CopyImageInfo2
p CopyImageInfo2
x (("pCopyImageInfo" ::: Ptr CopyImageInfo2) -> IO b
f "pCopyImageInfo" ::: Ptr CopyImageInfo2
p)
pokeCStruct :: forall b.
("pCopyImageInfo" ::: Ptr CopyImageInfo2)
-> CopyImageInfo2 -> IO b -> IO b
pokeCStruct "pCopyImageInfo" ::: Ptr CopyImageInfo2
p CopyImageInfo2{Vector ImageCopy2
ImageLayout
Image
regions :: Vector ImageCopy2
dstImageLayout :: ImageLayout
dstImage :: Image
srcImageLayout :: ImageLayout
srcImage :: Image
$sel:regions:CopyImageInfo2 :: CopyImageInfo2 -> Vector ImageCopy2
$sel:dstImageLayout:CopyImageInfo2 :: CopyImageInfo2 -> ImageLayout
$sel:dstImage:CopyImageInfo2 :: CopyImageInfo2 -> Image
$sel:srcImageLayout:CopyImageInfo2 :: CopyImageInfo2 -> ImageLayout
$sel:srcImage:CopyImageInfo2 :: CopyImageInfo2 -> Image
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_IMAGE_INFO_2)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Image)) (Image
srcImage)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageLayout)) (ImageLayout
srcImageLayout)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Image)) (Image
dstImage)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ImageLayout)) (ImageLayout
dstImageLayout)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector ImageCopy2
regions)) :: Word32))
Ptr ImageCopy2
pPRegions' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @ImageCopy2 ((forall a. Vector a -> Int
Data.Vector.length (Vector ImageCopy2
regions)) forall a. Num a => a -> a -> a
* Int
88)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i ImageCopy2
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ImageCopy2
pPRegions' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
88 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ImageCopy2) (ImageCopy2
e)) (Vector ImageCopy2
regions)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr ImageCopy2))) (Ptr ImageCopy2
pPRegions')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
56
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. ("pCopyImageInfo" ::: Ptr CopyImageInfo2) -> IO b -> IO b
pokeZeroCStruct "pCopyImageInfo" ::: Ptr CopyImageInfo2
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_IMAGE_INFO_2)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Image)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageLayout)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Image)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ImageLayout)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct CopyImageInfo2 where
peekCStruct :: ("pCopyImageInfo" ::: Ptr CopyImageInfo2) -> IO CopyImageInfo2
peekCStruct "pCopyImageInfo" ::: Ptr CopyImageInfo2
p = do
Image
srcImage <- forall a. Storable a => Ptr a -> IO a
peek @Image (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Image))
ImageLayout
srcImageLayout <- forall a. Storable a => Ptr a -> IO a
peek @ImageLayout (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageLayout))
Image
dstImage <- forall a. Storable a => Ptr a -> IO a
peek @Image (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Image))
ImageLayout
dstImageLayout <- forall a. Storable a => Ptr a -> IO a
peek @ImageLayout (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ImageLayout))
Word32
regionCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Word32))
Ptr ImageCopy2
pRegions <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ImageCopy2) (("pCopyImageInfo" ::: Ptr CopyImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr ImageCopy2)))
Vector ImageCopy2
pRegions' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
regionCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageCopy2 ((Ptr ImageCopy2
pRegions forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
88 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ImageCopy2)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Image
-> ImageLayout
-> Image
-> ImageLayout
-> Vector ImageCopy2
-> CopyImageInfo2
CopyImageInfo2
Image
srcImage ImageLayout
srcImageLayout Image
dstImage ImageLayout
dstImageLayout Vector ImageCopy2
pRegions'
instance Zero CopyImageInfo2 where
zero :: CopyImageInfo2
zero = Image
-> ImageLayout
-> Image
-> ImageLayout
-> Vector ImageCopy2
-> CopyImageInfo2
CopyImageInfo2
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty
data BlitImageInfo2 (es :: [Type]) = BlitImageInfo2
{
forall (es :: [*]). BlitImageInfo2 es -> Chain es
next :: Chain es
,
forall (es :: [*]). BlitImageInfo2 es -> Image
srcImage :: Image
,
forall (es :: [*]). BlitImageInfo2 es -> ImageLayout
srcImageLayout :: ImageLayout
,
forall (es :: [*]). BlitImageInfo2 es -> Image
dstImage :: Image
,
forall (es :: [*]). BlitImageInfo2 es -> ImageLayout
dstImageLayout :: ImageLayout
,
forall (es :: [*]).
BlitImageInfo2 es -> Vector (SomeStruct ImageBlit2)
regions :: Vector (SomeStruct ImageBlit2)
,
forall (es :: [*]). BlitImageInfo2 es -> Filter
filter' :: Filter
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BlitImageInfo2 (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (BlitImageInfo2 es)
instance Extensible BlitImageInfo2 where
extensibleTypeName :: String
extensibleTypeName = String
"BlitImageInfo2"
setNext :: forall (ds :: [*]) (es :: [*]).
BlitImageInfo2 ds -> Chain es -> BlitImageInfo2 es
setNext BlitImageInfo2{Vector (SomeStruct ImageBlit2)
Chain ds
Filter
ImageLayout
Image
filter' :: Filter
regions :: Vector (SomeStruct ImageBlit2)
dstImageLayout :: ImageLayout
dstImage :: Image
srcImageLayout :: ImageLayout
srcImage :: Image
next :: Chain ds
$sel:filter':BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> Filter
$sel:regions:BlitImageInfo2 :: forall (es :: [*]).
BlitImageInfo2 es -> Vector (SomeStruct ImageBlit2)
$sel:dstImageLayout:BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> ImageLayout
$sel:dstImage:BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> Image
$sel:srcImageLayout:BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> ImageLayout
$sel:srcImage:BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> Image
$sel:next:BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> Chain es
..} Chain es
next' = BlitImageInfo2{$sel:next:BlitImageInfo2 :: Chain es
next = Chain es
next', Vector (SomeStruct ImageBlit2)
Filter
ImageLayout
Image
filter' :: Filter
regions :: Vector (SomeStruct ImageBlit2)
dstImageLayout :: ImageLayout
dstImage :: Image
srcImageLayout :: ImageLayout
srcImage :: Image
$sel:filter':BlitImageInfo2 :: Filter
$sel:regions:BlitImageInfo2 :: Vector (SomeStruct ImageBlit2)
$sel:dstImageLayout:BlitImageInfo2 :: ImageLayout
$sel:dstImage:BlitImageInfo2 :: Image
$sel:srcImageLayout:BlitImageInfo2 :: ImageLayout
$sel:srcImage:BlitImageInfo2 :: Image
..}
getNext :: forall (es :: [*]). BlitImageInfo2 es -> Chain es
getNext BlitImageInfo2{Vector (SomeStruct ImageBlit2)
Chain es
Filter
ImageLayout
Image
filter' :: Filter
regions :: Vector (SomeStruct ImageBlit2)
dstImageLayout :: ImageLayout
dstImage :: Image
srcImageLayout :: ImageLayout
srcImage :: Image
next :: Chain es
$sel:filter':BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> Filter
$sel:regions:BlitImageInfo2 :: forall (es :: [*]).
BlitImageInfo2 es -> Vector (SomeStruct ImageBlit2)
$sel:dstImageLayout:BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> ImageLayout
$sel:dstImage:BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> Image
$sel:srcImageLayout:BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> ImageLayout
$sel:srcImage:BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> Image
$sel:next:BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends BlitImageInfo2 e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends BlitImageInfo2 e => b) -> Maybe b
extends proxy e
_ Extends BlitImageInfo2 e => b
f
| Just e :~: BlitImageCubicWeightsInfoQCOM
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @BlitImageCubicWeightsInfoQCOM = forall a. a -> Maybe a
Just Extends BlitImageInfo2 e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss BlitImageInfo2 es
, PokeChain es ) => ToCStruct (BlitImageInfo2 es) where
withCStruct :: forall b.
BlitImageInfo2 es -> (Ptr (BlitImageInfo2 es) -> IO b) -> IO b
withCStruct BlitImageInfo2 es
x Ptr (BlitImageInfo2 es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
64 forall a b. (a -> b) -> a -> b
$ \Ptr (BlitImageInfo2 es)
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (BlitImageInfo2 es)
p BlitImageInfo2 es
x (Ptr (BlitImageInfo2 es) -> IO b
f Ptr (BlitImageInfo2 es)
p)
pokeCStruct :: forall b.
Ptr (BlitImageInfo2 es) -> BlitImageInfo2 es -> IO b -> IO b
pokeCStruct Ptr (BlitImageInfo2 es)
p BlitImageInfo2{Vector (SomeStruct ImageBlit2)
Chain es
Filter
ImageLayout
Image
filter' :: Filter
regions :: Vector (SomeStruct ImageBlit2)
dstImageLayout :: ImageLayout
dstImage :: Image
srcImageLayout :: ImageLayout
srcImage :: Image
next :: Chain es
$sel:filter':BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> Filter
$sel:regions:BlitImageInfo2 :: forall (es :: [*]).
BlitImageInfo2 es -> Vector (SomeStruct ImageBlit2)
$sel:dstImageLayout:BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> ImageLayout
$sel:dstImage:BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> Image
$sel:srcImageLayout:BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> ImageLayout
$sel:srcImage:BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> Image
$sel:next:BlitImageInfo2 :: forall (es :: [*]). BlitImageInfo2 es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BLIT_IMAGE_INFO_2)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Image)) (Image
srcImage)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageLayout)) (ImageLayout
srcImageLayout)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Image)) (Image
dstImage)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ImageLayout)) (ImageLayout
dstImageLayout)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct ImageBlit2)
regions)) :: Word32))
Ptr (ImageBlit2 Any)
pPRegions' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(ImageBlit2 _) ((forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct ImageBlit2)
regions)) forall a. Num a => a -> a -> a
* Int
96)
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SomeStruct ImageBlit2
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (ImageBlit2 Any)
pPRegions' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
96 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (ImageBlit2 _))) (SomeStruct ImageBlit2
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) (Vector (SomeStruct ImageBlit2)
regions)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr (ImageBlit2 _)))) (Ptr (ImageBlit2 Any)
pPRegions')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr Filter)) (Filter
filter')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
64
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (BlitImageInfo2 es) -> IO b -> IO b
pokeZeroCStruct Ptr (BlitImageInfo2 es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BLIT_IMAGE_INFO_2)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Image)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageLayout)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Image)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ImageLayout)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr Filter)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
instance ( Extendss BlitImageInfo2 es
, PeekChain es ) => FromCStruct (BlitImageInfo2 es) where
peekCStruct :: Ptr (BlitImageInfo2 es) -> IO (BlitImageInfo2 es)
peekCStruct Ptr (BlitImageInfo2 es)
p = do
Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
Image
srcImage <- forall a. Storable a => Ptr a -> IO a
peek @Image ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Image))
ImageLayout
srcImageLayout <- forall a. Storable a => Ptr a -> IO a
peek @ImageLayout ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageLayout))
Image
dstImage <- forall a. Storable a => Ptr a -> IO a
peek @Image ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Image))
ImageLayout
dstImageLayout <- forall a. Storable a => Ptr a -> IO a
peek @ImageLayout ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ImageLayout))
Word32
regionCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Word32))
Ptr (ImageBlit2 Any)
pRegions <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (ImageBlit2 _)) ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr (ImageBlit2 _))))
Vector (SomeStruct ImageBlit2)
pRegions' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
regionCount) (\Int
i -> forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (ImageBlit2 Any)
pRegions forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
96 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (ImageBlit2 _)))))
Filter
filter' <- forall a. Storable a => Ptr a -> IO a
peek @Filter ((Ptr (BlitImageInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr Filter))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]).
Chain es
-> Image
-> ImageLayout
-> Image
-> ImageLayout
-> Vector (SomeStruct ImageBlit2)
-> Filter
-> BlitImageInfo2 es
BlitImageInfo2
Chain es
next
Image
srcImage
ImageLayout
srcImageLayout
Image
dstImage
ImageLayout
dstImageLayout
Vector (SomeStruct ImageBlit2)
pRegions'
Filter
filter'
instance es ~ '[] => Zero (BlitImageInfo2 es) where
zero :: BlitImageInfo2 es
zero = forall (es :: [*]).
Chain es
-> Image
-> ImageLayout
-> Image
-> ImageLayout
-> Vector (SomeStruct ImageBlit2)
-> Filter
-> BlitImageInfo2 es
BlitImageInfo2
()
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty
forall a. Zero a => a
zero
data CopyBufferToImageInfo2 = CopyBufferToImageInfo2
{
CopyBufferToImageInfo2 -> Buffer
srcBuffer :: Buffer
,
CopyBufferToImageInfo2 -> Image
dstImage :: Image
,
CopyBufferToImageInfo2 -> ImageLayout
dstImageLayout :: ImageLayout
,
CopyBufferToImageInfo2 -> Vector (SomeStruct BufferImageCopy2)
regions :: Vector (SomeStruct BufferImageCopy2)
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CopyBufferToImageInfo2)
#endif
deriving instance Show CopyBufferToImageInfo2
instance ToCStruct CopyBufferToImageInfo2 where
withCStruct :: forall b.
CopyBufferToImageInfo2
-> (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2)
-> IO b)
-> IO b
withCStruct CopyBufferToImageInfo2
x ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 forall a b. (a -> b) -> a -> b
$ \"pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p CopyBufferToImageInfo2
x (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2) -> IO b
f "pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p)
pokeCStruct :: forall b.
("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2)
-> CopyBufferToImageInfo2 -> IO b -> IO b
pokeCStruct "pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p CopyBufferToImageInfo2{Vector (SomeStruct BufferImageCopy2)
ImageLayout
Image
Buffer
regions :: Vector (SomeStruct BufferImageCopy2)
dstImageLayout :: ImageLayout
dstImage :: Image
srcBuffer :: Buffer
$sel:regions:CopyBufferToImageInfo2 :: CopyBufferToImageInfo2 -> Vector (SomeStruct BufferImageCopy2)
$sel:dstImageLayout:CopyBufferToImageInfo2 :: CopyBufferToImageInfo2 -> ImageLayout
$sel:dstImage:CopyBufferToImageInfo2 :: CopyBufferToImageInfo2 -> Image
$sel:srcBuffer:CopyBufferToImageInfo2 :: CopyBufferToImageInfo2 -> Buffer
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Buffer)) (Buffer
srcBuffer)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Image)) (Image
dstImage)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr ImageLayout)) (ImageLayout
dstImageLayout)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct BufferImageCopy2)
regions)) :: Word32))
Ptr (BufferImageCopy2 Any)
pPRegions' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(BufferImageCopy2 _) ((forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct BufferImageCopy2)
regions)) forall a. Num a => a -> a -> a
* Int
72)
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SomeStruct BufferImageCopy2
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (BufferImageCopy2 Any)
pPRegions' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
72 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (BufferImageCopy2 _))) (SomeStruct BufferImageCopy2
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) (Vector (SomeStruct BufferImageCopy2)
regions)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr (BufferImageCopy2 _)))) (Ptr (BufferImageCopy2 Any)
pPRegions')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2)
-> IO b -> IO b
pokeZeroCStruct "pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Buffer)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Image)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr ImageLayout)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct CopyBufferToImageInfo2 where
peekCStruct :: ("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2)
-> IO CopyBufferToImageInfo2
peekCStruct "pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p = do
Buffer
srcBuffer <- forall a. Storable a => Ptr a -> IO a
peek @Buffer (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Buffer))
Image
dstImage <- forall a. Storable a => Ptr a -> IO a
peek @Image (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Image))
ImageLayout
dstImageLayout <- forall a. Storable a => Ptr a -> IO a
peek @ImageLayout (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr ImageLayout))
Word32
regionCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Word32))
Ptr (BufferImageCopy2 Any)
pRegions <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (BufferImageCopy2 _)) (("pCopyBufferToImageInfo" ::: Ptr CopyBufferToImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr (BufferImageCopy2 _))))
Vector (SomeStruct BufferImageCopy2)
pRegions' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
regionCount) (\Int
i -> forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (BufferImageCopy2 Any)
pRegions forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
72 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (BufferImageCopy2 _)))))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Buffer
-> Image
-> ImageLayout
-> Vector (SomeStruct BufferImageCopy2)
-> CopyBufferToImageInfo2
CopyBufferToImageInfo2
Buffer
srcBuffer Image
dstImage ImageLayout
dstImageLayout Vector (SomeStruct BufferImageCopy2)
pRegions'
instance Zero CopyBufferToImageInfo2 where
zero :: CopyBufferToImageInfo2
zero = Buffer
-> Image
-> ImageLayout
-> Vector (SomeStruct BufferImageCopy2)
-> CopyBufferToImageInfo2
CopyBufferToImageInfo2
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty
data CopyImageToBufferInfo2 = CopyImageToBufferInfo2
{
CopyImageToBufferInfo2 -> Image
srcImage :: Image
,
CopyImageToBufferInfo2 -> ImageLayout
srcImageLayout :: ImageLayout
,
CopyImageToBufferInfo2 -> Buffer
dstBuffer :: Buffer
,
CopyImageToBufferInfo2 -> Vector (SomeStruct BufferImageCopy2)
regions :: Vector (SomeStruct BufferImageCopy2)
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CopyImageToBufferInfo2)
#endif
deriving instance Show CopyImageToBufferInfo2
instance ToCStruct CopyImageToBufferInfo2 where
withCStruct :: forall b.
CopyImageToBufferInfo2
-> (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2)
-> IO b)
-> IO b
withCStruct CopyImageToBufferInfo2
x ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 forall a b. (a -> b) -> a -> b
$ \"pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p CopyImageToBufferInfo2
x (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2) -> IO b
f "pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p)
pokeCStruct :: forall b.
("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2)
-> CopyImageToBufferInfo2 -> IO b -> IO b
pokeCStruct "pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p CopyImageToBufferInfo2{Vector (SomeStruct BufferImageCopy2)
ImageLayout
Image
Buffer
regions :: Vector (SomeStruct BufferImageCopy2)
dstBuffer :: Buffer
srcImageLayout :: ImageLayout
srcImage :: Image
$sel:regions:CopyImageToBufferInfo2 :: CopyImageToBufferInfo2 -> Vector (SomeStruct BufferImageCopy2)
$sel:dstBuffer:CopyImageToBufferInfo2 :: CopyImageToBufferInfo2 -> Buffer
$sel:srcImageLayout:CopyImageToBufferInfo2 :: CopyImageToBufferInfo2 -> ImageLayout
$sel:srcImage:CopyImageToBufferInfo2 :: CopyImageToBufferInfo2 -> Image
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Image)) (Image
srcImage)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageLayout)) (ImageLayout
srcImageLayout)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Buffer)) (Buffer
dstBuffer)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct BufferImageCopy2)
regions)) :: Word32))
Ptr (BufferImageCopy2 Any)
pPRegions' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(BufferImageCopy2 _) ((forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct BufferImageCopy2)
regions)) forall a. Num a => a -> a -> a
* Int
72)
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SomeStruct BufferImageCopy2
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (BufferImageCopy2 Any)
pPRegions' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
72 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (BufferImageCopy2 _))) (SomeStruct BufferImageCopy2
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) (Vector (SomeStruct BufferImageCopy2)
regions)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr (BufferImageCopy2 _)))) (Ptr (BufferImageCopy2 Any)
pPRegions')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
56
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2)
-> IO b -> IO b
pokeZeroCStruct "pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Image)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageLayout)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Buffer)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct CopyImageToBufferInfo2 where
peekCStruct :: ("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2)
-> IO CopyImageToBufferInfo2
peekCStruct "pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p = do
Image
srcImage <- forall a. Storable a => Ptr a -> IO a
peek @Image (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Image))
ImageLayout
srcImageLayout <- forall a. Storable a => Ptr a -> IO a
peek @ImageLayout (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageLayout))
Buffer
dstBuffer <- forall a. Storable a => Ptr a -> IO a
peek @Buffer (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Buffer))
Word32
regionCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Word32))
Ptr (BufferImageCopy2 Any)
pRegions <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (BufferImageCopy2 _)) (("pCopyImageToBufferInfo" ::: Ptr CopyImageToBufferInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr (BufferImageCopy2 _))))
Vector (SomeStruct BufferImageCopy2)
pRegions' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
regionCount) (\Int
i -> forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (BufferImageCopy2 Any)
pRegions forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
72 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (BufferImageCopy2 _)))))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Image
-> ImageLayout
-> Buffer
-> Vector (SomeStruct BufferImageCopy2)
-> CopyImageToBufferInfo2
CopyImageToBufferInfo2
Image
srcImage ImageLayout
srcImageLayout Buffer
dstBuffer Vector (SomeStruct BufferImageCopy2)
pRegions'
instance Zero CopyImageToBufferInfo2 where
zero :: CopyImageToBufferInfo2
zero = Image
-> ImageLayout
-> Buffer
-> Vector (SomeStruct BufferImageCopy2)
-> CopyImageToBufferInfo2
CopyImageToBufferInfo2
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty
data ResolveImageInfo2 = ResolveImageInfo2
{
ResolveImageInfo2 -> Image
srcImage :: Image
,
ResolveImageInfo2 -> ImageLayout
srcImageLayout :: ImageLayout
,
ResolveImageInfo2 -> Image
dstImage :: Image
,
ResolveImageInfo2 -> ImageLayout
dstImageLayout :: ImageLayout
,
ResolveImageInfo2 -> Vector ImageResolve2
regions :: Vector ImageResolve2
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ResolveImageInfo2)
#endif
deriving instance Show ResolveImageInfo2
instance ToCStruct ResolveImageInfo2 where
withCStruct :: forall b.
ResolveImageInfo2
-> (("pResolveImageInfo" ::: Ptr ResolveImageInfo2) -> IO b)
-> IO b
withCStruct ResolveImageInfo2
x ("pResolveImageInfo" ::: Ptr ResolveImageInfo2) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 forall a b. (a -> b) -> a -> b
$ \"pResolveImageInfo" ::: Ptr ResolveImageInfo2
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pResolveImageInfo" ::: Ptr ResolveImageInfo2
p ResolveImageInfo2
x (("pResolveImageInfo" ::: Ptr ResolveImageInfo2) -> IO b
f "pResolveImageInfo" ::: Ptr ResolveImageInfo2
p)
pokeCStruct :: forall b.
("pResolveImageInfo" ::: Ptr ResolveImageInfo2)
-> ResolveImageInfo2 -> IO b -> IO b
pokeCStruct "pResolveImageInfo" ::: Ptr ResolveImageInfo2
p ResolveImageInfo2{Vector ImageResolve2
ImageLayout
Image
regions :: Vector ImageResolve2
dstImageLayout :: ImageLayout
dstImage :: Image
srcImageLayout :: ImageLayout
srcImage :: Image
$sel:regions:ResolveImageInfo2 :: ResolveImageInfo2 -> Vector ImageResolve2
$sel:dstImageLayout:ResolveImageInfo2 :: ResolveImageInfo2 -> ImageLayout
$sel:dstImage:ResolveImageInfo2 :: ResolveImageInfo2 -> Image
$sel:srcImageLayout:ResolveImageInfo2 :: ResolveImageInfo2 -> ImageLayout
$sel:srcImage:ResolveImageInfo2 :: ResolveImageInfo2 -> Image
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Image)) (Image
srcImage)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageLayout)) (ImageLayout
srcImageLayout)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Image)) (Image
dstImage)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ImageLayout)) (ImageLayout
dstImageLayout)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector ImageResolve2
regions)) :: Word32))
Ptr ImageResolve2
pPRegions' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @ImageResolve2 ((forall a. Vector a -> Int
Data.Vector.length (Vector ImageResolve2
regions)) forall a. Num a => a -> a -> a
* Int
88)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i ImageResolve2
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ImageResolve2
pPRegions' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
88 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ImageResolve2) (ImageResolve2
e)) (Vector ImageResolve2
regions)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr ImageResolve2))) (Ptr ImageResolve2
pPRegions')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
56
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
("pResolveImageInfo" ::: Ptr ResolveImageInfo2) -> IO b -> IO b
pokeZeroCStruct "pResolveImageInfo" ::: Ptr ResolveImageInfo2
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Image)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageLayout)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Image)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ImageLayout)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ResolveImageInfo2 where
peekCStruct :: ("pResolveImageInfo" ::: Ptr ResolveImageInfo2)
-> IO ResolveImageInfo2
peekCStruct "pResolveImageInfo" ::: Ptr ResolveImageInfo2
p = do
Image
srcImage <- forall a. Storable a => Ptr a -> IO a
peek @Image (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Image))
ImageLayout
srcImageLayout <- forall a. Storable a => Ptr a -> IO a
peek @ImageLayout (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageLayout))
Image
dstImage <- forall a. Storable a => Ptr a -> IO a
peek @Image (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Image))
ImageLayout
dstImageLayout <- forall a. Storable a => Ptr a -> IO a
peek @ImageLayout (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ImageLayout))
Word32
regionCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Word32))
Ptr ImageResolve2
pRegions <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ImageResolve2) (("pResolveImageInfo" ::: Ptr ResolveImageInfo2
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr ImageResolve2)))
Vector ImageResolve2
pRegions' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
regionCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageResolve2 ((Ptr ImageResolve2
pRegions forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
88 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ImageResolve2)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Image
-> ImageLayout
-> Image
-> ImageLayout
-> Vector ImageResolve2
-> ResolveImageInfo2
ResolveImageInfo2
Image
srcImage ImageLayout
srcImageLayout Image
dstImage ImageLayout
dstImageLayout Vector ImageResolve2
pRegions'
instance Zero ResolveImageInfo2 where
zero :: ResolveImageInfo2
zero = Image
-> ImageLayout
-> Image
-> ImageLayout
-> Vector ImageResolve2
-> ResolveImageInfo2
ResolveImageInfo2
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty