{-# language CPP #-}
module Vulkan.Core11.Promoted_From_VK_KHR_descriptor_update_template ( createDescriptorUpdateTemplate
, withDescriptorUpdateTemplate
, destroyDescriptorUpdateTemplate
, updateDescriptorSetWithTemplate
, DescriptorUpdateTemplateEntry(..)
, DescriptorUpdateTemplateCreateInfo(..)
, DescriptorUpdateTemplate(..)
, DescriptorUpdateTemplateCreateFlags(..)
, StructureType(..)
, DescriptorUpdateTemplateType(..)
, ObjectType(..)
) where
import Vulkan.Internal.Utils (traceAroundEvent)
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.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Data.Coerce (coerce)
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.Typeable (Typeable)
import Foreign.C.Types (CSize)
import Foreign.C.Types (CSize(..))
import Foreign.C.Types (CSize(CSize))
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.Word (Word64)
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.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.Handles (DescriptorSet)
import Vulkan.Core10.Handles (DescriptorSet(..))
import Vulkan.Core10.Handles (DescriptorSetLayout)
import Vulkan.Core10.Enums.DescriptorType (DescriptorType)
import Vulkan.Core11.Handles (DescriptorUpdateTemplate)
import Vulkan.Core11.Handles (DescriptorUpdateTemplate(..))
import Vulkan.Core11.Enums.DescriptorUpdateTemplateCreateFlags (DescriptorUpdateTemplateCreateFlags)
import Vulkan.Core11.Enums.DescriptorUpdateTemplateType (DescriptorUpdateTemplateType)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Dynamic (DeviceCmds(pVkCreateDescriptorUpdateTemplate))
import Vulkan.Dynamic (DeviceCmds(pVkDestroyDescriptorUpdateTemplate))
import Vulkan.Dynamic (DeviceCmds(pVkUpdateDescriptorSetWithTemplate))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.Core10.Enums.PipelineBindPoint (PipelineBindPoint)
import Vulkan.Core10.Handles (PipelineLayout)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Core11.Handles (DescriptorUpdateTemplate(..))
import Vulkan.Core11.Enums.DescriptorUpdateTemplateCreateFlags (DescriptorUpdateTemplateCreateFlags(..))
import Vulkan.Core11.Enums.DescriptorUpdateTemplateType (DescriptorUpdateTemplateType(..))
import Vulkan.Core10.Enums.ObjectType (ObjectType(..))
import Vulkan.Core10.Enums.StructureType (StructureType(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCreateDescriptorUpdateTemplate
:: FunPtr (Ptr Device_T -> Ptr DescriptorUpdateTemplateCreateInfo -> Ptr AllocationCallbacks -> Ptr DescriptorUpdateTemplate -> IO Result) -> Ptr Device_T -> Ptr DescriptorUpdateTemplateCreateInfo -> Ptr AllocationCallbacks -> Ptr DescriptorUpdateTemplate -> IO Result
createDescriptorUpdateTemplate :: forall io
. (MonadIO io)
=>
Device
->
DescriptorUpdateTemplateCreateInfo
->
("allocator" ::: Maybe AllocationCallbacks)
-> io (DescriptorUpdateTemplate)
createDescriptorUpdateTemplate :: Device
-> DescriptorUpdateTemplateCreateInfo
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io DescriptorUpdateTemplate
createDescriptorUpdateTemplate device :: Device
device createInfo :: DescriptorUpdateTemplateCreateInfo
createInfo allocator :: "allocator" ::: Maybe AllocationCallbacks
allocator = IO DescriptorUpdateTemplate -> io DescriptorUpdateTemplate
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DescriptorUpdateTemplate -> io DescriptorUpdateTemplate)
-> (ContT DescriptorUpdateTemplate IO DescriptorUpdateTemplate
-> IO DescriptorUpdateTemplate)
-> ContT DescriptorUpdateTemplate IO DescriptorUpdateTemplate
-> io DescriptorUpdateTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT DescriptorUpdateTemplate IO DescriptorUpdateTemplate
-> IO DescriptorUpdateTemplate
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT DescriptorUpdateTemplate IO DescriptorUpdateTemplate
-> io DescriptorUpdateTemplate)
-> ContT DescriptorUpdateTemplate IO DescriptorUpdateTemplate
-> io DescriptorUpdateTemplate
forall a b. (a -> b) -> a -> b
$ do
let vkCreateDescriptorUpdateTemplatePtr :: FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO Result)
vkCreateDescriptorUpdateTemplatePtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO Result)
pVkCreateDescriptorUpdateTemplate (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
IO () -> ContT DescriptorUpdateTemplate IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT DescriptorUpdateTemplate IO ())
-> IO () -> ContT DescriptorUpdateTemplate IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO Result)
vkCreateDescriptorUpdateTemplatePtr FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO Result)
-> FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO Result)
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 vkCreateDescriptorUpdateTemplate is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCreateDescriptorUpdateTemplate' :: Ptr Device_T
-> ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO Result
vkCreateDescriptorUpdateTemplate' = FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO Result)
-> Ptr Device_T
-> ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO Result
mkVkCreateDescriptorUpdateTemplate FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO Result)
vkCreateDescriptorUpdateTemplatePtr
"pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
pCreateInfo <- ((("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> IO DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate)
-> ContT
DescriptorUpdateTemplate
IO
("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> IO DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate)
-> ContT
DescriptorUpdateTemplate
IO
("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo))
-> ((("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> IO DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate)
-> ContT
DescriptorUpdateTemplate
IO
("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
forall a b. (a -> b) -> a -> b
$ DescriptorUpdateTemplateCreateInfo
-> (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> IO DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (DescriptorUpdateTemplateCreateInfo
createInfo)
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT
DescriptorUpdateTemplate
IO
("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
Just j :: AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks)
-> IO DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate)
-> ContT
DescriptorUpdateTemplate
IO
("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks)
-> IO DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate)
-> ContT
DescriptorUpdateTemplate
IO
("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks)
-> IO DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate)
-> ContT
DescriptorUpdateTemplate
IO
("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks)
-> IO DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
"pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate
pPDescriptorUpdateTemplate <- ((("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate)
-> ContT
DescriptorUpdateTemplate
IO
("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate)
-> ContT
DescriptorUpdateTemplate
IO
("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate))
-> ((("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate)
-> ContT
DescriptorUpdateTemplate
IO
("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
forall a b. (a -> b) -> a -> b
$ IO ("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> (("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO ())
-> (("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int
-> IO
("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
forall a. Int -> IO (Ptr a)
callocBytes @DescriptorUpdateTemplate 8) ("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO ()
forall a. Ptr a -> IO ()
free
Result
r <- IO Result -> ContT DescriptorUpdateTemplate IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT DescriptorUpdateTemplate IO Result)
-> IO Result -> ContT DescriptorUpdateTemplate IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkCreateDescriptorUpdateTemplate" (Ptr Device_T
-> ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO Result
vkCreateDescriptorUpdateTemplate' (Device -> Ptr Device_T
deviceHandle (Device
device)) "pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
pCreateInfo "pAllocator" ::: Ptr AllocationCallbacks
pAllocator ("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate
pPDescriptorUpdateTemplate))
IO () -> ContT DescriptorUpdateTemplate IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT DescriptorUpdateTemplate IO ())
-> IO () -> ContT DescriptorUpdateTemplate IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
DescriptorUpdateTemplate
pDescriptorUpdateTemplate <- IO DescriptorUpdateTemplate
-> ContT DescriptorUpdateTemplate IO DescriptorUpdateTemplate
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO DescriptorUpdateTemplate
-> ContT DescriptorUpdateTemplate IO DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate
-> ContT DescriptorUpdateTemplate IO DescriptorUpdateTemplate
forall a b. (a -> b) -> a -> b
$ ("pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate)
-> IO DescriptorUpdateTemplate
forall a. Storable a => Ptr a -> IO a
peek @DescriptorUpdateTemplate "pDescriptorUpdateTemplate" ::: Ptr DescriptorUpdateTemplate
pPDescriptorUpdateTemplate
DescriptorUpdateTemplate
-> ContT DescriptorUpdateTemplate IO DescriptorUpdateTemplate
forall (f :: * -> *) a. Applicative f => a -> f a
pure (DescriptorUpdateTemplate
-> ContT DescriptorUpdateTemplate IO DescriptorUpdateTemplate)
-> DescriptorUpdateTemplate
-> ContT DescriptorUpdateTemplate IO DescriptorUpdateTemplate
forall a b. (a -> b) -> a -> b
$ (DescriptorUpdateTemplate
pDescriptorUpdateTemplate)
withDescriptorUpdateTemplate :: forall io r . MonadIO io => Device -> DescriptorUpdateTemplateCreateInfo -> Maybe AllocationCallbacks -> (io DescriptorUpdateTemplate -> (DescriptorUpdateTemplate -> io ()) -> r) -> r
withDescriptorUpdateTemplate :: Device
-> DescriptorUpdateTemplateCreateInfo
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io DescriptorUpdateTemplate
-> (DescriptorUpdateTemplate -> io ()) -> r)
-> r
withDescriptorUpdateTemplate device :: Device
device pCreateInfo :: DescriptorUpdateTemplateCreateInfo
pCreateInfo pAllocator :: "allocator" ::: Maybe AllocationCallbacks
pAllocator b :: io DescriptorUpdateTemplate
-> (DescriptorUpdateTemplate -> io ()) -> r
b =
io DescriptorUpdateTemplate
-> (DescriptorUpdateTemplate -> io ()) -> r
b (Device
-> DescriptorUpdateTemplateCreateInfo
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io DescriptorUpdateTemplate
forall (io :: * -> *).
MonadIO io =>
Device
-> DescriptorUpdateTemplateCreateInfo
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io DescriptorUpdateTemplate
createDescriptorUpdateTemplate Device
device DescriptorUpdateTemplateCreateInfo
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator)
(\(DescriptorUpdateTemplate
o0) -> Device
-> DescriptorUpdateTemplate
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
forall (io :: * -> *).
MonadIO io =>
Device
-> DescriptorUpdateTemplate
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyDescriptorUpdateTemplate Device
device DescriptorUpdateTemplate
o0 "allocator" ::: Maybe AllocationCallbacks
pAllocator)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkDestroyDescriptorUpdateTemplate
:: FunPtr (Ptr Device_T -> DescriptorUpdateTemplate -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> DescriptorUpdateTemplate -> Ptr AllocationCallbacks -> IO ()
destroyDescriptorUpdateTemplate :: forall io
. (MonadIO io)
=>
Device
->
DescriptorUpdateTemplate
->
("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyDescriptorUpdateTemplate :: Device
-> DescriptorUpdateTemplate
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyDescriptorUpdateTemplate device :: Device
device descriptorUpdateTemplate :: DescriptorUpdateTemplate
descriptorUpdateTemplate allocator :: "allocator" ::: Maybe AllocationCallbacks
allocator = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkDestroyDescriptorUpdateTemplatePtr :: FunPtr
(Ptr Device_T
-> DescriptorUpdateTemplate
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
vkDestroyDescriptorUpdateTemplatePtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> DescriptorUpdateTemplate
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
pVkDestroyDescriptorUpdateTemplate (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> DescriptorUpdateTemplate
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
vkDestroyDescriptorUpdateTemplatePtr FunPtr
(Ptr Device_T
-> DescriptorUpdateTemplate
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
-> FunPtr
(Ptr Device_T
-> DescriptorUpdateTemplate
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> DescriptorUpdateTemplate
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> 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 vkDestroyDescriptorUpdateTemplate is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkDestroyDescriptorUpdateTemplate' :: Ptr Device_T
-> DescriptorUpdateTemplate
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroyDescriptorUpdateTemplate' = FunPtr
(Ptr Device_T
-> DescriptorUpdateTemplate
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
-> Ptr Device_T
-> DescriptorUpdateTemplate
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
mkVkDestroyDescriptorUpdateTemplate FunPtr
(Ptr Device_T
-> DescriptorUpdateTemplate
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ())
vkDestroyDescriptorUpdateTemplatePtr
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
Just j :: AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ())
-> ContT () IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent "vkDestroyDescriptorUpdateTemplate" (Ptr Device_T
-> DescriptorUpdateTemplate
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroyDescriptorUpdateTemplate' (Device -> Ptr Device_T
deviceHandle (Device
device)) (DescriptorUpdateTemplate
descriptorUpdateTemplate) "pAllocator" ::: Ptr AllocationCallbacks
pAllocator)
() -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkUpdateDescriptorSetWithTemplate
:: FunPtr (Ptr Device_T -> DescriptorSet -> DescriptorUpdateTemplate -> Ptr () -> IO ()) -> Ptr Device_T -> DescriptorSet -> DescriptorUpdateTemplate -> Ptr () -> IO ()
updateDescriptorSetWithTemplate :: forall io
. (MonadIO io)
=>
Device
->
DescriptorSet
->
DescriptorUpdateTemplate
->
("data" ::: Ptr ())
-> io ()
updateDescriptorSetWithTemplate :: Device
-> DescriptorSet
-> DescriptorUpdateTemplate
-> ("data" ::: Ptr ())
-> io ()
updateDescriptorSetWithTemplate device :: Device
device descriptorSet :: DescriptorSet
descriptorSet descriptorUpdateTemplate :: DescriptorUpdateTemplate
descriptorUpdateTemplate data' :: "data" ::: Ptr ()
data' = 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 vkUpdateDescriptorSetWithTemplatePtr :: FunPtr
(Ptr Device_T
-> DescriptorSet
-> DescriptorUpdateTemplate
-> ("data" ::: Ptr ())
-> IO ())
vkUpdateDescriptorSetWithTemplatePtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> DescriptorSet
-> DescriptorUpdateTemplate
-> ("data" ::: Ptr ())
-> IO ())
pVkUpdateDescriptorSetWithTemplate (Device -> DeviceCmds
deviceCmds (Device
device :: Device))
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> DescriptorSet
-> DescriptorUpdateTemplate
-> ("data" ::: Ptr ())
-> IO ())
vkUpdateDescriptorSetWithTemplatePtr FunPtr
(Ptr Device_T
-> DescriptorSet
-> DescriptorUpdateTemplate
-> ("data" ::: Ptr ())
-> IO ())
-> FunPtr
(Ptr Device_T
-> DescriptorSet
-> DescriptorUpdateTemplate
-> ("data" ::: Ptr ())
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> DescriptorSet
-> DescriptorUpdateTemplate
-> ("data" ::: Ptr ())
-> 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 vkUpdateDescriptorSetWithTemplate is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkUpdateDescriptorSetWithTemplate' :: Ptr Device_T
-> DescriptorSet
-> DescriptorUpdateTemplate
-> ("data" ::: Ptr ())
-> IO ()
vkUpdateDescriptorSetWithTemplate' = FunPtr
(Ptr Device_T
-> DescriptorSet
-> DescriptorUpdateTemplate
-> ("data" ::: Ptr ())
-> IO ())
-> Ptr Device_T
-> DescriptorSet
-> DescriptorUpdateTemplate
-> ("data" ::: Ptr ())
-> IO ()
mkVkUpdateDescriptorSetWithTemplate FunPtr
(Ptr Device_T
-> DescriptorSet
-> DescriptorUpdateTemplate
-> ("data" ::: Ptr ())
-> IO ())
vkUpdateDescriptorSetWithTemplatePtr
String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent "vkUpdateDescriptorSetWithTemplate" (Ptr Device_T
-> DescriptorSet
-> DescriptorUpdateTemplate
-> ("data" ::: Ptr ())
-> IO ()
vkUpdateDescriptorSetWithTemplate' (Device -> Ptr Device_T
deviceHandle (Device
device)) (DescriptorSet
descriptorSet) (DescriptorUpdateTemplate
descriptorUpdateTemplate) ("data" ::: Ptr ()
data'))
() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> IO ()) -> () -> IO ()
forall a b. (a -> b) -> a -> b
$ ()
data DescriptorUpdateTemplateEntry = DescriptorUpdateTemplateEntry
{
DescriptorUpdateTemplateEntry -> Word32
dstBinding :: Word32
,
DescriptorUpdateTemplateEntry -> Word32
dstArrayElement :: Word32
,
DescriptorUpdateTemplateEntry -> Word32
descriptorCount :: Word32
,
DescriptorUpdateTemplateEntry -> DescriptorType
descriptorType :: DescriptorType
,
DescriptorUpdateTemplateEntry -> Word64
offset :: Word64
,
DescriptorUpdateTemplateEntry -> Word64
stride :: Word64
}
deriving (Typeable, DescriptorUpdateTemplateEntry
-> DescriptorUpdateTemplateEntry -> Bool
(DescriptorUpdateTemplateEntry
-> DescriptorUpdateTemplateEntry -> Bool)
-> (DescriptorUpdateTemplateEntry
-> DescriptorUpdateTemplateEntry -> Bool)
-> Eq DescriptorUpdateTemplateEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescriptorUpdateTemplateEntry
-> DescriptorUpdateTemplateEntry -> Bool
$c/= :: DescriptorUpdateTemplateEntry
-> DescriptorUpdateTemplateEntry -> Bool
== :: DescriptorUpdateTemplateEntry
-> DescriptorUpdateTemplateEntry -> Bool
$c== :: DescriptorUpdateTemplateEntry
-> DescriptorUpdateTemplateEntry -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DescriptorUpdateTemplateEntry)
#endif
deriving instance Show DescriptorUpdateTemplateEntry
instance ToCStruct DescriptorUpdateTemplateEntry where
withCStruct :: DescriptorUpdateTemplateEntry
-> (Ptr DescriptorUpdateTemplateEntry -> IO b) -> IO b
withCStruct x :: DescriptorUpdateTemplateEntry
x f :: Ptr DescriptorUpdateTemplateEntry -> IO b
f = Int -> Int -> (Ptr DescriptorUpdateTemplateEntry -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr DescriptorUpdateTemplateEntry -> IO b) -> IO b)
-> (Ptr DescriptorUpdateTemplateEntry -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr DescriptorUpdateTemplateEntry
p -> Ptr DescriptorUpdateTemplateEntry
-> DescriptorUpdateTemplateEntry -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DescriptorUpdateTemplateEntry
p DescriptorUpdateTemplateEntry
x (Ptr DescriptorUpdateTemplateEntry -> IO b
f Ptr DescriptorUpdateTemplateEntry
p)
pokeCStruct :: Ptr DescriptorUpdateTemplateEntry
-> DescriptorUpdateTemplateEntry -> IO b -> IO b
pokeCStruct p :: Ptr DescriptorUpdateTemplateEntry
p DescriptorUpdateTemplateEntry{..} f :: IO b
f = do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) (Word32
dstBinding)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32)) (Word32
dstArrayElement)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32)) (Word32
descriptorCount)
Ptr DescriptorType -> DescriptorType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr DescriptorType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr DescriptorType)) (DescriptorType
descriptorType)
Ptr CSize -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
offset))
Ptr CSize -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
stride))
IO b
f
cStructSize :: Int
cStructSize = 32
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr DescriptorUpdateTemplateEntry -> IO b -> IO b
pokeZeroCStruct p :: Ptr DescriptorUpdateTemplateEntry
p f :: IO b
f = do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr DescriptorType -> DescriptorType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr DescriptorType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr DescriptorType)) (DescriptorType
forall a. Zero a => a
zero)
Ptr CSize -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
forall a. Zero a => a
zero))
Ptr CSize -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct DescriptorUpdateTemplateEntry where
peekCStruct :: Ptr DescriptorUpdateTemplateEntry
-> IO DescriptorUpdateTemplateEntry
peekCStruct p :: Ptr DescriptorUpdateTemplateEntry
p = do
Word32
dstBinding <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32))
Word32
dstArrayElement <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32))
Word32
descriptorCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32))
DescriptorType
descriptorType <- Ptr DescriptorType -> IO DescriptorType
forall a. Storable a => Ptr a -> IO a
peek @DescriptorType ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr DescriptorType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr DescriptorType))
CSize
offset <- Ptr CSize -> IO CSize
forall a. Storable a => Ptr a -> IO a
peek @CSize ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr CSize))
CSize
stride <- Ptr CSize -> IO CSize
forall a. Storable a => Ptr a -> IO a
peek @CSize ((Ptr DescriptorUpdateTemplateEntry
p Ptr DescriptorUpdateTemplateEntry -> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr CSize))
DescriptorUpdateTemplateEntry -> IO DescriptorUpdateTemplateEntry
forall (f :: * -> *) a. Applicative f => a -> f a
pure (DescriptorUpdateTemplateEntry -> IO DescriptorUpdateTemplateEntry)
-> DescriptorUpdateTemplateEntry
-> IO DescriptorUpdateTemplateEntry
forall a b. (a -> b) -> a -> b
$ Word32
-> Word32
-> Word32
-> DescriptorType
-> Word64
-> Word64
-> DescriptorUpdateTemplateEntry
DescriptorUpdateTemplateEntry
Word32
dstBinding Word32
dstArrayElement Word32
descriptorCount DescriptorType
descriptorType (CSize -> Word64
forall a b. Coercible a b => a -> b
coerce @CSize @Word64 CSize
offset) (CSize -> Word64
forall a b. Coercible a b => a -> b
coerce @CSize @Word64 CSize
stride)
instance Storable DescriptorUpdateTemplateEntry where
sizeOf :: DescriptorUpdateTemplateEntry -> Int
sizeOf ~DescriptorUpdateTemplateEntry
_ = 32
alignment :: DescriptorUpdateTemplateEntry -> Int
alignment ~DescriptorUpdateTemplateEntry
_ = 8
peek :: Ptr DescriptorUpdateTemplateEntry
-> IO DescriptorUpdateTemplateEntry
peek = Ptr DescriptorUpdateTemplateEntry
-> IO DescriptorUpdateTemplateEntry
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr DescriptorUpdateTemplateEntry
-> DescriptorUpdateTemplateEntry -> IO ()
poke ptr :: Ptr DescriptorUpdateTemplateEntry
ptr poked :: DescriptorUpdateTemplateEntry
poked = Ptr DescriptorUpdateTemplateEntry
-> DescriptorUpdateTemplateEntry -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DescriptorUpdateTemplateEntry
ptr DescriptorUpdateTemplateEntry
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero DescriptorUpdateTemplateEntry where
zero :: DescriptorUpdateTemplateEntry
zero = Word32
-> Word32
-> Word32
-> DescriptorType
-> Word64
-> Word64
-> DescriptorUpdateTemplateEntry
DescriptorUpdateTemplateEntry
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
DescriptorType
forall a. Zero a => a
zero
Word64
forall a. Zero a => a
zero
Word64
forall a. Zero a => a
zero
data DescriptorUpdateTemplateCreateInfo = DescriptorUpdateTemplateCreateInfo
{
DescriptorUpdateTemplateCreateInfo
-> DescriptorUpdateTemplateCreateFlags
flags :: DescriptorUpdateTemplateCreateFlags
,
DescriptorUpdateTemplateCreateInfo
-> Vector DescriptorUpdateTemplateEntry
descriptorUpdateEntries :: Vector DescriptorUpdateTemplateEntry
,
DescriptorUpdateTemplateCreateInfo -> DescriptorUpdateTemplateType
templateType :: DescriptorUpdateTemplateType
,
DescriptorUpdateTemplateCreateInfo -> DescriptorSetLayout
descriptorSetLayout :: DescriptorSetLayout
,
DescriptorUpdateTemplateCreateInfo -> PipelineBindPoint
pipelineBindPoint :: PipelineBindPoint
,
DescriptorUpdateTemplateCreateInfo -> PipelineLayout
pipelineLayout :: PipelineLayout
,
DescriptorUpdateTemplateCreateInfo -> Word32
set :: Word32
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DescriptorUpdateTemplateCreateInfo)
#endif
deriving instance Show DescriptorUpdateTemplateCreateInfo
instance ToCStruct DescriptorUpdateTemplateCreateInfo where
withCStruct :: DescriptorUpdateTemplateCreateInfo
-> (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> IO b)
-> IO b
withCStruct x :: DescriptorUpdateTemplateCreateInfo
x f :: ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo) -> IO b
f = Int
-> Int
-> (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 72 8 ((("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> IO b)
-> IO b)
-> (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p -> ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> DescriptorUpdateTemplateCreateInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p DescriptorUpdateTemplateCreateInfo
x (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo) -> IO b
f "pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p)
pokeCStruct :: ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> DescriptorUpdateTemplateCreateInfo -> IO b -> IO b
pokeCStruct p :: "pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p DescriptorUpdateTemplateCreateInfo{..} 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 (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_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 ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: 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 DescriptorUpdateTemplateCreateFlags
-> DescriptorUpdateTemplateCreateFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr DescriptorUpdateTemplateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DescriptorUpdateTemplateCreateFlags)) (DescriptorUpdateTemplateCreateFlags
flags)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector DescriptorUpdateTemplateEntry -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector DescriptorUpdateTemplateEntry -> Int)
-> Vector DescriptorUpdateTemplateEntry -> Int
forall a b. (a -> b) -> a -> b
$ (Vector DescriptorUpdateTemplateEntry
descriptorUpdateEntries)) :: Word32))
Ptr DescriptorUpdateTemplateEntry
pPDescriptorUpdateEntries' <- ((Ptr DescriptorUpdateTemplateEntry -> IO b) -> IO b)
-> ContT b IO (Ptr DescriptorUpdateTemplateEntry)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr DescriptorUpdateTemplateEntry -> IO b) -> IO b)
-> ContT b IO (Ptr DescriptorUpdateTemplateEntry))
-> ((Ptr DescriptorUpdateTemplateEntry -> IO b) -> IO b)
-> ContT b IO (Ptr DescriptorUpdateTemplateEntry)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr DescriptorUpdateTemplateEntry -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @DescriptorUpdateTemplateEntry ((Vector DescriptorUpdateTemplateEntry -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector DescriptorUpdateTemplateEntry
descriptorUpdateEntries)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 32) 8
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> DescriptorUpdateTemplateEntry -> IO ())
-> Vector DescriptorUpdateTemplateEntry -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: DescriptorUpdateTemplateEntry
e -> Ptr DescriptorUpdateTemplateEntry
-> DescriptorUpdateTemplateEntry -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DescriptorUpdateTemplateEntry
pPDescriptorUpdateEntries' Ptr DescriptorUpdateTemplateEntry
-> Int -> Ptr DescriptorUpdateTemplateEntry
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (32 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DescriptorUpdateTemplateEntry) (DescriptorUpdateTemplateEntry
e)) (Vector DescriptorUpdateTemplateEntry
descriptorUpdateEntries)
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 DescriptorUpdateTemplateEntry)
-> Ptr DescriptorUpdateTemplateEntry -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr (Ptr DescriptorUpdateTemplateEntry)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr DescriptorUpdateTemplateEntry))) (Ptr DescriptorUpdateTemplateEntry
pPDescriptorUpdateEntries')
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 DescriptorUpdateTemplateType
-> DescriptorUpdateTemplateType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr DescriptorUpdateTemplateType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr DescriptorUpdateTemplateType)) (DescriptorUpdateTemplateType
templateType)
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 DescriptorSetLayout -> DescriptorSetLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr DescriptorSetLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr DescriptorSetLayout)) (DescriptorSetLayout
descriptorSetLayout)
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 PipelineBindPoint -> PipelineBindPoint -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr PipelineBindPoint
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr PipelineBindPoint)) (PipelineBindPoint
pipelineBindPoint)
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 PipelineLayout -> PipelineLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr PipelineLayout)) (PipelineLayout
pipelineLayout)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 64 :: Ptr Word32)) (Word32
set)
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = 72
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> IO b -> IO b
pokeZeroCStruct p :: "pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
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 (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_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 ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr DescriptorUpdateTemplateEntry
pPDescriptorUpdateEntries' <- ((Ptr DescriptorUpdateTemplateEntry -> IO b) -> IO b)
-> ContT b IO (Ptr DescriptorUpdateTemplateEntry)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr DescriptorUpdateTemplateEntry -> IO b) -> IO b)
-> ContT b IO (Ptr DescriptorUpdateTemplateEntry))
-> ((Ptr DescriptorUpdateTemplateEntry -> IO b) -> IO b)
-> ContT b IO (Ptr DescriptorUpdateTemplateEntry)
forall a b. (a -> b) -> a -> b
$ Int -> Int -> (Ptr DescriptorUpdateTemplateEntry -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @DescriptorUpdateTemplateEntry ((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
* 32) 8
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> DescriptorUpdateTemplateEntry -> IO ())
-> Vector DescriptorUpdateTemplateEntry -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\i :: Int
i e :: DescriptorUpdateTemplateEntry
e -> Ptr DescriptorUpdateTemplateEntry
-> DescriptorUpdateTemplateEntry -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DescriptorUpdateTemplateEntry
pPDescriptorUpdateEntries' Ptr DescriptorUpdateTemplateEntry
-> Int -> Ptr DescriptorUpdateTemplateEntry
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (32 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DescriptorUpdateTemplateEntry) (DescriptorUpdateTemplateEntry
e)) (Vector DescriptorUpdateTemplateEntry
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 DescriptorUpdateTemplateEntry)
-> Ptr DescriptorUpdateTemplateEntry -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr (Ptr DescriptorUpdateTemplateEntry)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr DescriptorUpdateTemplateEntry))) (Ptr DescriptorUpdateTemplateEntry
pPDescriptorUpdateEntries')
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 DescriptorUpdateTemplateType
-> DescriptorUpdateTemplateType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr DescriptorUpdateTemplateType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr DescriptorUpdateTemplateType)) (DescriptorUpdateTemplateType
forall a. Zero a => a
zero)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DescriptorSetLayout -> DescriptorSetLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr DescriptorSetLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr DescriptorSetLayout)) (DescriptorSetLayout
forall a. Zero a => a
zero)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineBindPoint -> PipelineBindPoint -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr PipelineBindPoint
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr PipelineBindPoint)) (PipelineBindPoint
forall a. Zero a => a
zero)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr PipelineLayout -> PipelineLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr PipelineLayout)) (PipelineLayout
forall a. Zero a => a
zero)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 64 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
instance FromCStruct DescriptorUpdateTemplateCreateInfo where
peekCStruct :: ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> IO DescriptorUpdateTemplateCreateInfo
peekCStruct p :: "pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p = do
DescriptorUpdateTemplateCreateFlags
flags <- Ptr DescriptorUpdateTemplateCreateFlags
-> IO DescriptorUpdateTemplateCreateFlags
forall a. Storable a => Ptr a -> IO a
peek @DescriptorUpdateTemplateCreateFlags (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr DescriptorUpdateTemplateCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr DescriptorUpdateTemplateCreateFlags))
Word32
descriptorUpdateEntryCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32))
Ptr DescriptorUpdateTemplateEntry
pDescriptorUpdateEntries <- Ptr (Ptr DescriptorUpdateTemplateEntry)
-> IO (Ptr DescriptorUpdateTemplateEntry)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr DescriptorUpdateTemplateEntry) (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr (Ptr DescriptorUpdateTemplateEntry)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr DescriptorUpdateTemplateEntry)))
Vector DescriptorUpdateTemplateEntry
pDescriptorUpdateEntries' <- Int
-> (Int -> IO DescriptorUpdateTemplateEntry)
-> IO (Vector DescriptorUpdateTemplateEntry)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
descriptorUpdateEntryCount) (\i :: Int
i -> Ptr DescriptorUpdateTemplateEntry
-> IO DescriptorUpdateTemplateEntry
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DescriptorUpdateTemplateEntry ((Ptr DescriptorUpdateTemplateEntry
pDescriptorUpdateEntries Ptr DescriptorUpdateTemplateEntry
-> Int -> Ptr DescriptorUpdateTemplateEntry
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (32 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DescriptorUpdateTemplateEntry)))
DescriptorUpdateTemplateType
templateType <- Ptr DescriptorUpdateTemplateType -> IO DescriptorUpdateTemplateType
forall a. Storable a => Ptr a -> IO a
peek @DescriptorUpdateTemplateType (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr DescriptorUpdateTemplateType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr DescriptorUpdateTemplateType))
DescriptorSetLayout
descriptorSetLayout <- Ptr DescriptorSetLayout -> IO DescriptorSetLayout
forall a. Storable a => Ptr a -> IO a
peek @DescriptorSetLayout (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr DescriptorSetLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr DescriptorSetLayout))
PipelineBindPoint
pipelineBindPoint <- Ptr PipelineBindPoint -> IO PipelineBindPoint
forall a. Storable a => Ptr a -> IO a
peek @PipelineBindPoint (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr PipelineBindPoint
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr PipelineBindPoint))
PipelineLayout
pipelineLayout <- Ptr PipelineLayout -> IO PipelineLayout
forall a. Storable a => Ptr a -> IO a
peek @PipelineLayout (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr PipelineLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr PipelineLayout))
Word32
set <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo
p ("pCreateInfo" ::: Ptr DescriptorUpdateTemplateCreateInfo)
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 64 :: Ptr Word32))
DescriptorUpdateTemplateCreateInfo
-> IO DescriptorUpdateTemplateCreateInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (DescriptorUpdateTemplateCreateInfo
-> IO DescriptorUpdateTemplateCreateInfo)
-> DescriptorUpdateTemplateCreateInfo
-> IO DescriptorUpdateTemplateCreateInfo
forall a b. (a -> b) -> a -> b
$ DescriptorUpdateTemplateCreateFlags
-> Vector DescriptorUpdateTemplateEntry
-> DescriptorUpdateTemplateType
-> DescriptorSetLayout
-> PipelineBindPoint
-> PipelineLayout
-> Word32
-> DescriptorUpdateTemplateCreateInfo
DescriptorUpdateTemplateCreateInfo
DescriptorUpdateTemplateCreateFlags
flags Vector DescriptorUpdateTemplateEntry
pDescriptorUpdateEntries' DescriptorUpdateTemplateType
templateType DescriptorSetLayout
descriptorSetLayout PipelineBindPoint
pipelineBindPoint PipelineLayout
pipelineLayout Word32
set
instance Zero DescriptorUpdateTemplateCreateInfo where
zero :: DescriptorUpdateTemplateCreateInfo
zero = DescriptorUpdateTemplateCreateFlags
-> Vector DescriptorUpdateTemplateEntry
-> DescriptorUpdateTemplateType
-> DescriptorSetLayout
-> PipelineBindPoint
-> PipelineLayout
-> Word32
-> DescriptorUpdateTemplateCreateInfo
DescriptorUpdateTemplateCreateInfo
DescriptorUpdateTemplateCreateFlags
forall a. Zero a => a
zero
Vector DescriptorUpdateTemplateEntry
forall a. Monoid a => a
mempty
DescriptorUpdateTemplateType
forall a. Zero a => a
zero
DescriptorSetLayout
forall a. Zero a => a
zero
PipelineBindPoint
forall a. Zero a => a
zero
PipelineLayout
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero