{-# language CPP #-}
module Vulkan.Core14.Promoted_From_VK_KHR_maintenance6AdditionalFunctionality' ( cmdBindDescriptorSets2
, cmdPushConstants2
, cmdPushDescriptorSet2
, cmdPushDescriptorSetWithTemplate2
, PhysicalDeviceMaintenance6Features(..)
, PhysicalDeviceMaintenance6Properties(..)
, BindMemoryStatus(..)
, BindDescriptorSetsInfo(..)
, PushConstantsInfo(..)
, PushDescriptorSetInfo(..)
, PushDescriptorSetWithTemplateInfo(..)
, StructureType(..)
) where
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytes)
import GHC.IO (throwIO)
import GHC.Ptr (castPtr)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import qualified Data.Vector (null)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.Type.Equality ((:~:)(Refl))
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.CStruct.Extends (peekSomeCStruct)
import Vulkan.CStruct.Extends (pokeSomeCStruct)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.CStruct.Extends (Chain)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer(CommandBuffer))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Core10.Handles (DescriptorSet)
import Vulkan.Core11.Handles (DescriptorUpdateTemplate)
import Vulkan.Dynamic (DeviceCmds(pVkCmdBindDescriptorSets2))
import Vulkan.Dynamic (DeviceCmds(pVkCmdPushConstants2))
import Vulkan.Dynamic (DeviceCmds(pVkCmdPushDescriptorSet2))
import Vulkan.Dynamic (DeviceCmds(pVkCmdPushDescriptorSetWithTemplate2))
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PeekChain(..))
import Vulkan.Core10.Handles (PipelineLayout)
import {-# SOURCE #-} Vulkan.Core10.PipelineLayout (PipelineLayoutCreateInfo)
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import {-# SOURCE #-} Vulkan.Extensions.VK_NV_push_constant_bank (PushConstantBankInfoNV)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlags)
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.DescriptorSet (WriteDescriptorSet)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BIND_MEMORY_STATUS))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PUSH_CONSTANTS_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdBindDescriptorSets2
:: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ()
cmdBindDescriptorSets2 :: forall a io
. ( Extendss BindDescriptorSetsInfo a
, PokeChain a
, MonadIO io )
=>
CommandBuffer
->
(BindDescriptorSetsInfo a)
-> io ()
cmdBindDescriptorSets2 :: forall (a :: [*]) (io :: * -> *).
(Extendss BindDescriptorSetsInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> BindDescriptorSetsInfo a -> io ()
cmdBindDescriptorSets2 CommandBuffer
commandBuffer
BindDescriptorSetsInfo a
bindDescriptorSetsInfo = IO () -> io ()
forall a. IO a -> io a
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 vkCmdBindDescriptorSets2Ptr :: FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ())
vkCmdBindDescriptorSets2Ptr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ())
pVkCmdBindDescriptorSets2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ())
vkCmdBindDescriptorSets2Ptr FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. (HasCallStack, 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 String
"" String
"The function pointer for vkCmdBindDescriptorSets2 is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdBindDescriptorSets2' :: Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ()
vkCmdBindDescriptorSets2' = FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ())
-> Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorSetsInfo)
-> IO ()
mkVkCmdBindDescriptorSets2 FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct BindDescriptorSetsInfo) -> IO ())
vkCmdBindDescriptorSets2Ptr
pBindDescriptorSetsInfo <- ((Ptr (BindDescriptorSetsInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (BindDescriptorSetsInfo a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (BindDescriptorSetsInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (BindDescriptorSetsInfo a)))
-> ((Ptr (BindDescriptorSetsInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (BindDescriptorSetsInfo a))
forall a b. (a -> b) -> a -> b
$ BindDescriptorSetsInfo a
-> (Ptr (BindDescriptorSetsInfo a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
BindDescriptorSetsInfo a
-> (Ptr (BindDescriptorSetsInfo a) -> IO b) -> IO b
withCStruct (BindDescriptorSetsInfo a
bindDescriptorSetsInfo)
lift $ traceAroundEvent "vkCmdBindDescriptorSets2" (vkCmdBindDescriptorSets2'
(commandBufferHandle (commandBuffer))
(forgetExtensions pBindDescriptorSetsInfo))
pure $ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdPushConstants2
:: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct PushConstantsInfo) -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct PushConstantsInfo) -> IO ()
cmdPushConstants2 :: forall a io
. (Extendss PushConstantsInfo a, PokeChain a, MonadIO io)
=>
CommandBuffer
->
(PushConstantsInfo a)
-> io ()
cmdPushConstants2 :: forall (a :: [*]) (io :: * -> *).
(Extendss PushConstantsInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> PushConstantsInfo a -> io ()
cmdPushConstants2 CommandBuffer
commandBuffer PushConstantsInfo a
pushConstantsInfo = IO () -> io ()
forall a. IO a -> io a
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 vkCmdPushConstants2Ptr :: FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushConstantsInfo) -> IO ())
vkCmdPushConstants2Ptr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushConstantsInfo) -> IO ())
pVkCmdPushConstants2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushConstantsInfo) -> IO ())
vkCmdPushConstants2Ptr FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushConstantsInfo) -> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushConstantsInfo) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushConstantsInfo) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. (HasCallStack, 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 String
"" String
"The function pointer for vkCmdPushConstants2 is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdPushConstants2' :: Ptr CommandBuffer_T -> Ptr (SomeStruct PushConstantsInfo) -> IO ()
vkCmdPushConstants2' = FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushConstantsInfo) -> IO ())
-> Ptr CommandBuffer_T
-> Ptr (SomeStruct PushConstantsInfo)
-> IO ()
mkVkCmdPushConstants2 FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushConstantsInfo) -> IO ())
vkCmdPushConstants2Ptr
pPushConstantsInfo <- ((Ptr (PushConstantsInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushConstantsInfo a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (PushConstantsInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushConstantsInfo a)))
-> ((Ptr (PushConstantsInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushConstantsInfo a))
forall a b. (a -> b) -> a -> b
$ PushConstantsInfo a
-> (Ptr (PushConstantsInfo a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PushConstantsInfo a -> (Ptr (PushConstantsInfo a) -> IO b) -> IO b
withCStruct (PushConstantsInfo a
pushConstantsInfo)
lift $ traceAroundEvent "vkCmdPushConstants2" (vkCmdPushConstants2'
(commandBufferHandle (commandBuffer))
(forgetExtensions pPushConstantsInfo))
pure $ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdPushDescriptorSet2
:: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ()
cmdPushDescriptorSet2 :: forall a io
. ( Extendss PushDescriptorSetInfo a
, PokeChain a
, MonadIO io )
=>
CommandBuffer
->
(PushDescriptorSetInfo a)
-> io ()
cmdPushDescriptorSet2 :: forall (a :: [*]) (io :: * -> *).
(Extendss PushDescriptorSetInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> PushDescriptorSetInfo a -> io ()
cmdPushDescriptorSet2 CommandBuffer
commandBuffer
PushDescriptorSetInfo a
pushDescriptorSetInfo = IO () -> io ()
forall a. IO a -> io a
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 vkCmdPushDescriptorSet2Ptr :: FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ())
vkCmdPushDescriptorSet2Ptr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ())
pVkCmdPushDescriptorSet2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ())
vkCmdPushDescriptorSet2Ptr FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. (HasCallStack, 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 String
"" String
"The function pointer for vkCmdPushDescriptorSet2 is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdPushDescriptorSet2' :: Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ()
vkCmdPushDescriptorSet2' = FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ())
-> Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetInfo)
-> IO ()
mkVkCmdPushDescriptorSet2 FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetInfo) -> IO ())
vkCmdPushDescriptorSet2Ptr
pPushDescriptorSetInfo <- ((Ptr (PushDescriptorSetInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushDescriptorSetInfo a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (PushDescriptorSetInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushDescriptorSetInfo a)))
-> ((Ptr (PushDescriptorSetInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushDescriptorSetInfo a))
forall a b. (a -> b) -> a -> b
$ PushDescriptorSetInfo a
-> (Ptr (PushDescriptorSetInfo a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PushDescriptorSetInfo a
-> (Ptr (PushDescriptorSetInfo a) -> IO b) -> IO b
withCStruct (PushDescriptorSetInfo a
pushDescriptorSetInfo)
lift $ traceAroundEvent "vkCmdPushDescriptorSet2" (vkCmdPushDescriptorSet2'
(commandBufferHandle (commandBuffer))
(forgetExtensions pPushDescriptorSetInfo))
pure $ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdPushDescriptorSetWithTemplate2
:: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ()
cmdPushDescriptorSetWithTemplate2 :: forall a io
. ( Extendss PushDescriptorSetWithTemplateInfo a
, PokeChain a
, MonadIO io )
=>
CommandBuffer
->
(PushDescriptorSetWithTemplateInfo a)
-> io ()
cmdPushDescriptorSetWithTemplate2 :: forall (a :: [*]) (io :: * -> *).
(Extendss PushDescriptorSetWithTemplateInfo a, PokeChain a,
MonadIO io) =>
CommandBuffer -> PushDescriptorSetWithTemplateInfo a -> io ()
cmdPushDescriptorSetWithTemplate2 CommandBuffer
commandBuffer
PushDescriptorSetWithTemplateInfo a
pushDescriptorSetWithTemplateInfo = IO () -> io ()
forall a. IO a -> io a
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 vkCmdPushDescriptorSetWithTemplate2Ptr :: FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ())
vkCmdPushDescriptorSetWithTemplate2Ptr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ())
pVkCmdPushDescriptorSetWithTemplate2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ())
vkCmdPushDescriptorSetWithTemplate2Ptr FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. (HasCallStack, 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 String
"" String
"The function pointer for vkCmdPushDescriptorSetWithTemplate2 is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdPushDescriptorSetWithTemplate2' :: Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ()
vkCmdPushDescriptorSetWithTemplate2' = FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ())
-> Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo)
-> IO ()
mkVkCmdPushDescriptorSetWithTemplate2 FunPtr
(Ptr CommandBuffer_T
-> Ptr (SomeStruct PushDescriptorSetWithTemplateInfo) -> IO ())
vkCmdPushDescriptorSetWithTemplate2Ptr
pPushDescriptorSetWithTemplateInfo <- ((Ptr (PushDescriptorSetWithTemplateInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushDescriptorSetWithTemplateInfo a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (PushDescriptorSetWithTemplateInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushDescriptorSetWithTemplateInfo a)))
-> ((Ptr (PushDescriptorSetWithTemplateInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (PushDescriptorSetWithTemplateInfo a))
forall a b. (a -> b) -> a -> b
$ PushDescriptorSetWithTemplateInfo a
-> (Ptr (PushDescriptorSetWithTemplateInfo a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PushDescriptorSetWithTemplateInfo a
-> (Ptr (PushDescriptorSetWithTemplateInfo a) -> IO b) -> IO b
withCStruct (PushDescriptorSetWithTemplateInfo a
pushDescriptorSetWithTemplateInfo)
lift $ traceAroundEvent "vkCmdPushDescriptorSetWithTemplate2" (vkCmdPushDescriptorSetWithTemplate2'
(commandBufferHandle (commandBuffer))
(forgetExtensions pPushDescriptorSetWithTemplateInfo))
pure $ ()
data PhysicalDeviceMaintenance6Features = PhysicalDeviceMaintenance6Features
{
PhysicalDeviceMaintenance6Features -> Bool
maintenance6 :: Bool }
deriving (Typeable, PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> Bool
(PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> Bool)
-> (PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> Bool)
-> Eq PhysicalDeviceMaintenance6Features
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> Bool
== :: PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> Bool
$c/= :: PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> Bool
/= :: PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceMaintenance6Features)
#endif
deriving instance Show PhysicalDeviceMaintenance6Features
instance ToCStruct PhysicalDeviceMaintenance6Features where
withCStruct :: forall b.
PhysicalDeviceMaintenance6Features
-> (Ptr PhysicalDeviceMaintenance6Features -> IO b) -> IO b
withCStruct PhysicalDeviceMaintenance6Features
x Ptr PhysicalDeviceMaintenance6Features -> IO b
f = Int -> (Ptr PhysicalDeviceMaintenance6Features -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceMaintenance6Features -> IO b) -> IO b)
-> (Ptr PhysicalDeviceMaintenance6Features -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceMaintenance6Features
p -> Ptr PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> IO b -> IO b
forall b.
Ptr PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance6Features
p PhysicalDeviceMaintenance6Features
x (Ptr PhysicalDeviceMaintenance6Features -> IO b
f Ptr PhysicalDeviceMaintenance6Features
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance6Features
p PhysicalDeviceMaintenance6Features{Bool
maintenance6 :: PhysicalDeviceMaintenance6Features -> Bool
maintenance6 :: Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Features
p Ptr PhysicalDeviceMaintenance6Features -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Features
p Ptr PhysicalDeviceMaintenance6Features -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Features
p Ptr PhysicalDeviceMaintenance6Features -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
maintenance6))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr PhysicalDeviceMaintenance6Features -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceMaintenance6Features
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Features
p Ptr PhysicalDeviceMaintenance6Features -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Features
p Ptr PhysicalDeviceMaintenance6Features -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Features
p Ptr PhysicalDeviceMaintenance6Features -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceMaintenance6Features where
peekCStruct :: Ptr PhysicalDeviceMaintenance6Features
-> IO PhysicalDeviceMaintenance6Features
peekCStruct Ptr PhysicalDeviceMaintenance6Features
p = do
maintenance6 <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceMaintenance6Features
p Ptr PhysicalDeviceMaintenance6Features -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
pure $ PhysicalDeviceMaintenance6Features
(bool32ToBool maintenance6)
instance Storable PhysicalDeviceMaintenance6Features where
sizeOf :: PhysicalDeviceMaintenance6Features -> Int
sizeOf ~PhysicalDeviceMaintenance6Features
_ = Int
24
alignment :: PhysicalDeviceMaintenance6Features -> Int
alignment ~PhysicalDeviceMaintenance6Features
_ = Int
8
peek :: Ptr PhysicalDeviceMaintenance6Features
-> IO PhysicalDeviceMaintenance6Features
peek = Ptr PhysicalDeviceMaintenance6Features
-> IO PhysicalDeviceMaintenance6Features
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> IO ()
poke Ptr PhysicalDeviceMaintenance6Features
ptr PhysicalDeviceMaintenance6Features
poked = Ptr PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> IO () -> IO ()
forall b.
Ptr PhysicalDeviceMaintenance6Features
-> PhysicalDeviceMaintenance6Features -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance6Features
ptr PhysicalDeviceMaintenance6Features
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceMaintenance6Features where
zero :: PhysicalDeviceMaintenance6Features
zero = Bool -> PhysicalDeviceMaintenance6Features
PhysicalDeviceMaintenance6Features
Bool
forall a. Zero a => a
zero
data PhysicalDeviceMaintenance6Properties = PhysicalDeviceMaintenance6Properties
{
PhysicalDeviceMaintenance6Properties -> Bool
blockTexelViewCompatibleMultipleLayers :: Bool
,
PhysicalDeviceMaintenance6Properties -> Word32
maxCombinedImageSamplerDescriptorCount :: Word32
,
PhysicalDeviceMaintenance6Properties -> Bool
fragmentShadingRateClampCombinerInputs :: Bool
}
deriving (Typeable, PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> Bool
(PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> Bool)
-> (PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> Bool)
-> Eq PhysicalDeviceMaintenance6Properties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> Bool
== :: PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> Bool
$c/= :: PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> Bool
/= :: PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceMaintenance6Properties)
#endif
deriving instance Show PhysicalDeviceMaintenance6Properties
instance ToCStruct PhysicalDeviceMaintenance6Properties where
withCStruct :: forall b.
PhysicalDeviceMaintenance6Properties
-> (Ptr PhysicalDeviceMaintenance6Properties -> IO b) -> IO b
withCStruct PhysicalDeviceMaintenance6Properties
x Ptr PhysicalDeviceMaintenance6Properties -> IO b
f = Int -> (Ptr PhysicalDeviceMaintenance6Properties -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr PhysicalDeviceMaintenance6Properties -> IO b) -> IO b)
-> (Ptr PhysicalDeviceMaintenance6Properties -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceMaintenance6Properties
p -> Ptr PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> IO b -> IO b
forall b.
Ptr PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance6Properties
p PhysicalDeviceMaintenance6Properties
x (Ptr PhysicalDeviceMaintenance6Properties -> IO b
f Ptr PhysicalDeviceMaintenance6Properties
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance6Properties
p PhysicalDeviceMaintenance6Properties{Bool
Word32
blockTexelViewCompatibleMultipleLayers :: PhysicalDeviceMaintenance6Properties -> Bool
maxCombinedImageSamplerDescriptorCount :: PhysicalDeviceMaintenance6Properties -> Word32
fragmentShadingRateClampCombinerInputs :: PhysicalDeviceMaintenance6Properties -> Bool
blockTexelViewCompatibleMultipleLayers :: Bool
maxCombinedImageSamplerDescriptorCount :: Word32
fragmentShadingRateClampCombinerInputs :: Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
blockTexelViewCompatibleMultipleLayers))
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (Word32
maxCombinedImageSamplerDescriptorCount)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentShadingRateClampCombinerInputs))
IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr PhysicalDeviceMaintenance6Properties -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceMaintenance6Properties
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceMaintenance6Properties where
peekCStruct :: Ptr PhysicalDeviceMaintenance6Properties
-> IO PhysicalDeviceMaintenance6Properties
peekCStruct Ptr PhysicalDeviceMaintenance6Properties
p = do
blockTexelViewCompatibleMultipleLayers <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceMaintenance6Properties
p Ptr PhysicalDeviceMaintenance6Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
maxCombinedImageSamplerDescriptorCount <- peek @Word32 ((p `plusPtr` 20 :: Ptr Word32))
fragmentShadingRateClampCombinerInputs <- peek @Bool32 ((p `plusPtr` 24 :: Ptr Bool32))
pure $ PhysicalDeviceMaintenance6Properties
(bool32ToBool blockTexelViewCompatibleMultipleLayers)
maxCombinedImageSamplerDescriptorCount
(bool32ToBool fragmentShadingRateClampCombinerInputs)
instance Storable PhysicalDeviceMaintenance6Properties where
sizeOf :: PhysicalDeviceMaintenance6Properties -> Int
sizeOf ~PhysicalDeviceMaintenance6Properties
_ = Int
32
alignment :: PhysicalDeviceMaintenance6Properties -> Int
alignment ~PhysicalDeviceMaintenance6Properties
_ = Int
8
peek :: Ptr PhysicalDeviceMaintenance6Properties
-> IO PhysicalDeviceMaintenance6Properties
peek = Ptr PhysicalDeviceMaintenance6Properties
-> IO PhysicalDeviceMaintenance6Properties
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> IO ()
poke Ptr PhysicalDeviceMaintenance6Properties
ptr PhysicalDeviceMaintenance6Properties
poked = Ptr PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> IO () -> IO ()
forall b.
Ptr PhysicalDeviceMaintenance6Properties
-> PhysicalDeviceMaintenance6Properties -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance6Properties
ptr PhysicalDeviceMaintenance6Properties
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceMaintenance6Properties where
zero :: PhysicalDeviceMaintenance6Properties
zero = Bool -> Word32 -> Bool -> PhysicalDeviceMaintenance6Properties
PhysicalDeviceMaintenance6Properties
Bool
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
data BindMemoryStatus = BindMemoryStatus
{
BindMemoryStatus -> Ptr Result
result :: Ptr Result }
deriving (Typeable, BindMemoryStatus -> BindMemoryStatus -> Bool
(BindMemoryStatus -> BindMemoryStatus -> Bool)
-> (BindMemoryStatus -> BindMemoryStatus -> Bool)
-> Eq BindMemoryStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BindMemoryStatus -> BindMemoryStatus -> Bool
== :: BindMemoryStatus -> BindMemoryStatus -> Bool
$c/= :: BindMemoryStatus -> BindMemoryStatus -> Bool
/= :: BindMemoryStatus -> BindMemoryStatus -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BindMemoryStatus)
#endif
deriving instance Show BindMemoryStatus
instance ToCStruct BindMemoryStatus where
withCStruct :: forall b.
BindMemoryStatus -> (Ptr BindMemoryStatus -> IO b) -> IO b
withCStruct BindMemoryStatus
x Ptr BindMemoryStatus -> IO b
f = Int -> (Ptr BindMemoryStatus -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr BindMemoryStatus -> IO b) -> IO b)
-> (Ptr BindMemoryStatus -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr BindMemoryStatus
p -> Ptr BindMemoryStatus -> BindMemoryStatus -> IO b -> IO b
forall b. Ptr BindMemoryStatus -> BindMemoryStatus -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindMemoryStatus
p BindMemoryStatus
x (Ptr BindMemoryStatus -> IO b
f Ptr BindMemoryStatus
p)
pokeCStruct :: forall b. Ptr BindMemoryStatus -> BindMemoryStatus -> IO b -> IO b
pokeCStruct Ptr BindMemoryStatus
p BindMemoryStatus{Ptr Result
result :: BindMemoryStatus -> Ptr Result
result :: Ptr Result
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindMemoryStatus
p Ptr BindMemoryStatus -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_MEMORY_STATUS)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindMemoryStatus
p Ptr BindMemoryStatus -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr (Ptr Result) -> Ptr Result -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindMemoryStatus
p Ptr BindMemoryStatus -> Int -> Ptr (Ptr Result)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Result))) (Ptr Result
result)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr BindMemoryStatus -> IO b -> IO b
pokeZeroCStruct Ptr BindMemoryStatus
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindMemoryStatus
p Ptr BindMemoryStatus -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_MEMORY_STATUS)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindMemoryStatus
p Ptr BindMemoryStatus -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr (Ptr Result) -> Ptr Result -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindMemoryStatus
p Ptr BindMemoryStatus -> Int -> Ptr (Ptr Result)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Result))) (Ptr Result
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct BindMemoryStatus where
peekCStruct :: Ptr BindMemoryStatus -> IO BindMemoryStatus
peekCStruct Ptr BindMemoryStatus
p = do
pResult <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Result) ((Ptr BindMemoryStatus
p Ptr BindMemoryStatus -> Int -> Ptr (Ptr Result)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Result)))
pure $ BindMemoryStatus
pResult
instance Storable BindMemoryStatus where
sizeOf :: BindMemoryStatus -> Int
sizeOf ~BindMemoryStatus
_ = Int
24
alignment :: BindMemoryStatus -> Int
alignment ~BindMemoryStatus
_ = Int
8
peek :: Ptr BindMemoryStatus -> IO BindMemoryStatus
peek = Ptr BindMemoryStatus -> IO BindMemoryStatus
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr BindMemoryStatus -> BindMemoryStatus -> IO ()
poke Ptr BindMemoryStatus
ptr BindMemoryStatus
poked = Ptr BindMemoryStatus -> BindMemoryStatus -> IO () -> IO ()
forall b. Ptr BindMemoryStatus -> BindMemoryStatus -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindMemoryStatus
ptr BindMemoryStatus
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero BindMemoryStatus where
zero :: BindMemoryStatus
zero = Ptr Result -> BindMemoryStatus
BindMemoryStatus
Ptr Result
forall a. Zero a => a
zero
data BindDescriptorSetsInfo (es :: [Type]) = BindDescriptorSetsInfo
{
forall (es :: [*]). BindDescriptorSetsInfo es -> Chain es
next :: Chain es
,
forall (es :: [*]). BindDescriptorSetsInfo es -> ShaderStageFlags
stageFlags :: ShaderStageFlags
,
forall (es :: [*]). BindDescriptorSetsInfo es -> PipelineLayout
layout :: PipelineLayout
,
forall (es :: [*]). BindDescriptorSetsInfo es -> Word32
firstSet :: Word32
,
forall (es :: [*]).
BindDescriptorSetsInfo es -> Vector DescriptorSet
descriptorSets :: Vector DescriptorSet
,
forall (es :: [*]). BindDescriptorSetsInfo es -> Word32
dynamicOffsetCount :: Word32
,
forall (es :: [*]). BindDescriptorSetsInfo es -> Vector Word32
dynamicOffsets :: Vector Word32
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BindDescriptorSetsInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (BindDescriptorSetsInfo es)
instance Extensible BindDescriptorSetsInfo where
extensibleTypeName :: String
extensibleTypeName = String
"BindDescriptorSetsInfo"
setNext :: forall (ds :: [*]) (es :: [*]).
BindDescriptorSetsInfo ds -> Chain es -> BindDescriptorSetsInfo es
setNext BindDescriptorSetsInfo{Word32
Vector Word32
Vector DescriptorSet
ShaderStageFlags
PipelineLayout
Chain ds
next :: forall (es :: [*]). BindDescriptorSetsInfo es -> Chain es
stageFlags :: forall (es :: [*]). BindDescriptorSetsInfo es -> ShaderStageFlags
layout :: forall (es :: [*]). BindDescriptorSetsInfo es -> PipelineLayout
firstSet :: forall (es :: [*]). BindDescriptorSetsInfo es -> Word32
descriptorSets :: forall (es :: [*]).
BindDescriptorSetsInfo es -> Vector DescriptorSet
dynamicOffsetCount :: forall (es :: [*]). BindDescriptorSetsInfo es -> Word32
dynamicOffsets :: forall (es :: [*]). BindDescriptorSetsInfo es -> Vector Word32
next :: Chain ds
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
firstSet :: Word32
descriptorSets :: Vector DescriptorSet
dynamicOffsetCount :: Word32
dynamicOffsets :: Vector Word32
..} Chain es
next' = BindDescriptorSetsInfo{next :: Chain es
next = Chain es
next', Word32
Vector Word32
Vector DescriptorSet
ShaderStageFlags
PipelineLayout
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
firstSet :: Word32
descriptorSets :: Vector DescriptorSet
dynamicOffsetCount :: Word32
dynamicOffsets :: Vector Word32
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
firstSet :: Word32
descriptorSets :: Vector DescriptorSet
dynamicOffsetCount :: Word32
dynamicOffsets :: Vector Word32
..}
getNext :: forall (es :: [*]). BindDescriptorSetsInfo es -> Chain es
getNext BindDescriptorSetsInfo{Word32
Vector Word32
Vector DescriptorSet
ShaderStageFlags
PipelineLayout
Chain es
next :: forall (es :: [*]). BindDescriptorSetsInfo es -> Chain es
stageFlags :: forall (es :: [*]). BindDescriptorSetsInfo es -> ShaderStageFlags
layout :: forall (es :: [*]). BindDescriptorSetsInfo es -> PipelineLayout
firstSet :: forall (es :: [*]). BindDescriptorSetsInfo es -> Word32
descriptorSets :: forall (es :: [*]).
BindDescriptorSetsInfo es -> Vector DescriptorSet
dynamicOffsetCount :: forall (es :: [*]). BindDescriptorSetsInfo es -> Word32
dynamicOffsets :: forall (es :: [*]). BindDescriptorSetsInfo es -> Vector Word32
next :: Chain es
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
firstSet :: Word32
descriptorSets :: Vector DescriptorSet
dynamicOffsetCount :: Word32
dynamicOffsets :: Vector Word32
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends BindDescriptorSetsInfo e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends BindDescriptorSetsInfo e => b) -> Maybe b
extends proxy e
_ Extends BindDescriptorSetsInfo e => b
f
| Just e :~: PipelineLayoutCreateInfo
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @PipelineLayoutCreateInfo = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends BindDescriptorSetsInfo e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance ( Extendss BindDescriptorSetsInfo es
, PokeChain es ) => ToCStruct (BindDescriptorSetsInfo es) where
withCStruct :: forall b.
BindDescriptorSetsInfo es
-> (Ptr (BindDescriptorSetsInfo es) -> IO b) -> IO b
withCStruct BindDescriptorSetsInfo es
x Ptr (BindDescriptorSetsInfo es) -> IO b
f = Int -> (Ptr (BindDescriptorSetsInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
64 ((Ptr (BindDescriptorSetsInfo es) -> IO b) -> IO b)
-> (Ptr (BindDescriptorSetsInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (BindDescriptorSetsInfo es)
p -> Ptr (BindDescriptorSetsInfo es)
-> BindDescriptorSetsInfo es -> IO b -> IO b
forall b.
Ptr (BindDescriptorSetsInfo es)
-> BindDescriptorSetsInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (BindDescriptorSetsInfo es)
p BindDescriptorSetsInfo es
x (Ptr (BindDescriptorSetsInfo es) -> IO b
f Ptr (BindDescriptorSetsInfo es)
p)
pokeCStruct :: forall b.
Ptr (BindDescriptorSetsInfo es)
-> BindDescriptorSetsInfo es -> IO b -> IO b
pokeCStruct Ptr (BindDescriptorSetsInfo es)
p BindDescriptorSetsInfo{Word32
Vector Word32
Vector DescriptorSet
ShaderStageFlags
PipelineLayout
Chain es
next :: forall (es :: [*]). BindDescriptorSetsInfo es -> Chain es
stageFlags :: forall (es :: [*]). BindDescriptorSetsInfo es -> ShaderStageFlags
layout :: forall (es :: [*]). BindDescriptorSetsInfo es -> PipelineLayout
firstSet :: forall (es :: [*]). BindDescriptorSetsInfo es -> Word32
descriptorSets :: forall (es :: [*]).
BindDescriptorSetsInfo es -> Vector DescriptorSet
dynamicOffsetCount :: forall (es :: [*]). BindDescriptorSetsInfo es -> Word32
dynamicOffsets :: forall (es :: [*]). BindDescriptorSetsInfo es -> Vector Word32
next :: Chain es
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
firstSet :: Word32
descriptorSets :: Vector DescriptorSet
dynamicOffsetCount :: Word32
dynamicOffsets :: Vector Word32
..} 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans 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 (BindDescriptorSetsInfo es)
p Ptr (BindDescriptorSetsInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO)
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
forall a. Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext''
lift $ poke ((p `plusPtr` 16 :: Ptr ShaderStageFlags)) (stageFlags)
lift $ poke ((p `plusPtr` 24 :: Ptr PipelineLayout)) (layout)
lift $ poke ((p `plusPtr` 32 :: Ptr Word32)) (firstSet)
lift $ poke ((p `plusPtr` 36 :: Ptr Word32)) ((fromIntegral (Data.Vector.length $ (descriptorSets)) :: Word32))
pPDescriptorSets' <- ContT $ allocaBytes @DescriptorSet ((Data.Vector.length (descriptorSets)) * 8)
lift $ Data.Vector.imapM_ (\Int
i DescriptorSet
e -> Ptr DescriptorSet -> DescriptorSet -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DescriptorSet
pPDescriptorSets' Ptr DescriptorSet -> Int -> Ptr DescriptorSet
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DescriptorSet) (DescriptorSet
e)) (descriptorSets)
lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr DescriptorSet))) (pPDescriptorSets')
let pDynamicOffsetsLength = Vector Word32 -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Word32 -> Int) -> Vector Word32 -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Word32
dynamicOffsets)
dynamicOffsetCount'' <- lift $ if (dynamicOffsetCount) == 0
then pure $ fromIntegral pDynamicOffsetsLength
else do
unless (fromIntegral pDynamicOffsetsLength == (dynamicOffsetCount) || pDynamicOffsetsLength == 0) $
throwIO $ IOError Nothing InvalidArgument "" "pDynamicOffsets must be empty or have 'dynamicOffsetCount' elements" Nothing Nothing
pure (dynamicOffsetCount)
lift $ poke ((p `plusPtr` 48 :: Ptr Word32)) (dynamicOffsetCount'')
pDynamicOffsets'' <- if Data.Vector.null (dynamicOffsets)
then pure nullPtr
else do
pPDynamicOffsets <- ContT $ allocaBytes @Word32 (((Data.Vector.length (dynamicOffsets))) * 4)
lift $ Data.Vector.imapM_ (\Int
i Word32
e -> Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word32
pPDynamicOffsets Ptr Word32 -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) (Word32
e)) ((dynamicOffsets))
pure $ pPDynamicOffsets
lift $ poke ((p `plusPtr` 56 :: Ptr (Ptr Word32))) pDynamicOffsets''
lift $ f
cStructSize :: Int
cStructSize = Int
64
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (BindDescriptorSetsInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (BindDescriptorSetsInfo es)
p 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans 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 (BindDescriptorSetsInfo es)
p Ptr (BindDescriptorSetsInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO)
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext'
lift $ poke ((p `plusPtr` 16 :: Ptr ShaderStageFlags)) (zero)
lift $ f
instance ( Extendss BindDescriptorSetsInfo es
, PeekChain es ) => FromCStruct (BindDescriptorSetsInfo es) where
peekCStruct :: Ptr (BindDescriptorSetsInfo es) -> IO (BindDescriptorSetsInfo es)
peekCStruct Ptr (BindDescriptorSetsInfo es)
p = do
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (BindDescriptorSetsInfo es)
p Ptr (BindDescriptorSetsInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
next <- peekChain (castPtr pNext)
stageFlags <- peek @ShaderStageFlags ((p `plusPtr` 16 :: Ptr ShaderStageFlags))
layout <- peek @PipelineLayout ((p `plusPtr` 24 :: Ptr PipelineLayout))
firstSet <- peek @Word32 ((p `plusPtr` 32 :: Ptr Word32))
descriptorSetCount <- peek @Word32 ((p `plusPtr` 36 :: Ptr Word32))
pDescriptorSets <- peek @(Ptr DescriptorSet) ((p `plusPtr` 40 :: Ptr (Ptr DescriptorSet)))
pDescriptorSets' <- generateM (fromIntegral descriptorSetCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @DescriptorSet ((Ptr DescriptorSet
pDescriptorSets Ptr DescriptorSet -> Int -> Ptr DescriptorSet
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DescriptorSet)))
dynamicOffsetCount <- peek @Word32 ((p `plusPtr` 48 :: Ptr Word32))
pDynamicOffsets <- peek @(Ptr Word32) ((p `plusPtr` 56 :: Ptr (Ptr Word32)))
let pDynamicOffsetsLength = if Ptr Word32
pDynamicOffsets Ptr Word32 -> Ptr Word32 -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Word32
forall a. Ptr a
nullPtr then Int
0 else (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
dynamicOffsetCount)
pDynamicOffsets' <- generateM pDynamicOffsetsLength (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr Word32
pDynamicOffsets Ptr Word32 -> Int -> Ptr Word32
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
pure $ BindDescriptorSetsInfo
next
stageFlags
layout
firstSet
pDescriptorSets'
dynamicOffsetCount
pDynamicOffsets'
instance es ~ '[] => Zero (BindDescriptorSetsInfo es) where
zero :: BindDescriptorSetsInfo es
zero = Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector DescriptorSet
-> Word32
-> Vector Word32
-> BindDescriptorSetsInfo es
forall (es :: [*]).
Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector DescriptorSet
-> Word32
-> Vector Word32
-> BindDescriptorSetsInfo es
BindDescriptorSetsInfo
()
ShaderStageFlags
forall a. Zero a => a
zero
PipelineLayout
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Vector DescriptorSet
forall a. Monoid a => a
mempty
Word32
forall a. Zero a => a
zero
Vector Word32
forall a. Monoid a => a
mempty
data PushConstantsInfo (es :: [Type]) = PushConstantsInfo
{
forall (es :: [*]). PushConstantsInfo es -> Chain es
next :: Chain es
,
forall (es :: [*]). PushConstantsInfo es -> PipelineLayout
layout :: PipelineLayout
,
forall (es :: [*]). PushConstantsInfo es -> ShaderStageFlags
stageFlags :: ShaderStageFlags
,
forall (es :: [*]). PushConstantsInfo es -> Word32
offset :: Word32
,
forall (es :: [*]). PushConstantsInfo es -> Word32
size :: Word32
,
forall (es :: [*]). PushConstantsInfo es -> Ptr ()
values :: Ptr ()
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PushConstantsInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (PushConstantsInfo es)
instance Extensible PushConstantsInfo where
extensibleTypeName :: String
extensibleTypeName = String
"PushConstantsInfo"
setNext :: forall (ds :: [*]) (es :: [*]).
PushConstantsInfo ds -> Chain es -> PushConstantsInfo es
setNext PushConstantsInfo{Word32
Ptr ()
ShaderStageFlags
PipelineLayout
Chain ds
next :: forall (es :: [*]). PushConstantsInfo es -> Chain es
layout :: forall (es :: [*]). PushConstantsInfo es -> PipelineLayout
stageFlags :: forall (es :: [*]). PushConstantsInfo es -> ShaderStageFlags
offset :: forall (es :: [*]). PushConstantsInfo es -> Word32
size :: forall (es :: [*]). PushConstantsInfo es -> Word32
values :: forall (es :: [*]). PushConstantsInfo es -> Ptr ()
next :: Chain ds
layout :: PipelineLayout
stageFlags :: ShaderStageFlags
offset :: Word32
size :: Word32
values :: Ptr ()
..} Chain es
next' = PushConstantsInfo{next :: Chain es
next = Chain es
next', Word32
Ptr ()
ShaderStageFlags
PipelineLayout
layout :: PipelineLayout
stageFlags :: ShaderStageFlags
offset :: Word32
size :: Word32
values :: Ptr ()
layout :: PipelineLayout
stageFlags :: ShaderStageFlags
offset :: Word32
size :: Word32
values :: Ptr ()
..}
getNext :: forall (es :: [*]). PushConstantsInfo es -> Chain es
getNext PushConstantsInfo{Word32
Ptr ()
ShaderStageFlags
PipelineLayout
Chain es
next :: forall (es :: [*]). PushConstantsInfo es -> Chain es
layout :: forall (es :: [*]). PushConstantsInfo es -> PipelineLayout
stageFlags :: forall (es :: [*]). PushConstantsInfo es -> ShaderStageFlags
offset :: forall (es :: [*]). PushConstantsInfo es -> Word32
size :: forall (es :: [*]). PushConstantsInfo es -> Word32
values :: forall (es :: [*]). PushConstantsInfo es -> Ptr ()
next :: Chain es
layout :: PipelineLayout
stageFlags :: ShaderStageFlags
offset :: Word32
size :: Word32
values :: Ptr ()
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends PushConstantsInfo e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends PushConstantsInfo e => b) -> Maybe b
extends proxy e
_ Extends PushConstantsInfo e => b
f
| Just e :~: PushConstantBankInfoNV
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @PushConstantBankInfoNV = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PushConstantsInfo e => b
f
| Just e :~: PipelineLayoutCreateInfo
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @PipelineLayoutCreateInfo = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PushConstantsInfo e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance ( Extendss PushConstantsInfo es
, PokeChain es ) => ToCStruct (PushConstantsInfo es) where
withCStruct :: forall b.
PushConstantsInfo es
-> (Ptr (PushConstantsInfo es) -> IO b) -> IO b
withCStruct PushConstantsInfo es
x Ptr (PushConstantsInfo es) -> IO b
f = Int -> (Ptr (PushConstantsInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr (PushConstantsInfo es) -> IO b) -> IO b)
-> (Ptr (PushConstantsInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (PushConstantsInfo es)
p -> Ptr (PushConstantsInfo es) -> PushConstantsInfo es -> IO b -> IO b
forall b.
Ptr (PushConstantsInfo es) -> PushConstantsInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (PushConstantsInfo es)
p PushConstantsInfo es
x (Ptr (PushConstantsInfo es) -> IO b
f Ptr (PushConstantsInfo es)
p)
pokeCStruct :: forall b.
Ptr (PushConstantsInfo es) -> PushConstantsInfo es -> IO b -> IO b
pokeCStruct Ptr (PushConstantsInfo es)
p PushConstantsInfo{Word32
Ptr ()
ShaderStageFlags
PipelineLayout
Chain es
next :: forall (es :: [*]). PushConstantsInfo es -> Chain es
layout :: forall (es :: [*]). PushConstantsInfo es -> PipelineLayout
stageFlags :: forall (es :: [*]). PushConstantsInfo es -> ShaderStageFlags
offset :: forall (es :: [*]). PushConstantsInfo es -> Word32
size :: forall (es :: [*]). PushConstantsInfo es -> Word32
values :: forall (es :: [*]). PushConstantsInfo es -> Ptr ()
next :: Chain es
layout :: PipelineLayout
stageFlags :: ShaderStageFlags
offset :: Word32
size :: Word32
values :: Ptr ()
..} 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans 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 (PushConstantsInfo es)
p Ptr (PushConstantsInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PUSH_CONSTANTS_INFO)
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
forall a. Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext''
lift $ poke ((p `plusPtr` 16 :: Ptr PipelineLayout)) (layout)
lift $ poke ((p `plusPtr` 24 :: Ptr ShaderStageFlags)) (stageFlags)
lift $ poke ((p `plusPtr` 28 :: Ptr Word32)) (offset)
lift $ poke ((p `plusPtr` 32 :: Ptr Word32)) (size)
lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr ()))) (values)
lift $ f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (PushConstantsInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PushConstantsInfo es)
p 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans 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 (PushConstantsInfo es)
p Ptr (PushConstantsInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PUSH_CONSTANTS_INFO)
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext'
lift $ poke ((p `plusPtr` 24 :: Ptr ShaderStageFlags)) (zero)
lift $ poke ((p `plusPtr` 32 :: Ptr Word32)) (zero)
lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr ()))) (zero)
lift $ f
instance ( Extendss PushConstantsInfo es
, PeekChain es ) => FromCStruct (PushConstantsInfo es) where
peekCStruct :: Ptr (PushConstantsInfo es) -> IO (PushConstantsInfo es)
peekCStruct Ptr (PushConstantsInfo es)
p = do
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PushConstantsInfo es)
p Ptr (PushConstantsInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
next <- peekChain (castPtr pNext)
layout <- peek @PipelineLayout ((p `plusPtr` 16 :: Ptr PipelineLayout))
stageFlags <- peek @ShaderStageFlags ((p `plusPtr` 24 :: Ptr ShaderStageFlags))
offset <- peek @Word32 ((p `plusPtr` 28 :: Ptr Word32))
size <- peek @Word32 ((p `plusPtr` 32 :: Ptr Word32))
pValues <- peek @(Ptr ()) ((p `plusPtr` 40 :: Ptr (Ptr ())))
pure $ PushConstantsInfo
next layout stageFlags offset size pValues
instance es ~ '[] => Zero (PushConstantsInfo es) where
zero :: PushConstantsInfo es
zero = Chain es
-> PipelineLayout
-> ShaderStageFlags
-> Word32
-> Word32
-> Ptr ()
-> PushConstantsInfo es
forall (es :: [*]).
Chain es
-> PipelineLayout
-> ShaderStageFlags
-> Word32
-> Word32
-> Ptr ()
-> PushConstantsInfo es
PushConstantsInfo
()
PipelineLayout
forall a. Zero a => a
zero
ShaderStageFlags
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Ptr ()
forall a. Zero a => a
zero
data PushDescriptorSetInfo (es :: [Type]) = PushDescriptorSetInfo
{
forall (es :: [*]). PushDescriptorSetInfo es -> Chain es
next :: Chain es
,
forall (es :: [*]). PushDescriptorSetInfo es -> ShaderStageFlags
stageFlags :: ShaderStageFlags
,
forall (es :: [*]). PushDescriptorSetInfo es -> PipelineLayout
layout :: PipelineLayout
,
forall (es :: [*]). PushDescriptorSetInfo es -> Word32
set :: Word32
,
forall (es :: [*]).
PushDescriptorSetInfo es -> Vector (SomeStruct WriteDescriptorSet)
descriptorWrites :: Vector (SomeStruct WriteDescriptorSet)
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PushDescriptorSetInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (PushDescriptorSetInfo es)
instance Extensible PushDescriptorSetInfo where
extensibleTypeName :: String
extensibleTypeName = String
"PushDescriptorSetInfo"
setNext :: forall (ds :: [*]) (es :: [*]).
PushDescriptorSetInfo ds -> Chain es -> PushDescriptorSetInfo es
setNext PushDescriptorSetInfo{Word32
Vector (SomeStruct WriteDescriptorSet)
ShaderStageFlags
PipelineLayout
Chain ds
next :: forall (es :: [*]). PushDescriptorSetInfo es -> Chain es
stageFlags :: forall (es :: [*]). PushDescriptorSetInfo es -> ShaderStageFlags
layout :: forall (es :: [*]). PushDescriptorSetInfo es -> PipelineLayout
set :: forall (es :: [*]). PushDescriptorSetInfo es -> Word32
descriptorWrites :: forall (es :: [*]).
PushDescriptorSetInfo es -> Vector (SomeStruct WriteDescriptorSet)
next :: Chain ds
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
set :: Word32
descriptorWrites :: Vector (SomeStruct WriteDescriptorSet)
..} Chain es
next' = PushDescriptorSetInfo{next :: Chain es
next = Chain es
next', Word32
Vector (SomeStruct WriteDescriptorSet)
ShaderStageFlags
PipelineLayout
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
set :: Word32
descriptorWrites :: Vector (SomeStruct WriteDescriptorSet)
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
set :: Word32
descriptorWrites :: Vector (SomeStruct WriteDescriptorSet)
..}
getNext :: forall (es :: [*]). PushDescriptorSetInfo es -> Chain es
getNext PushDescriptorSetInfo{Word32
Vector (SomeStruct WriteDescriptorSet)
ShaderStageFlags
PipelineLayout
Chain es
next :: forall (es :: [*]). PushDescriptorSetInfo es -> Chain es
stageFlags :: forall (es :: [*]). PushDescriptorSetInfo es -> ShaderStageFlags
layout :: forall (es :: [*]). PushDescriptorSetInfo es -> PipelineLayout
set :: forall (es :: [*]). PushDescriptorSetInfo es -> Word32
descriptorWrites :: forall (es :: [*]).
PushDescriptorSetInfo es -> Vector (SomeStruct WriteDescriptorSet)
next :: Chain es
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
set :: Word32
descriptorWrites :: Vector (SomeStruct WriteDescriptorSet)
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends PushDescriptorSetInfo e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends PushDescriptorSetInfo e => b) -> Maybe b
extends proxy e
_ Extends PushDescriptorSetInfo e => b
f
| Just e :~: PipelineLayoutCreateInfo
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @PipelineLayoutCreateInfo = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PushDescriptorSetInfo e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance ( Extendss PushDescriptorSetInfo es
, PokeChain es ) => ToCStruct (PushDescriptorSetInfo es) where
withCStruct :: forall b.
PushDescriptorSetInfo es
-> (Ptr (PushDescriptorSetInfo es) -> IO b) -> IO b
withCStruct PushDescriptorSetInfo es
x Ptr (PushDescriptorSetInfo es) -> IO b
f = Int -> (Ptr (PushDescriptorSetInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr (PushDescriptorSetInfo es) -> IO b) -> IO b)
-> (Ptr (PushDescriptorSetInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (PushDescriptorSetInfo es)
p -> Ptr (PushDescriptorSetInfo es)
-> PushDescriptorSetInfo es -> IO b -> IO b
forall b.
Ptr (PushDescriptorSetInfo es)
-> PushDescriptorSetInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (PushDescriptorSetInfo es)
p PushDescriptorSetInfo es
x (Ptr (PushDescriptorSetInfo es) -> IO b
f Ptr (PushDescriptorSetInfo es)
p)
pokeCStruct :: forall b.
Ptr (PushDescriptorSetInfo es)
-> PushDescriptorSetInfo es -> IO b -> IO b
pokeCStruct Ptr (PushDescriptorSetInfo es)
p PushDescriptorSetInfo{Word32
Vector (SomeStruct WriteDescriptorSet)
ShaderStageFlags
PipelineLayout
Chain es
next :: forall (es :: [*]). PushDescriptorSetInfo es -> Chain es
stageFlags :: forall (es :: [*]). PushDescriptorSetInfo es -> ShaderStageFlags
layout :: forall (es :: [*]). PushDescriptorSetInfo es -> PipelineLayout
set :: forall (es :: [*]). PushDescriptorSetInfo es -> Word32
descriptorWrites :: forall (es :: [*]).
PushDescriptorSetInfo es -> Vector (SomeStruct WriteDescriptorSet)
next :: Chain es
stageFlags :: ShaderStageFlags
layout :: PipelineLayout
set :: Word32
descriptorWrites :: Vector (SomeStruct WriteDescriptorSet)
..} 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans 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 (PushDescriptorSetInfo es)
p Ptr (PushDescriptorSetInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO)
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
forall a. Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext''
lift $ poke ((p `plusPtr` 16 :: Ptr ShaderStageFlags)) (stageFlags)
lift $ poke ((p `plusPtr` 24 :: Ptr PipelineLayout)) (layout)
lift $ poke ((p `plusPtr` 32 :: Ptr Word32)) (set)
lift $ poke ((p `plusPtr` 36 :: Ptr Word32)) ((fromIntegral (Data.Vector.length $ (descriptorWrites)) :: Word32))
pPDescriptorWrites' <- ContT $ allocaBytes @(WriteDescriptorSet _) ((Data.Vector.length (descriptorWrites)) * 64)
Data.Vector.imapM_ (\Int
i SomeStruct WriteDescriptorSet
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (SomeStruct WriteDescriptorSet)
-> SomeStruct WriteDescriptorSet -> IO b -> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (WriteDescriptorSet (ZonkAny 1))
-> Ptr (SomeStruct WriteDescriptorSet)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (WriteDescriptorSet (ZonkAny 0))
pPDescriptorWrites' Ptr (WriteDescriptorSet (ZonkAny 0))
-> Int -> Ptr (WriteDescriptorSet w)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
64 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (WriteDescriptorSet _))) (SomeStruct WriteDescriptorSet
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
$ ())) (descriptorWrites)
lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr (WriteDescriptorSet _)))) (pPDescriptorWrites')
lift $ f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (PushDescriptorSetInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PushDescriptorSetInfo es)
p 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans 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 (PushDescriptorSetInfo es)
p Ptr (PushDescriptorSetInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO)
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext'
lift $ poke ((p `plusPtr` 16 :: Ptr ShaderStageFlags)) (zero)
lift $ f
instance ( Extendss PushDescriptorSetInfo es
, PeekChain es ) => FromCStruct (PushDescriptorSetInfo es) where
peekCStruct :: Ptr (PushDescriptorSetInfo es) -> IO (PushDescriptorSetInfo es)
peekCStruct Ptr (PushDescriptorSetInfo es)
p = do
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PushDescriptorSetInfo es)
p Ptr (PushDescriptorSetInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
next <- peekChain (castPtr pNext)
stageFlags <- peek @ShaderStageFlags ((p `plusPtr` 16 :: Ptr ShaderStageFlags))
layout <- peek @PipelineLayout ((p `plusPtr` 24 :: Ptr PipelineLayout))
set <- peek @Word32 ((p `plusPtr` 32 :: Ptr Word32))
descriptorWriteCount <- peek @Word32 ((p `plusPtr` 36 :: Ptr Word32))
pDescriptorWrites <- peek @(Ptr (WriteDescriptorSet _)) ((p `plusPtr` 40 :: Ptr (Ptr (WriteDescriptorSet _))))
pDescriptorWrites' <- generateM (fromIntegral descriptorWriteCount) (\Int
i -> Ptr (SomeStruct WriteDescriptorSet)
-> IO (SomeStruct WriteDescriptorSet)
forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (WriteDescriptorSet (ZonkAny 2))
-> Ptr (SomeStruct WriteDescriptorSet)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (WriteDescriptorSet (ZonkAny 2))
pDescriptorWrites Ptr (WriteDescriptorSet (ZonkAny 2))
-> Int -> Ptr (WriteDescriptorSet (ZonkAny 2))
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
64 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (WriteDescriptorSet _)))))
pure $ PushDescriptorSetInfo
next stageFlags layout set pDescriptorWrites'
instance es ~ '[] => Zero (PushDescriptorSetInfo es) where
zero :: PushDescriptorSetInfo es
zero = Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector (SomeStruct WriteDescriptorSet)
-> PushDescriptorSetInfo es
forall (es :: [*]).
Chain es
-> ShaderStageFlags
-> PipelineLayout
-> Word32
-> Vector (SomeStruct WriteDescriptorSet)
-> PushDescriptorSetInfo es
PushDescriptorSetInfo
()
ShaderStageFlags
forall a. Zero a => a
zero
PipelineLayout
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Vector (SomeStruct WriteDescriptorSet)
forall a. Monoid a => a
mempty
data PushDescriptorSetWithTemplateInfo (es :: [Type]) = PushDescriptorSetWithTemplateInfo
{
forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> Chain es
next :: Chain es
,
forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> DescriptorUpdateTemplate
descriptorUpdateTemplate :: DescriptorUpdateTemplate
,
forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> PipelineLayout
layout :: PipelineLayout
,
forall (es :: [*]). PushDescriptorSetWithTemplateInfo es -> Word32
set :: Word32
,
forall (es :: [*]). PushDescriptorSetWithTemplateInfo es -> Ptr ()
data' :: Ptr ()
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PushDescriptorSetWithTemplateInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (PushDescriptorSetWithTemplateInfo es)
instance Extensible PushDescriptorSetWithTemplateInfo where
extensibleTypeName :: String
extensibleTypeName = String
"PushDescriptorSetWithTemplateInfo"
setNext :: forall (ds :: [*]) (es :: [*]).
PushDescriptorSetWithTemplateInfo ds
-> Chain es -> PushDescriptorSetWithTemplateInfo es
setNext PushDescriptorSetWithTemplateInfo{Word32
Ptr ()
DescriptorUpdateTemplate
PipelineLayout
Chain ds
next :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> Chain es
descriptorUpdateTemplate :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> DescriptorUpdateTemplate
layout :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> PipelineLayout
set :: forall (es :: [*]). PushDescriptorSetWithTemplateInfo es -> Word32
data' :: forall (es :: [*]). PushDescriptorSetWithTemplateInfo es -> Ptr ()
next :: Chain ds
descriptorUpdateTemplate :: DescriptorUpdateTemplate
layout :: PipelineLayout
set :: Word32
data' :: Ptr ()
..} Chain es
next' = PushDescriptorSetWithTemplateInfo{next :: Chain es
next = Chain es
next', Word32
Ptr ()
DescriptorUpdateTemplate
PipelineLayout
descriptorUpdateTemplate :: DescriptorUpdateTemplate
layout :: PipelineLayout
set :: Word32
data' :: Ptr ()
descriptorUpdateTemplate :: DescriptorUpdateTemplate
layout :: PipelineLayout
set :: Word32
data' :: Ptr ()
..}
getNext :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> Chain es
getNext PushDescriptorSetWithTemplateInfo{Word32
Ptr ()
DescriptorUpdateTemplate
PipelineLayout
Chain es
next :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> Chain es
descriptorUpdateTemplate :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> DescriptorUpdateTemplate
layout :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> PipelineLayout
set :: forall (es :: [*]). PushDescriptorSetWithTemplateInfo es -> Word32
data' :: forall (es :: [*]). PushDescriptorSetWithTemplateInfo es -> Ptr ()
next :: Chain es
descriptorUpdateTemplate :: DescriptorUpdateTemplate
layout :: PipelineLayout
set :: Word32
data' :: Ptr ()
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends PushDescriptorSetWithTemplateInfo e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e
-> (Extends PushDescriptorSetWithTemplateInfo e => b) -> Maybe b
extends proxy e
_ Extends PushDescriptorSetWithTemplateInfo e => b
f
| Just e :~: PipelineLayoutCreateInfo
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @PipelineLayoutCreateInfo = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends PushDescriptorSetWithTemplateInfo e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance ( Extendss PushDescriptorSetWithTemplateInfo es
, PokeChain es ) => ToCStruct (PushDescriptorSetWithTemplateInfo es) where
withCStruct :: forall b.
PushDescriptorSetWithTemplateInfo es
-> (Ptr (PushDescriptorSetWithTemplateInfo es) -> IO b) -> IO b
withCStruct PushDescriptorSetWithTemplateInfo es
x Ptr (PushDescriptorSetWithTemplateInfo es) -> IO b
f = Int -> (Ptr (PushDescriptorSetWithTemplateInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr (PushDescriptorSetWithTemplateInfo es) -> IO b) -> IO b)
-> (Ptr (PushDescriptorSetWithTemplateInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (PushDescriptorSetWithTemplateInfo es)
p -> Ptr (PushDescriptorSetWithTemplateInfo es)
-> PushDescriptorSetWithTemplateInfo es -> IO b -> IO b
forall b.
Ptr (PushDescriptorSetWithTemplateInfo es)
-> PushDescriptorSetWithTemplateInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (PushDescriptorSetWithTemplateInfo es)
p PushDescriptorSetWithTemplateInfo es
x (Ptr (PushDescriptorSetWithTemplateInfo es) -> IO b
f Ptr (PushDescriptorSetWithTemplateInfo es)
p)
pokeCStruct :: forall b.
Ptr (PushDescriptorSetWithTemplateInfo es)
-> PushDescriptorSetWithTemplateInfo es -> IO b -> IO b
pokeCStruct Ptr (PushDescriptorSetWithTemplateInfo es)
p PushDescriptorSetWithTemplateInfo{Word32
Ptr ()
DescriptorUpdateTemplate
PipelineLayout
Chain es
next :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> Chain es
descriptorUpdateTemplate :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> DescriptorUpdateTemplate
layout :: forall (es :: [*]).
PushDescriptorSetWithTemplateInfo es -> PipelineLayout
set :: forall (es :: [*]). PushDescriptorSetWithTemplateInfo es -> Word32
data' :: forall (es :: [*]). PushDescriptorSetWithTemplateInfo es -> Ptr ()
next :: Chain es
descriptorUpdateTemplate :: DescriptorUpdateTemplate
layout :: PipelineLayout
set :: Word32
data' :: Ptr ()
..} 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans 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 (PushDescriptorSetWithTemplateInfo es)
p Ptr (PushDescriptorSetWithTemplateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO)
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
forall a. Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext''
lift $ poke ((p `plusPtr` 16 :: Ptr DescriptorUpdateTemplate)) (descriptorUpdateTemplate)
lift $ poke ((p `plusPtr` 24 :: Ptr PipelineLayout)) (layout)
lift $ poke ((p `plusPtr` 32 :: Ptr Word32)) (set)
lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr ()))) (data')
lift $ f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr (PushDescriptorSetWithTemplateInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (PushDescriptorSetWithTemplateInfo es)
p 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans 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 (PushDescriptorSetWithTemplateInfo es)
p Ptr (PushDescriptorSetWithTemplateInfo es)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO)
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext'
lift $ poke ((p `plusPtr` 16 :: Ptr DescriptorUpdateTemplate)) (zero)
lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr ()))) (zero)
lift $ f
instance ( Extendss PushDescriptorSetWithTemplateInfo es
, PeekChain es ) => FromCStruct (PushDescriptorSetWithTemplateInfo es) where
peekCStruct :: Ptr (PushDescriptorSetWithTemplateInfo es)
-> IO (PushDescriptorSetWithTemplateInfo es)
peekCStruct Ptr (PushDescriptorSetWithTemplateInfo es)
p = do
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (PushDescriptorSetWithTemplateInfo es)
p Ptr (PushDescriptorSetWithTemplateInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
next <- peekChain (castPtr pNext)
descriptorUpdateTemplate <- peek @DescriptorUpdateTemplate ((p `plusPtr` 16 :: Ptr DescriptorUpdateTemplate))
layout <- peek @PipelineLayout ((p `plusPtr` 24 :: Ptr PipelineLayout))
set <- peek @Word32 ((p `plusPtr` 32 :: Ptr Word32))
pData <- peek @(Ptr ()) ((p `plusPtr` 40 :: Ptr (Ptr ())))
pure $ PushDescriptorSetWithTemplateInfo
next descriptorUpdateTemplate layout set pData
instance es ~ '[] => Zero (PushDescriptorSetWithTemplateInfo es) where
zero :: PushDescriptorSetWithTemplateInfo es
zero = Chain es
-> DescriptorUpdateTemplate
-> PipelineLayout
-> Word32
-> Ptr ()
-> PushDescriptorSetWithTemplateInfo es
forall (es :: [*]).
Chain es
-> DescriptorUpdateTemplate
-> PipelineLayout
-> Word32
-> Ptr ()
-> PushDescriptorSetWithTemplateInfo es
PushDescriptorSetWithTemplateInfo
()
DescriptorUpdateTemplate
forall a. Zero a => a
zero
PipelineLayout
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Ptr ()
forall a. Zero a => a
zero