{-# language CPP #-}
module Vulkan.Core11.Promoted_From_VK_KHR_device_group ( getDeviceGroupPeerMemoryFeatures
, cmdSetDeviceMask
, cmdDispatchBase
, pattern PIPELINE_CREATE_DISPATCH_BASE
, MemoryAllocateFlagsInfo(..)
, DeviceGroupRenderPassBeginInfo(..)
, DeviceGroupCommandBufferBeginInfo(..)
, DeviceGroupSubmitInfo(..)
, DeviceGroupBindSparseInfo(..)
, StructureType(..)
, PipelineCreateFlagBits(..)
, PipelineCreateFlags
, DependencyFlagBits(..)
, DependencyFlags
, PeerMemoryFeatureFlagBits(..)
, PeerMemoryFeatureFlags
, MemoryAllocateFlagBits(..)
, MemoryAllocateFlags
) where
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytesAligned)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import Control.Monad.IO.Class (MonadIO)
import Data.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.NamedType ((:::))
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Dynamic (DeviceCmds(pVkCmdDispatchBase))
import Vulkan.Dynamic (DeviceCmds(pVkCmdSetDeviceMask))
import Vulkan.Dynamic (DeviceCmds(pVkGetDeviceGroupPeerMemoryFeatures))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.Core11.Enums.MemoryAllocateFlagBits (MemoryAllocateFlags)
import Vulkan.Core11.Enums.PeerMemoryFeatureFlagBits (PeerMemoryFeatureFlagBits(..))
import Vulkan.Core11.Enums.PeerMemoryFeatureFlagBits (PeerMemoryFeatureFlags)
import Vulkan.Core10.CommandBufferBuilding (Rect2D)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Vulkan.Core10.Enums.PipelineCreateFlagBits (PipelineCreateFlags)
import Vulkan.Core10.Enums.PipelineCreateFlagBits (PipelineCreateFlagBits(PIPELINE_CREATE_DISPATCH_BASE_BIT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO))
import Vulkan.Core10.Enums.DependencyFlagBits (DependencyFlagBits(..))
import Vulkan.Core10.Enums.DependencyFlagBits (DependencyFlags)
import Vulkan.Core11.Enums.MemoryAllocateFlagBits (MemoryAllocateFlagBits(..))
import Vulkan.Core11.Enums.MemoryAllocateFlagBits (MemoryAllocateFlags)
import Vulkan.Core11.Enums.PeerMemoryFeatureFlagBits (PeerMemoryFeatureFlagBits(..))
import Vulkan.Core11.Enums.PeerMemoryFeatureFlagBits (PeerMemoryFeatureFlags)
import Vulkan.Core10.Enums.PipelineCreateFlagBits (PipelineCreateFlagBits(..))
import Vulkan.Core10.Enums.PipelineCreateFlagBits (PipelineCreateFlags)
import Vulkan.Core10.Enums.StructureType (StructureType(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetDeviceGroupPeerMemoryFeatures
:: FunPtr (Ptr Device_T -> Word32 -> Word32 -> Word32 -> Ptr PeerMemoryFeatureFlags -> IO ()) -> Ptr Device_T -> Word32 -> Word32 -> Word32 -> Ptr PeerMemoryFeatureFlags -> IO ()
getDeviceGroupPeerMemoryFeatures :: forall io
. (MonadIO io)
=>
Device
->
("heapIndex" ::: Word32)
->
("localDeviceIndex" ::: Word32)
->
("remoteDeviceIndex" ::: Word32)
-> io (("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
getDeviceGroupPeerMemoryFeatures :: Device
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> io ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
getDeviceGroupPeerMemoryFeatures device :: Device
device heapIndex :: "heapIndex" ::: Word32
heapIndex localDeviceIndex :: "heapIndex" ::: Word32
localDeviceIndex remoteDeviceIndex :: "heapIndex" ::: Word32
remoteDeviceIndex = IO ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
-> io ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
-> io ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> (ContT
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
IO
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
-> IO ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> ContT
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
IO
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
-> io ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
IO
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
-> IO ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
IO
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
-> io ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> ContT
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
IO
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
-> io ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
forall a b. (a -> b) -> a -> b
$ do
let vkGetDeviceGroupPeerMemoryFeaturesPtr :: FunPtr
(Ptr Device_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ())
vkGetDeviceGroupPeerMemoryFeaturesPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ())
pVkGetDeviceGroupPeerMemoryFeatures (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
IO ()
-> ContT ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
-> ContT ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags) IO ())
-> IO ()
-> ContT ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ())
vkGetDeviceGroupPeerMemoryFeaturesPtr FunPtr
(Ptr Device_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ())
-> FunPtr
(Ptr Device_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetDeviceGroupPeerMemoryFeatures is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkGetDeviceGroupPeerMemoryFeatures' :: Ptr Device_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ()
vkGetDeviceGroupPeerMemoryFeatures' = FunPtr
(Ptr Device_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ())
-> Ptr Device_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ()
mkVkGetDeviceGroupPeerMemoryFeatures FunPtr
(Ptr Device_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ())
vkGetDeviceGroupPeerMemoryFeaturesPtr
"pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
pPPeerMemoryFeatures <- ((("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> ContT
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
IO
("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> ContT
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
IO
("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)))
-> ((("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> ContT
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
IO
("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
forall a b. (a -> b) -> a -> b
$ IO
("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> (("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ())
-> (("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int
-> IO
("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
forall a. Int -> IO (Ptr a)
callocBytes @PeerMemoryFeatureFlags 4) ("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ()
forall a. Ptr a -> IO ()
free
IO ()
-> ContT ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
-> ContT ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags) IO ())
-> IO ()
-> ContT ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags) IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Device_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ()
vkGetDeviceGroupPeerMemoryFeatures' (Device -> Ptr Device_T
deviceHandle (Device
device)) ("heapIndex" ::: Word32
heapIndex) ("heapIndex" ::: Word32
localDeviceIndex) ("heapIndex" ::: Word32
remoteDeviceIndex) ("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
pPPeerMemoryFeatures)
"peerMemoryFeatures" ::: PeerMemoryFeatureFlags
pPeerMemoryFeatures <- IO ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
-> ContT
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
IO
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
-> ContT
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
IO
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
-> ContT
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
IO
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
forall a b. (a -> b) -> a -> b
$ ("pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> IO ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
forall a. Storable a => Ptr a -> IO a
peek @PeerMemoryFeatureFlags "pPeerMemoryFeatures"
::: Ptr ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
pPPeerMemoryFeatures
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
-> ContT
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
IO
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
-> ContT
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
IO
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags))
-> ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
-> ContT
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
IO
("peerMemoryFeatures" ::: PeerMemoryFeatureFlags)
forall a b. (a -> b) -> a -> b
$ ("peerMemoryFeatures" ::: PeerMemoryFeatureFlags
pPeerMemoryFeatures)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdSetDeviceMask
:: FunPtr (Ptr CommandBuffer_T -> Word32 -> IO ()) -> Ptr CommandBuffer_T -> Word32 -> IO ()
cmdSetDeviceMask :: forall io
. (MonadIO io)
=>
CommandBuffer
->
("deviceMask" ::: Word32)
-> io ()
cmdSetDeviceMask :: CommandBuffer -> ("heapIndex" ::: Word32) -> io ()
cmdSetDeviceMask commandBuffer :: CommandBuffer
commandBuffer deviceMask :: "heapIndex" ::: Word32
deviceMask = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ()) -> IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdSetDeviceMaskPtr :: FunPtr (Ptr CommandBuffer_T -> ("heapIndex" ::: Word32) -> IO ())
vkCmdSetDeviceMaskPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T -> ("heapIndex" ::: Word32) -> IO ())
pVkCmdSetDeviceMask (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr (Ptr CommandBuffer_T -> ("heapIndex" ::: Word32) -> IO ())
vkCmdSetDeviceMaskPtr FunPtr (Ptr CommandBuffer_T -> ("heapIndex" ::: Word32) -> IO ())
-> FunPtr
(Ptr CommandBuffer_T -> ("heapIndex" ::: Word32) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr (Ptr CommandBuffer_T -> ("heapIndex" ::: Word32) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdSetDeviceMask is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdSetDeviceMask' :: Ptr CommandBuffer_T -> ("heapIndex" ::: Word32) -> IO ()
vkCmdSetDeviceMask' = FunPtr (Ptr CommandBuffer_T -> ("heapIndex" ::: Word32) -> IO ())
-> Ptr CommandBuffer_T -> ("heapIndex" ::: Word32) -> IO ()
mkVkCmdSetDeviceMask FunPtr (Ptr CommandBuffer_T -> ("heapIndex" ::: Word32) -> IO ())
vkCmdSetDeviceMaskPtr
Ptr CommandBuffer_T -> ("heapIndex" ::: Word32) -> IO ()
vkCmdSetDeviceMask' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) ("heapIndex" ::: Word32
deviceMask)
() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> IO ()) -> () -> IO ()
forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdDispatchBase
:: FunPtr (Ptr CommandBuffer_T -> Word32 -> Word32 -> Word32 -> Word32 -> Word32 -> Word32 -> IO ()) -> Ptr CommandBuffer_T -> Word32 -> Word32 -> Word32 -> Word32 -> Word32 -> Word32 -> IO ()
cmdDispatchBase :: forall io
. (MonadIO io)
=>
CommandBuffer
->
("baseGroupX" ::: Word32)
->
("baseGroupY" ::: Word32)
->
("baseGroupZ" ::: Word32)
->
("groupCountX" ::: Word32)
->
("groupCountY" ::: Word32)
->
("groupCountZ" ::: Word32)
-> io ()
cmdDispatchBase :: CommandBuffer
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> io ()
cmdDispatchBase commandBuffer :: CommandBuffer
commandBuffer baseGroupX :: "heapIndex" ::: Word32
baseGroupX baseGroupY :: "heapIndex" ::: Word32
baseGroupY baseGroupZ :: "heapIndex" ::: Word32
baseGroupZ groupCountX :: "heapIndex" ::: Word32
groupCountX groupCountY :: "heapIndex" ::: Word32
groupCountY groupCountZ :: "heapIndex" ::: Word32
groupCountZ = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ()) -> IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdDispatchBasePtr :: FunPtr
(Ptr CommandBuffer_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> IO ())
vkCmdDispatchBasePtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> IO ())
pVkCmdDispatchBase (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> IO ())
vkCmdDispatchBasePtr FunPtr
(Ptr CommandBuffer_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdDispatchBase is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdDispatchBase' :: Ptr CommandBuffer_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> IO ()
vkCmdDispatchBase' = FunPtr
(Ptr CommandBuffer_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> IO ())
-> Ptr CommandBuffer_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> IO ()
mkVkCmdDispatchBase FunPtr
(Ptr CommandBuffer_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> IO ())
vkCmdDispatchBasePtr
Ptr CommandBuffer_T
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32)
-> IO ()
vkCmdDispatchBase' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) ("heapIndex" ::: Word32
baseGroupX) ("heapIndex" ::: Word32
baseGroupY) ("heapIndex" ::: Word32
baseGroupZ) ("heapIndex" ::: Word32
groupCountX) ("heapIndex" ::: Word32
groupCountY) ("heapIndex" ::: Word32
groupCountZ)
() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> IO ()) -> () -> IO ()
forall a b. (a -> b) -> a -> b
$ ()
pattern $bPIPELINE_CREATE_DISPATCH_BASE :: PipelineCreateFlagBits
$mPIPELINE_CREATE_DISPATCH_BASE :: forall r.
PipelineCreateFlagBits -> (Void# -> r) -> (Void# -> r) -> r
PIPELINE_CREATE_DISPATCH_BASE = PIPELINE_CREATE_DISPATCH_BASE_BIT
data MemoryAllocateFlagsInfo = MemoryAllocateFlagsInfo
{
MemoryAllocateFlagsInfo -> MemoryAllocateFlags
flags :: MemoryAllocateFlags
,
MemoryAllocateFlagsInfo -> "heapIndex" ::: Word32
deviceMask :: Word32
}
deriving (Typeable, MemoryAllocateFlagsInfo -> MemoryAllocateFlagsInfo -> Bool
(MemoryAllocateFlagsInfo -> MemoryAllocateFlagsInfo -> Bool)
-> (MemoryAllocateFlagsInfo -> MemoryAllocateFlagsInfo -> Bool)
-> Eq MemoryAllocateFlagsInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MemoryAllocateFlagsInfo -> MemoryAllocateFlagsInfo -> Bool
$c/= :: MemoryAllocateFlagsInfo -> MemoryAllocateFlagsInfo -> Bool
== :: MemoryAllocateFlagsInfo -> MemoryAllocateFlagsInfo -> Bool
$c== :: MemoryAllocateFlagsInfo -> MemoryAllocateFlagsInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (MemoryAllocateFlagsInfo)
#endif
deriving instance Show MemoryAllocateFlagsInfo
instance ToCStruct MemoryAllocateFlagsInfo where
withCStruct :: MemoryAllocateFlagsInfo
-> (Ptr MemoryAllocateFlagsInfo -> IO b) -> IO b
withCStruct x :: MemoryAllocateFlagsInfo
x f :: Ptr MemoryAllocateFlagsInfo -> IO b
f = Int -> Int -> (Ptr MemoryAllocateFlagsInfo -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr MemoryAllocateFlagsInfo -> IO b) -> IO b)
-> (Ptr MemoryAllocateFlagsInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr MemoryAllocateFlagsInfo
p -> Ptr MemoryAllocateFlagsInfo
-> MemoryAllocateFlagsInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr MemoryAllocateFlagsInfo
p MemoryAllocateFlagsInfo
x (Ptr MemoryAllocateFlagsInfo -> IO b
f Ptr MemoryAllocateFlagsInfo
p)
pokeCStruct :: Ptr MemoryAllocateFlagsInfo
-> MemoryAllocateFlagsInfo -> IO b -> IO b
pokeCStruct p :: Ptr MemoryAllocateFlagsInfo
p MemoryAllocateFlagsInfo{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr MemoryAllocateFlagsInfo
p Ptr MemoryAllocateFlagsInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr MemoryAllocateFlagsInfo
p Ptr MemoryAllocateFlagsInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr MemoryAllocateFlags -> MemoryAllocateFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr MemoryAllocateFlagsInfo
p Ptr MemoryAllocateFlagsInfo -> Int -> Ptr MemoryAllocateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr MemoryAllocateFlags)) (MemoryAllocateFlags
flags)
Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr MemoryAllocateFlagsInfo
p Ptr MemoryAllocateFlagsInfo -> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) ("heapIndex" ::: Word32
deviceMask)
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr MemoryAllocateFlagsInfo -> IO b -> IO b
pokeZeroCStruct p :: Ptr MemoryAllocateFlagsInfo
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr MemoryAllocateFlagsInfo
p Ptr MemoryAllocateFlagsInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr MemoryAllocateFlagsInfo
p Ptr MemoryAllocateFlagsInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr MemoryAllocateFlagsInfo
p Ptr MemoryAllocateFlagsInfo -> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) ("heapIndex" ::: Word32
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct MemoryAllocateFlagsInfo where
peekCStruct :: Ptr MemoryAllocateFlagsInfo -> IO MemoryAllocateFlagsInfo
peekCStruct p :: Ptr MemoryAllocateFlagsInfo
p = do
MemoryAllocateFlags
flags <- Ptr MemoryAllocateFlags -> IO MemoryAllocateFlags
forall a. Storable a => Ptr a -> IO a
peek @MemoryAllocateFlags ((Ptr MemoryAllocateFlagsInfo
p Ptr MemoryAllocateFlagsInfo -> Int -> Ptr MemoryAllocateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr MemoryAllocateFlags))
"heapIndex" ::: Word32
deviceMask <- Ptr ("heapIndex" ::: Word32) -> IO ("heapIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr MemoryAllocateFlagsInfo
p Ptr MemoryAllocateFlagsInfo -> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32))
MemoryAllocateFlagsInfo -> IO MemoryAllocateFlagsInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MemoryAllocateFlagsInfo -> IO MemoryAllocateFlagsInfo)
-> MemoryAllocateFlagsInfo -> IO MemoryAllocateFlagsInfo
forall a b. (a -> b) -> a -> b
$ MemoryAllocateFlags
-> ("heapIndex" ::: Word32) -> MemoryAllocateFlagsInfo
MemoryAllocateFlagsInfo
MemoryAllocateFlags
flags "heapIndex" ::: Word32
deviceMask
instance Storable MemoryAllocateFlagsInfo where
sizeOf :: MemoryAllocateFlagsInfo -> Int
sizeOf ~MemoryAllocateFlagsInfo
_ = 24
alignment :: MemoryAllocateFlagsInfo -> Int
alignment ~MemoryAllocateFlagsInfo
_ = 8
peek :: Ptr MemoryAllocateFlagsInfo -> IO MemoryAllocateFlagsInfo
peek = Ptr MemoryAllocateFlagsInfo -> IO MemoryAllocateFlagsInfo
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr MemoryAllocateFlagsInfo -> MemoryAllocateFlagsInfo -> IO ()
poke ptr :: Ptr MemoryAllocateFlagsInfo
ptr poked :: MemoryAllocateFlagsInfo
poked = Ptr MemoryAllocateFlagsInfo
-> MemoryAllocateFlagsInfo -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr MemoryAllocateFlagsInfo
ptr MemoryAllocateFlagsInfo
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero MemoryAllocateFlagsInfo where
zero :: MemoryAllocateFlagsInfo
zero = MemoryAllocateFlags
-> ("heapIndex" ::: Word32) -> MemoryAllocateFlagsInfo
MemoryAllocateFlagsInfo
MemoryAllocateFlags
forall a. Zero a => a
zero
"heapIndex" ::: Word32
forall a. Zero a => a
zero
data DeviceGroupRenderPassBeginInfo = DeviceGroupRenderPassBeginInfo
{
DeviceGroupRenderPassBeginInfo -> "heapIndex" ::: Word32
deviceMask :: Word32
,
DeviceGroupRenderPassBeginInfo -> Vector Rect2D
deviceRenderAreas :: Vector Rect2D
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DeviceGroupRenderPassBeginInfo)
#endif
deriving instance Show DeviceGroupRenderPassBeginInfo
instance ToCStruct DeviceGroupRenderPassBeginInfo where
withCStruct :: DeviceGroupRenderPassBeginInfo
-> (Ptr DeviceGroupRenderPassBeginInfo -> IO b) -> IO b
withCStruct x :: DeviceGroupRenderPassBeginInfo
x f :: Ptr DeviceGroupRenderPassBeginInfo -> IO b
f = Int -> Int -> (Ptr DeviceGroupRenderPassBeginInfo -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr DeviceGroupRenderPassBeginInfo -> IO b) -> IO b)
-> (Ptr DeviceGroupRenderPassBeginInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr DeviceGroupRenderPassBeginInfo
p -> Ptr DeviceGroupRenderPassBeginInfo
-> DeviceGroupRenderPassBeginInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceGroupRenderPassBeginInfo
p DeviceGroupRenderPassBeginInfo
x (Ptr DeviceGroupRenderPassBeginInfo -> IO b
f Ptr DeviceGroupRenderPassBeginInfo
p)
pokeCStruct :: Ptr DeviceGroupRenderPassBeginInfo
-> DeviceGroupRenderPassBeginInfo -> IO b -> IO b
pokeCStruct p :: Ptr DeviceGroupRenderPassBeginInfo
p DeviceGroupRenderPassBeginInfo{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupRenderPassBeginInfo
p Ptr DeviceGroupRenderPassBeginInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupRenderPassBeginInfo
p Ptr DeviceGroupRenderPassBeginInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupRenderPassBeginInfo
p Ptr DeviceGroupRenderPassBeginInfo
-> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) ("heapIndex" ::: Word32
deviceMask)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupRenderPassBeginInfo
p Ptr DeviceGroupRenderPassBeginInfo
-> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) ((Int -> "heapIndex" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector Rect2D -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Rect2D -> Int) -> Vector Rect2D -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Rect2D
deviceRenderAreas)) :: Word32))
Ptr Rect2D
pPDeviceRenderAreas' <- ((Ptr Rect2D -> IO b) -> IO b) -> ContT b IO (Ptr Rect2D)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Rect2D -> IO b) -> IO b) -> ContT b IO (Ptr Rect2D))
-> ((Ptr Rect2D -> IO b) -> IO b) -> ContT b IO (Ptr Rect2D)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr Rect2D -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @Rect2D ((Vector Rect2D -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Rect2D
deviceRenderAreas)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 16) 4
(Int -> Rect2D -> ContT b IO ()) -> Vector Rect2D -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: Rect2D
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Rect2D -> Rect2D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr Rect2D
pPDeviceRenderAreas' Ptr Rect2D -> Int -> Ptr Rect2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Rect2D) (Rect2D
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) (Vector Rect2D
deviceRenderAreas)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr Rect2D) -> Ptr Rect2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupRenderPassBeginInfo
p Ptr DeviceGroupRenderPassBeginInfo -> Int -> Ptr (Ptr Rect2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr Rect2D))) (Ptr Rect2D
pPDeviceRenderAreas')
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = 32
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr DeviceGroupRenderPassBeginInfo -> IO b -> IO b
pokeZeroCStruct p :: Ptr DeviceGroupRenderPassBeginInfo
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupRenderPassBeginInfo
p Ptr DeviceGroupRenderPassBeginInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupRenderPassBeginInfo
p Ptr DeviceGroupRenderPassBeginInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupRenderPassBeginInfo
p Ptr DeviceGroupRenderPassBeginInfo
-> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) ("heapIndex" ::: Word32
forall a. Zero a => a
zero)
Ptr Rect2D
pPDeviceRenderAreas' <- ((Ptr Rect2D -> IO b) -> IO b) -> ContT b IO (Ptr Rect2D)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Rect2D -> IO b) -> IO b) -> ContT b IO (Ptr Rect2D))
-> ((Ptr Rect2D -> IO b) -> IO b) -> ContT b IO (Ptr Rect2D)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr Rect2D -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @Rect2D ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 16) 4
(Int -> Rect2D -> ContT b IO ()) -> Vector Rect2D -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: Rect2D
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Rect2D -> Rect2D -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr Rect2D
pPDeviceRenderAreas' Ptr Rect2D -> Int -> Ptr Rect2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Rect2D) (Rect2D
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) (Vector Rect2D
forall a. Monoid a => a
mempty)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr Rect2D) -> Ptr Rect2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupRenderPassBeginInfo
p Ptr DeviceGroupRenderPassBeginInfo -> Int -> Ptr (Ptr Rect2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr Rect2D))) (Ptr Rect2D
pPDeviceRenderAreas')
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
instance FromCStruct DeviceGroupRenderPassBeginInfo where
peekCStruct :: Ptr DeviceGroupRenderPassBeginInfo
-> IO DeviceGroupRenderPassBeginInfo
peekCStruct p :: Ptr DeviceGroupRenderPassBeginInfo
p = do
"heapIndex" ::: Word32
deviceMask <- Ptr ("heapIndex" ::: Word32) -> IO ("heapIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr DeviceGroupRenderPassBeginInfo
p Ptr DeviceGroupRenderPassBeginInfo
-> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32))
"heapIndex" ::: Word32
deviceRenderAreaCount <- Ptr ("heapIndex" ::: Word32) -> IO ("heapIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr DeviceGroupRenderPassBeginInfo
p Ptr DeviceGroupRenderPassBeginInfo
-> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32))
Ptr Rect2D
pDeviceRenderAreas <- Ptr (Ptr Rect2D) -> IO (Ptr Rect2D)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Rect2D) ((Ptr DeviceGroupRenderPassBeginInfo
p Ptr DeviceGroupRenderPassBeginInfo -> Int -> Ptr (Ptr Rect2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr Rect2D)))
Vector Rect2D
pDeviceRenderAreas' <- Int -> (Int -> IO Rect2D) -> IO (Vector Rect2D)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("heapIndex" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "heapIndex" ::: Word32
deviceRenderAreaCount) (\i :: Int
i -> Ptr Rect2D -> IO Rect2D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Rect2D ((Ptr Rect2D
pDeviceRenderAreas Ptr Rect2D -> Int -> Ptr Rect2D
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Rect2D)))
DeviceGroupRenderPassBeginInfo -> IO DeviceGroupRenderPassBeginInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (DeviceGroupRenderPassBeginInfo
-> IO DeviceGroupRenderPassBeginInfo)
-> DeviceGroupRenderPassBeginInfo
-> IO DeviceGroupRenderPassBeginInfo
forall a b. (a -> b) -> a -> b
$ ("heapIndex" ::: Word32)
-> Vector Rect2D -> DeviceGroupRenderPassBeginInfo
DeviceGroupRenderPassBeginInfo
"heapIndex" ::: Word32
deviceMask Vector Rect2D
pDeviceRenderAreas'
instance Zero DeviceGroupRenderPassBeginInfo where
zero :: DeviceGroupRenderPassBeginInfo
zero = ("heapIndex" ::: Word32)
-> Vector Rect2D -> DeviceGroupRenderPassBeginInfo
DeviceGroupRenderPassBeginInfo
"heapIndex" ::: Word32
forall a. Zero a => a
zero
Vector Rect2D
forall a. Monoid a => a
mempty
data DeviceGroupCommandBufferBeginInfo = DeviceGroupCommandBufferBeginInfo
{
DeviceGroupCommandBufferBeginInfo -> "heapIndex" ::: Word32
deviceMask :: Word32 }
deriving (Typeable, DeviceGroupCommandBufferBeginInfo
-> DeviceGroupCommandBufferBeginInfo -> Bool
(DeviceGroupCommandBufferBeginInfo
-> DeviceGroupCommandBufferBeginInfo -> Bool)
-> (DeviceGroupCommandBufferBeginInfo
-> DeviceGroupCommandBufferBeginInfo -> Bool)
-> Eq DeviceGroupCommandBufferBeginInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceGroupCommandBufferBeginInfo
-> DeviceGroupCommandBufferBeginInfo -> Bool
$c/= :: DeviceGroupCommandBufferBeginInfo
-> DeviceGroupCommandBufferBeginInfo -> Bool
== :: DeviceGroupCommandBufferBeginInfo
-> DeviceGroupCommandBufferBeginInfo -> Bool
$c== :: DeviceGroupCommandBufferBeginInfo
-> DeviceGroupCommandBufferBeginInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DeviceGroupCommandBufferBeginInfo)
#endif
deriving instance Show DeviceGroupCommandBufferBeginInfo
instance ToCStruct DeviceGroupCommandBufferBeginInfo where
withCStruct :: DeviceGroupCommandBufferBeginInfo
-> (Ptr DeviceGroupCommandBufferBeginInfo -> IO b) -> IO b
withCStruct x :: DeviceGroupCommandBufferBeginInfo
x f :: Ptr DeviceGroupCommandBufferBeginInfo -> IO b
f = Int
-> Int -> (Ptr DeviceGroupCommandBufferBeginInfo -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr DeviceGroupCommandBufferBeginInfo -> IO b) -> IO b)
-> (Ptr DeviceGroupCommandBufferBeginInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr DeviceGroupCommandBufferBeginInfo
p -> Ptr DeviceGroupCommandBufferBeginInfo
-> DeviceGroupCommandBufferBeginInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceGroupCommandBufferBeginInfo
p DeviceGroupCommandBufferBeginInfo
x (Ptr DeviceGroupCommandBufferBeginInfo -> IO b
f Ptr DeviceGroupCommandBufferBeginInfo
p)
pokeCStruct :: Ptr DeviceGroupCommandBufferBeginInfo
-> DeviceGroupCommandBufferBeginInfo -> IO b -> IO b
pokeCStruct p :: Ptr DeviceGroupCommandBufferBeginInfo
p DeviceGroupCommandBufferBeginInfo{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupCommandBufferBeginInfo
p Ptr DeviceGroupCommandBufferBeginInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupCommandBufferBeginInfo
p Ptr DeviceGroupCommandBufferBeginInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupCommandBufferBeginInfo
p Ptr DeviceGroupCommandBufferBeginInfo
-> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) ("heapIndex" ::: Word32
deviceMask)
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr DeviceGroupCommandBufferBeginInfo -> IO b -> IO b
pokeZeroCStruct p :: Ptr DeviceGroupCommandBufferBeginInfo
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupCommandBufferBeginInfo
p Ptr DeviceGroupCommandBufferBeginInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupCommandBufferBeginInfo
p Ptr DeviceGroupCommandBufferBeginInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupCommandBufferBeginInfo
p Ptr DeviceGroupCommandBufferBeginInfo
-> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) ("heapIndex" ::: Word32
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct DeviceGroupCommandBufferBeginInfo where
peekCStruct :: Ptr DeviceGroupCommandBufferBeginInfo
-> IO DeviceGroupCommandBufferBeginInfo
peekCStruct p :: Ptr DeviceGroupCommandBufferBeginInfo
p = do
"heapIndex" ::: Word32
deviceMask <- Ptr ("heapIndex" ::: Word32) -> IO ("heapIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr DeviceGroupCommandBufferBeginInfo
p Ptr DeviceGroupCommandBufferBeginInfo
-> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32))
DeviceGroupCommandBufferBeginInfo
-> IO DeviceGroupCommandBufferBeginInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (DeviceGroupCommandBufferBeginInfo
-> IO DeviceGroupCommandBufferBeginInfo)
-> DeviceGroupCommandBufferBeginInfo
-> IO DeviceGroupCommandBufferBeginInfo
forall a b. (a -> b) -> a -> b
$ ("heapIndex" ::: Word32) -> DeviceGroupCommandBufferBeginInfo
DeviceGroupCommandBufferBeginInfo
"heapIndex" ::: Word32
deviceMask
instance Storable DeviceGroupCommandBufferBeginInfo where
sizeOf :: DeviceGroupCommandBufferBeginInfo -> Int
sizeOf ~DeviceGroupCommandBufferBeginInfo
_ = 24
alignment :: DeviceGroupCommandBufferBeginInfo -> Int
alignment ~DeviceGroupCommandBufferBeginInfo
_ = 8
peek :: Ptr DeviceGroupCommandBufferBeginInfo
-> IO DeviceGroupCommandBufferBeginInfo
peek = Ptr DeviceGroupCommandBufferBeginInfo
-> IO DeviceGroupCommandBufferBeginInfo
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr DeviceGroupCommandBufferBeginInfo
-> DeviceGroupCommandBufferBeginInfo -> IO ()
poke ptr :: Ptr DeviceGroupCommandBufferBeginInfo
ptr poked :: DeviceGroupCommandBufferBeginInfo
poked = Ptr DeviceGroupCommandBufferBeginInfo
-> DeviceGroupCommandBufferBeginInfo -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceGroupCommandBufferBeginInfo
ptr DeviceGroupCommandBufferBeginInfo
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero DeviceGroupCommandBufferBeginInfo where
zero :: DeviceGroupCommandBufferBeginInfo
zero = ("heapIndex" ::: Word32) -> DeviceGroupCommandBufferBeginInfo
DeviceGroupCommandBufferBeginInfo
"heapIndex" ::: Word32
forall a. Zero a => a
zero
data DeviceGroupSubmitInfo = DeviceGroupSubmitInfo
{
DeviceGroupSubmitInfo -> Vector ("heapIndex" ::: Word32)
waitSemaphoreDeviceIndices :: Vector Word32
,
DeviceGroupSubmitInfo -> Vector ("heapIndex" ::: Word32)
commandBufferDeviceMasks :: Vector Word32
,
DeviceGroupSubmitInfo -> Vector ("heapIndex" ::: Word32)
signalSemaphoreDeviceIndices :: Vector Word32
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DeviceGroupSubmitInfo)
#endif
deriving instance Show DeviceGroupSubmitInfo
instance ToCStruct DeviceGroupSubmitInfo where
withCStruct :: DeviceGroupSubmitInfo
-> (Ptr DeviceGroupSubmitInfo -> IO b) -> IO b
withCStruct x :: DeviceGroupSubmitInfo
x f :: Ptr DeviceGroupSubmitInfo -> IO b
f = Int -> Int -> (Ptr DeviceGroupSubmitInfo -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 64 8 ((Ptr DeviceGroupSubmitInfo -> IO b) -> IO b)
-> (Ptr DeviceGroupSubmitInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr DeviceGroupSubmitInfo
p -> Ptr DeviceGroupSubmitInfo -> DeviceGroupSubmitInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceGroupSubmitInfo
p DeviceGroupSubmitInfo
x (Ptr DeviceGroupSubmitInfo -> IO b
f Ptr DeviceGroupSubmitInfo
p)
pokeCStruct :: Ptr DeviceGroupSubmitInfo -> DeviceGroupSubmitInfo -> IO b -> IO b
pokeCStruct p :: Ptr DeviceGroupSubmitInfo
p DeviceGroupSubmitInfo{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo -> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) ((Int -> "heapIndex" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector ("heapIndex" ::: Word32) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ("heapIndex" ::: Word32) -> Int)
-> Vector ("heapIndex" ::: Word32) -> Int
forall a b. (a -> b) -> a -> b
$ (Vector ("heapIndex" ::: Word32)
waitSemaphoreDeviceIndices)) :: Word32))
Ptr ("heapIndex" ::: Word32)
pPWaitSemaphoreDeviceIndices' <- ((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32)))
-> ((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32))
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @Word32 ((Vector ("heapIndex" ::: Word32) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ("heapIndex" ::: Word32)
waitSemaphoreDeviceIndices)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 4) 4
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ("heapIndex" ::: Word32) -> IO ())
-> Vector ("heapIndex" ::: Word32) -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: "heapIndex" ::: Word32
e -> Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("heapIndex" ::: Word32)
pPWaitSemaphoreDeviceIndices' Ptr ("heapIndex" ::: Word32) -> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) ("heapIndex" ::: Word32
e)) (Vector ("heapIndex" ::: Word32)
waitSemaphoreDeviceIndices)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ("heapIndex" ::: Word32))
-> Ptr ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo
-> Int -> Ptr (Ptr ("heapIndex" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr Word32))) (Ptr ("heapIndex" ::: Word32)
pPWaitSemaphoreDeviceIndices')
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo -> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word32)) ((Int -> "heapIndex" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector ("heapIndex" ::: Word32) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ("heapIndex" ::: Word32) -> Int)
-> Vector ("heapIndex" ::: Word32) -> Int
forall a b. (a -> b) -> a -> b
$ (Vector ("heapIndex" ::: Word32)
commandBufferDeviceMasks)) :: Word32))
Ptr ("heapIndex" ::: Word32)
pPCommandBufferDeviceMasks' <- ((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32)))
-> ((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32))
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @Word32 ((Vector ("heapIndex" ::: Word32) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ("heapIndex" ::: Word32)
commandBufferDeviceMasks)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 4) 4
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ("heapIndex" ::: Word32) -> IO ())
-> Vector ("heapIndex" ::: Word32) -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: "heapIndex" ::: Word32
e -> Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("heapIndex" ::: Word32)
pPCommandBufferDeviceMasks' Ptr ("heapIndex" ::: Word32) -> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) ("heapIndex" ::: Word32
e)) (Vector ("heapIndex" ::: Word32)
commandBufferDeviceMasks)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ("heapIndex" ::: Word32))
-> Ptr ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo
-> Int -> Ptr (Ptr ("heapIndex" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr Word32))) (Ptr ("heapIndex" ::: Word32)
pPCommandBufferDeviceMasks')
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo -> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Word32)) ((Int -> "heapIndex" ::: Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector ("heapIndex" ::: Word32) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ("heapIndex" ::: Word32) -> Int)
-> Vector ("heapIndex" ::: Word32) -> Int
forall a b. (a -> b) -> a -> b
$ (Vector ("heapIndex" ::: Word32)
signalSemaphoreDeviceIndices)) :: Word32))
Ptr ("heapIndex" ::: Word32)
pPSignalSemaphoreDeviceIndices' <- ((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32)))
-> ((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32))
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @Word32 ((Vector ("heapIndex" ::: Word32) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ("heapIndex" ::: Word32)
signalSemaphoreDeviceIndices)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 4) 4
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ("heapIndex" ::: Word32) -> IO ())
-> Vector ("heapIndex" ::: Word32) -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: "heapIndex" ::: Word32
e -> Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("heapIndex" ::: Word32)
pPSignalSemaphoreDeviceIndices' Ptr ("heapIndex" ::: Word32) -> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) ("heapIndex" ::: Word32
e)) (Vector ("heapIndex" ::: Word32)
signalSemaphoreDeviceIndices)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ("heapIndex" ::: Word32))
-> Ptr ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo
-> Int -> Ptr (Ptr ("heapIndex" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr (Ptr Word32))) (Ptr ("heapIndex" ::: Word32)
pPSignalSemaphoreDeviceIndices')
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = 64
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr DeviceGroupSubmitInfo -> IO b -> IO b
pokeZeroCStruct p :: Ptr DeviceGroupSubmitInfo
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ("heapIndex" ::: Word32)
pPWaitSemaphoreDeviceIndices' <- ((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32)))
-> ((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32))
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @Word32 ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 4) 4
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ("heapIndex" ::: Word32) -> IO ())
-> Vector ("heapIndex" ::: Word32) -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: "heapIndex" ::: Word32
e -> Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("heapIndex" ::: Word32)
pPWaitSemaphoreDeviceIndices' Ptr ("heapIndex" ::: Word32) -> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) ("heapIndex" ::: Word32
e)) (Vector ("heapIndex" ::: Word32)
forall a. Monoid a => a
mempty)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ("heapIndex" ::: Word32))
-> Ptr ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo
-> Int -> Ptr (Ptr ("heapIndex" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr Word32))) (Ptr ("heapIndex" ::: Word32)
pPWaitSemaphoreDeviceIndices')
Ptr ("heapIndex" ::: Word32)
pPCommandBufferDeviceMasks' <- ((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32)))
-> ((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32))
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @Word32 ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 4) 4
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ("heapIndex" ::: Word32) -> IO ())
-> Vector ("heapIndex" ::: Word32) -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: "heapIndex" ::: Word32
e -> Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("heapIndex" ::: Word32)
pPCommandBufferDeviceMasks' Ptr ("heapIndex" ::: Word32) -> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) ("heapIndex" ::: Word32
e)) (Vector ("heapIndex" ::: Word32)
forall a. Monoid a => a
mempty)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ("heapIndex" ::: Word32))
-> Ptr ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo
-> Int -> Ptr (Ptr ("heapIndex" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr Word32))) (Ptr ("heapIndex" ::: Word32)
pPCommandBufferDeviceMasks')
Ptr ("heapIndex" ::: Word32)
pPSignalSemaphoreDeviceIndices' <- ((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32)))
-> ((Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b)
-> ContT b IO (Ptr ("heapIndex" ::: Word32))
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr ("heapIndex" ::: Word32) -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @Word32 ((Vector Any -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Any
forall a. Monoid a => a
mempty)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 4) 4
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> ("heapIndex" ::: Word32) -> IO ())
-> Vector ("heapIndex" ::: Word32) -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: "heapIndex" ::: Word32
e -> Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("heapIndex" ::: Word32)
pPSignalSemaphoreDeviceIndices' Ptr ("heapIndex" ::: Word32) -> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) ("heapIndex" ::: Word32
e)) (Vector ("heapIndex" ::: Word32)
forall a. Monoid a => a
mempty)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ("heapIndex" ::: Word32))
-> Ptr ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo
-> Int -> Ptr (Ptr ("heapIndex" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr (Ptr Word32))) (Ptr ("heapIndex" ::: Word32)
pPSignalSemaphoreDeviceIndices')
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
instance FromCStruct DeviceGroupSubmitInfo where
peekCStruct :: Ptr DeviceGroupSubmitInfo -> IO DeviceGroupSubmitInfo
peekCStruct p :: Ptr DeviceGroupSubmitInfo
p = do
"heapIndex" ::: Word32
waitSemaphoreCount <- Ptr ("heapIndex" ::: Word32) -> IO ("heapIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo -> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32))
Ptr ("heapIndex" ::: Word32)
pWaitSemaphoreDeviceIndices <- Ptr (Ptr ("heapIndex" ::: Word32))
-> IO (Ptr ("heapIndex" ::: Word32))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo
-> Int -> Ptr (Ptr ("heapIndex" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr Word32)))
Vector ("heapIndex" ::: Word32)
pWaitSemaphoreDeviceIndices' <- Int
-> (Int -> IO ("heapIndex" ::: Word32))
-> IO (Vector ("heapIndex" ::: Word32))
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("heapIndex" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "heapIndex" ::: Word32
waitSemaphoreCount) (\i :: Int
i -> Ptr ("heapIndex" ::: Word32) -> IO ("heapIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ("heapIndex" ::: Word32)
pWaitSemaphoreDeviceIndices Ptr ("heapIndex" ::: Word32) -> Int -> Ptr ("heapIndex" ::: Word32)
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
"heapIndex" ::: Word32
commandBufferCount <- Ptr ("heapIndex" ::: Word32) -> IO ("heapIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo -> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word32))
Ptr ("heapIndex" ::: Word32)
pCommandBufferDeviceMasks <- Ptr (Ptr ("heapIndex" ::: Word32))
-> IO (Ptr ("heapIndex" ::: Word32))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo
-> Int -> Ptr (Ptr ("heapIndex" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr Word32)))
Vector ("heapIndex" ::: Word32)
pCommandBufferDeviceMasks' <- Int
-> (Int -> IO ("heapIndex" ::: Word32))
-> IO (Vector ("heapIndex" ::: Word32))
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("heapIndex" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "heapIndex" ::: Word32
commandBufferCount) (\i :: Int
i -> Ptr ("heapIndex" ::: Word32) -> IO ("heapIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ("heapIndex" ::: Word32)
pCommandBufferDeviceMasks Ptr ("heapIndex" ::: Word32) -> Int -> Ptr ("heapIndex" ::: Word32)
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
"heapIndex" ::: Word32
signalSemaphoreCount <- Ptr ("heapIndex" ::: Word32) -> IO ("heapIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo -> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Word32))
Ptr ("heapIndex" ::: Word32)
pSignalSemaphoreDeviceIndices <- Ptr (Ptr ("heapIndex" ::: Word32))
-> IO (Ptr ("heapIndex" ::: Word32))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) ((Ptr DeviceGroupSubmitInfo
p Ptr DeviceGroupSubmitInfo
-> Int -> Ptr (Ptr ("heapIndex" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr (Ptr Word32)))
Vector ("heapIndex" ::: Word32)
pSignalSemaphoreDeviceIndices' <- Int
-> (Int -> IO ("heapIndex" ::: Word32))
-> IO (Vector ("heapIndex" ::: Word32))
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (("heapIndex" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral "heapIndex" ::: Word32
signalSemaphoreCount) (\i :: Int
i -> Ptr ("heapIndex" ::: Word32) -> IO ("heapIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ("heapIndex" ::: Word32)
pSignalSemaphoreDeviceIndices Ptr ("heapIndex" ::: Word32) -> Int -> Ptr ("heapIndex" ::: Word32)
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
DeviceGroupSubmitInfo -> IO DeviceGroupSubmitInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (DeviceGroupSubmitInfo -> IO DeviceGroupSubmitInfo)
-> DeviceGroupSubmitInfo -> IO DeviceGroupSubmitInfo
forall a b. (a -> b) -> a -> b
$ Vector ("heapIndex" ::: Word32)
-> Vector ("heapIndex" ::: Word32)
-> Vector ("heapIndex" ::: Word32)
-> DeviceGroupSubmitInfo
DeviceGroupSubmitInfo
Vector ("heapIndex" ::: Word32)
pWaitSemaphoreDeviceIndices' Vector ("heapIndex" ::: Word32)
pCommandBufferDeviceMasks' Vector ("heapIndex" ::: Word32)
pSignalSemaphoreDeviceIndices'
instance Zero DeviceGroupSubmitInfo where
zero :: DeviceGroupSubmitInfo
zero = Vector ("heapIndex" ::: Word32)
-> Vector ("heapIndex" ::: Word32)
-> Vector ("heapIndex" ::: Word32)
-> DeviceGroupSubmitInfo
DeviceGroupSubmitInfo
Vector ("heapIndex" ::: Word32)
forall a. Monoid a => a
mempty
Vector ("heapIndex" ::: Word32)
forall a. Monoid a => a
mempty
Vector ("heapIndex" ::: Word32)
forall a. Monoid a => a
mempty
data DeviceGroupBindSparseInfo = DeviceGroupBindSparseInfo
{
DeviceGroupBindSparseInfo -> "heapIndex" ::: Word32
resourceDeviceIndex :: Word32
,
DeviceGroupBindSparseInfo -> "heapIndex" ::: Word32
memoryDeviceIndex :: Word32
}
deriving (Typeable, DeviceGroupBindSparseInfo -> DeviceGroupBindSparseInfo -> Bool
(DeviceGroupBindSparseInfo -> DeviceGroupBindSparseInfo -> Bool)
-> (DeviceGroupBindSparseInfo -> DeviceGroupBindSparseInfo -> Bool)
-> Eq DeviceGroupBindSparseInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceGroupBindSparseInfo -> DeviceGroupBindSparseInfo -> Bool
$c/= :: DeviceGroupBindSparseInfo -> DeviceGroupBindSparseInfo -> Bool
== :: DeviceGroupBindSparseInfo -> DeviceGroupBindSparseInfo -> Bool
$c== :: DeviceGroupBindSparseInfo -> DeviceGroupBindSparseInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DeviceGroupBindSparseInfo)
#endif
deriving instance Show DeviceGroupBindSparseInfo
instance ToCStruct DeviceGroupBindSparseInfo where
withCStruct :: DeviceGroupBindSparseInfo
-> (Ptr DeviceGroupBindSparseInfo -> IO b) -> IO b
withCStruct x :: DeviceGroupBindSparseInfo
x f :: Ptr DeviceGroupBindSparseInfo -> IO b
f = Int -> Int -> (Ptr DeviceGroupBindSparseInfo -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr DeviceGroupBindSparseInfo -> IO b) -> IO b)
-> (Ptr DeviceGroupBindSparseInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr DeviceGroupBindSparseInfo
p -> Ptr DeviceGroupBindSparseInfo
-> DeviceGroupBindSparseInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceGroupBindSparseInfo
p DeviceGroupBindSparseInfo
x (Ptr DeviceGroupBindSparseInfo -> IO b
f Ptr DeviceGroupBindSparseInfo
p)
pokeCStruct :: Ptr DeviceGroupBindSparseInfo
-> DeviceGroupBindSparseInfo -> IO b -> IO b
pokeCStruct p :: Ptr DeviceGroupBindSparseInfo
p DeviceGroupBindSparseInfo{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupBindSparseInfo
p Ptr DeviceGroupBindSparseInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupBindSparseInfo
p Ptr DeviceGroupBindSparseInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupBindSparseInfo
p Ptr DeviceGroupBindSparseInfo
-> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) ("heapIndex" ::: Word32
resourceDeviceIndex)
Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupBindSparseInfo
p Ptr DeviceGroupBindSparseInfo
-> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) ("heapIndex" ::: Word32
memoryDeviceIndex)
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr DeviceGroupBindSparseInfo -> IO b -> IO b
pokeZeroCStruct p :: Ptr DeviceGroupBindSparseInfo
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupBindSparseInfo
p Ptr DeviceGroupBindSparseInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupBindSparseInfo
p Ptr DeviceGroupBindSparseInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupBindSparseInfo
p Ptr DeviceGroupBindSparseInfo
-> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) ("heapIndex" ::: Word32
forall a. Zero a => a
zero)
Ptr ("heapIndex" ::: Word32) -> ("heapIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceGroupBindSparseInfo
p Ptr DeviceGroupBindSparseInfo
-> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) ("heapIndex" ::: Word32
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct DeviceGroupBindSparseInfo where
peekCStruct :: Ptr DeviceGroupBindSparseInfo -> IO DeviceGroupBindSparseInfo
peekCStruct p :: Ptr DeviceGroupBindSparseInfo
p = do
"heapIndex" ::: Word32
resourceDeviceIndex <- Ptr ("heapIndex" ::: Word32) -> IO ("heapIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr DeviceGroupBindSparseInfo
p Ptr DeviceGroupBindSparseInfo
-> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32))
"heapIndex" ::: Word32
memoryDeviceIndex <- Ptr ("heapIndex" ::: Word32) -> IO ("heapIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr DeviceGroupBindSparseInfo
p Ptr DeviceGroupBindSparseInfo
-> Int -> Ptr ("heapIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32))
DeviceGroupBindSparseInfo -> IO DeviceGroupBindSparseInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (DeviceGroupBindSparseInfo -> IO DeviceGroupBindSparseInfo)
-> DeviceGroupBindSparseInfo -> IO DeviceGroupBindSparseInfo
forall a b. (a -> b) -> a -> b
$ ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32) -> DeviceGroupBindSparseInfo
DeviceGroupBindSparseInfo
"heapIndex" ::: Word32
resourceDeviceIndex "heapIndex" ::: Word32
memoryDeviceIndex
instance Storable DeviceGroupBindSparseInfo where
sizeOf :: DeviceGroupBindSparseInfo -> Int
sizeOf ~DeviceGroupBindSparseInfo
_ = 24
alignment :: DeviceGroupBindSparseInfo -> Int
alignment ~DeviceGroupBindSparseInfo
_ = 8
peek :: Ptr DeviceGroupBindSparseInfo -> IO DeviceGroupBindSparseInfo
peek = Ptr DeviceGroupBindSparseInfo -> IO DeviceGroupBindSparseInfo
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr DeviceGroupBindSparseInfo -> DeviceGroupBindSparseInfo -> IO ()
poke ptr :: Ptr DeviceGroupBindSparseInfo
ptr poked :: DeviceGroupBindSparseInfo
poked = Ptr DeviceGroupBindSparseInfo
-> DeviceGroupBindSparseInfo -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceGroupBindSparseInfo
ptr DeviceGroupBindSparseInfo
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero DeviceGroupBindSparseInfo where
zero :: DeviceGroupBindSparseInfo
zero = ("heapIndex" ::: Word32)
-> ("heapIndex" ::: Word32) -> DeviceGroupBindSparseInfo
DeviceGroupBindSparseInfo
"heapIndex" ::: Word32
forall a. Zero a => a
zero
"heapIndex" ::: Word32
forall a. Zero a => a
zero