{-# language CPP #-}
module Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2 ( createRenderPass2
, cmdBeginRenderPass2
, cmdUseRenderPass2
, cmdNextSubpass2
, cmdEndRenderPass2
, AttachmentDescription2(..)
, AttachmentReference2(..)
, SubpassDescription2(..)
, SubpassDependency2(..)
, RenderPassCreateInfo2(..)
, SubpassBeginInfo(..)
, SubpassEndInfo(..)
, StructureType(..)
) where
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import Foreign.Marshal.Utils (maybePeek)
import GHC.Base (when)
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 Data.Int (Int32)
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.CStruct.Extends (peekSomeCStruct)
import Vulkan.CStruct.Extends (pokeSomeCStruct)
import Vulkan.CStruct.Extends (withSomeCStruct)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.Enums.AccessFlagBits (AccessFlags)
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.Enums.AttachmentDescriptionFlagBits (AttachmentDescriptionFlags)
import {-# SOURCE #-} Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts (AttachmentDescriptionStencilLayout)
import Vulkan.Core10.Enums.AttachmentLoadOp (AttachmentLoadOp)
import {-# SOURCE #-} Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts (AttachmentReferenceStencilLayout)
import Vulkan.Core10.Enums.AttachmentStoreOp (AttachmentStoreOp)
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.Enums.DependencyFlagBits (DependencyFlags)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkCmdBeginRenderPass2))
import Vulkan.Dynamic (DeviceCmds(pVkCmdEndRenderPass2))
import Vulkan.Dynamic (DeviceCmds(pVkCmdNextSubpass2))
import Vulkan.Dynamic (DeviceCmds(pVkCreateRenderPass2))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import {-# SOURCE #-} Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer (ExternalFormatANDROID)
import Vulkan.Core10.Enums.Format (Format)
import {-# SOURCE #-} Vulkan.Extensions.VK_KHR_fragment_shading_rate (FragmentShadingRateAttachmentInfoKHR)
import Vulkan.Core10.Enums.ImageAspectFlagBits (ImageAspectFlags)
import Vulkan.Core10.Enums.ImageLayout (ImageLayout)
import {-# SOURCE #-} Vulkan.Core13.Promoted_From_VK_KHR_synchronization2 (MemoryBarrier2)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_multisampled_render_to_single_sampled (MultisampledRenderToSingleSampledInfoEXT)
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PeekChain(..))
import Vulkan.Core10.Enums.PipelineBindPoint (PipelineBindPoint)
import Vulkan.Core10.Enums.PipelineStageFlagBits (PipelineStageFlags)
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import Vulkan.Core10.Handles (RenderPass)
import Vulkan.Core10.Handles (RenderPass(..))
import Vulkan.Core10.CommandBufferBuilding (RenderPassBeginInfo)
import Vulkan.Core10.Enums.RenderPassCreateFlagBits (RenderPassCreateFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_subpass_merge_feedback (RenderPassCreationControlEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_subpass_merge_feedback (RenderPassCreationFeedbackCreateInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_fragment_density_map (RenderPassFragmentDensityMapCreateInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_subpass_merge_feedback (RenderPassSubpassFeedbackCreateInfoEXT)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.SampleCountFlagBits (SampleCountFlagBits)
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.SubpassContents (SubpassContents)
import {-# SOURCE #-} Vulkan.Core12.Promoted_From_VK_KHR_depth_stencil_resolve (SubpassDescriptionDepthStencilResolve)
import Vulkan.Core10.Enums.SubpassDescriptionFlagBits (SubpassDescriptionFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_QCOM_fragment_density_map_offset (SubpassFragmentDensityMapOffsetEndInfoQCOM)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SUBPASS_BEGIN_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SUBPASS_END_INFO))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Core10.Enums.StructureType (StructureType(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCreateRenderPass2
:: FunPtr (Ptr Device_T -> Ptr (SomeStruct RenderPassCreateInfo2) -> Ptr AllocationCallbacks -> Ptr RenderPass -> IO Result) -> Ptr Device_T -> Ptr (SomeStruct RenderPassCreateInfo2) -> Ptr AllocationCallbacks -> Ptr RenderPass -> IO Result
createRenderPass2 :: forall a io
. (Extendss RenderPassCreateInfo2 a, PokeChain a, MonadIO io)
=>
Device
->
(RenderPassCreateInfo2 a)
->
("allocator" ::: Maybe AllocationCallbacks)
-> io (RenderPass)
createRenderPass2 :: forall (a :: [*]) (io :: * -> *).
(Extendss RenderPassCreateInfo2 a, PokeChain a, MonadIO io) =>
Device
-> RenderPassCreateInfo2 a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io RenderPass
createRenderPass2 Device
device RenderPassCreateInfo2 a
createInfo "allocator" ::: Maybe AllocationCallbacks
allocator = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
let vkCreateRenderPass2Ptr :: FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct RenderPassCreateInfo2))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pRenderPass" ::: Ptr RenderPass)
-> IO Result)
vkCreateRenderPass2Ptr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct RenderPassCreateInfo2))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pRenderPass" ::: Ptr RenderPass)
-> IO Result)
pVkCreateRenderPass2 (case Device
device of Device{DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct RenderPassCreateInfo2))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pRenderPass" ::: Ptr RenderPass)
-> IO Result)
vkCreateRenderPass2Ptr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCreateRenderPass2 is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCreateRenderPass2' :: Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct RenderPassCreateInfo2))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pRenderPass" ::: Ptr RenderPass)
-> IO Result
vkCreateRenderPass2' = FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct RenderPassCreateInfo2))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pRenderPass" ::: Ptr RenderPass)
-> IO Result)
-> Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct RenderPassCreateInfo2))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pRenderPass" ::: Ptr RenderPass)
-> IO Result
mkVkCreateRenderPass2 FunPtr
(Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct RenderPassCreateInfo2))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pRenderPass" ::: Ptr RenderPass)
-> IO Result)
vkCreateRenderPass2Ptr
Ptr (RenderPassCreateInfo2 a)
pCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (RenderPassCreateInfo2 a
createInfo)
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
"allocator" ::: Maybe AllocationCallbacks
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
"pRenderPass" ::: Ptr RenderPass
pPRenderPass <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @RenderPass Int
8) forall a. Ptr a -> IO ()
free
Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCreateRenderPass2" (Ptr Device_T
-> ("pCreateInfo" ::: Ptr (SomeStruct RenderPassCreateInfo2))
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pRenderPass" ::: Ptr RenderPass)
-> IO Result
vkCreateRenderPass2'
(Device -> Ptr Device_T
deviceHandle (Device
device))
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (RenderPassCreateInfo2 a)
pCreateInfo)
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator
("pRenderPass" ::: Ptr RenderPass
pPRenderPass))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
RenderPass
pRenderPass <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @RenderPass "pRenderPass" ::: Ptr RenderPass
pPRenderPass
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (RenderPass
pRenderPass)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdBeginRenderPass2
:: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct RenderPassBeginInfo) -> Ptr SubpassBeginInfo -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct RenderPassBeginInfo) -> Ptr SubpassBeginInfo -> IO ()
cmdBeginRenderPass2 :: forall a io
. (Extendss RenderPassBeginInfo a, PokeChain a, MonadIO io)
=>
CommandBuffer
->
(RenderPassBeginInfo a)
->
SubpassBeginInfo
-> io ()
cmdBeginRenderPass2 :: forall (a :: [*]) (io :: * -> *).
(Extendss RenderPassBeginInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> RenderPassBeginInfo a -> SubpassBeginInfo -> io ()
cmdBeginRenderPass2 CommandBuffer
commandBuffer
RenderPassBeginInfo a
renderPassBegin
SubpassBeginInfo
subpassBeginInfo = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
let vkCmdBeginRenderPass2Ptr :: FunPtr
(Ptr CommandBuffer_T
-> ("pRenderPassBegin" ::: Ptr (SomeStruct RenderPassBeginInfo))
-> ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> IO ())
vkCmdBeginRenderPass2Ptr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("pRenderPassBegin" ::: Ptr (SomeStruct RenderPassBeginInfo))
-> ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> IO ())
pVkCmdBeginRenderPass2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("pRenderPassBegin" ::: Ptr (SomeStruct RenderPassBeginInfo))
-> ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> IO ())
vkCmdBeginRenderPass2Ptr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdBeginRenderPass2 is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCmdBeginRenderPass2' :: Ptr CommandBuffer_T
-> ("pRenderPassBegin" ::: Ptr (SomeStruct RenderPassBeginInfo))
-> ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> IO ()
vkCmdBeginRenderPass2' = FunPtr
(Ptr CommandBuffer_T
-> ("pRenderPassBegin" ::: Ptr (SomeStruct RenderPassBeginInfo))
-> ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> IO ())
-> Ptr CommandBuffer_T
-> ("pRenderPassBegin" ::: Ptr (SomeStruct RenderPassBeginInfo))
-> ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> IO ()
mkVkCmdBeginRenderPass2 FunPtr
(Ptr CommandBuffer_T
-> ("pRenderPassBegin" ::: Ptr (SomeStruct RenderPassBeginInfo))
-> ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> IO ())
vkCmdBeginRenderPass2Ptr
Ptr (RenderPassBeginInfo a)
pRenderPassBegin <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (RenderPassBeginInfo a
renderPassBegin)
"pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
pSubpassBeginInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (SubpassBeginInfo
subpassBeginInfo)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdBeginRenderPass2" (Ptr CommandBuffer_T
-> ("pRenderPassBegin" ::: Ptr (SomeStruct RenderPassBeginInfo))
-> ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> IO ()
vkCmdBeginRenderPass2'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (RenderPassBeginInfo a)
pRenderPassBegin)
"pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
pSubpassBeginInfo)
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
cmdUseRenderPass2 :: forall a io r . (Extendss RenderPassBeginInfo a, Extendss SubpassEndInfo a, PokeChain a, PokeChain a, MonadIO io) => CommandBuffer -> RenderPassBeginInfo a -> SubpassBeginInfo -> SubpassEndInfo a -> io r -> io r
cmdUseRenderPass2 :: forall (a :: [*]) (io :: * -> *) r.
(Extendss RenderPassBeginInfo a, Extendss SubpassEndInfo a,
PokeChain a, PokeChain a, MonadIO io) =>
CommandBuffer
-> RenderPassBeginInfo a
-> SubpassBeginInfo
-> SubpassEndInfo a
-> io r
-> io r
cmdUseRenderPass2 CommandBuffer
commandBuffer
RenderPassBeginInfo a
pRenderPassBegin
SubpassBeginInfo
pSubpassBeginInfo
SubpassEndInfo a
pSubpassEndInfo
io r
a =
(forall (a :: [*]) (io :: * -> *).
(Extendss RenderPassBeginInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> RenderPassBeginInfo a -> SubpassBeginInfo -> io ()
cmdBeginRenderPass2 CommandBuffer
commandBuffer
RenderPassBeginInfo a
pRenderPassBegin
SubpassBeginInfo
pSubpassBeginInfo) forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
*> io r
a forall (f :: * -> *) a b. Applicative f => f a -> f b -> f a
<* (forall (a :: [*]) (io :: * -> *).
(Extendss SubpassEndInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> SubpassEndInfo a -> io ()
cmdEndRenderPass2 CommandBuffer
commandBuffer
SubpassEndInfo a
pSubpassEndInfo)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdNextSubpass2
:: FunPtr (Ptr CommandBuffer_T -> Ptr SubpassBeginInfo -> Ptr (SomeStruct SubpassEndInfo) -> IO ()) -> Ptr CommandBuffer_T -> Ptr SubpassBeginInfo -> Ptr (SomeStruct SubpassEndInfo) -> IO ()
cmdNextSubpass2 :: forall a io
. (Extendss SubpassEndInfo a, PokeChain a, MonadIO io)
=>
CommandBuffer
->
SubpassBeginInfo
->
(SubpassEndInfo a)
-> io ()
cmdNextSubpass2 :: forall (a :: [*]) (io :: * -> *).
(Extendss SubpassEndInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> SubpassBeginInfo -> SubpassEndInfo a -> io ()
cmdNextSubpass2 CommandBuffer
commandBuffer
SubpassBeginInfo
subpassBeginInfo
SubpassEndInfo a
subpassEndInfo = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
let vkCmdNextSubpass2Ptr :: FunPtr
(Ptr CommandBuffer_T
-> ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> ("pSubpassEndInfo" ::: Ptr (SomeStruct SubpassEndInfo))
-> IO ())
vkCmdNextSubpass2Ptr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> ("pSubpassEndInfo" ::: Ptr (SomeStruct SubpassEndInfo))
-> IO ())
pVkCmdNextSubpass2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> ("pSubpassEndInfo" ::: Ptr (SomeStruct SubpassEndInfo))
-> IO ())
vkCmdNextSubpass2Ptr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdNextSubpass2 is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCmdNextSubpass2' :: Ptr CommandBuffer_T
-> ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> ("pSubpassEndInfo" ::: Ptr (SomeStruct SubpassEndInfo))
-> IO ()
vkCmdNextSubpass2' = FunPtr
(Ptr CommandBuffer_T
-> ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> ("pSubpassEndInfo" ::: Ptr (SomeStruct SubpassEndInfo))
-> IO ())
-> Ptr CommandBuffer_T
-> ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> ("pSubpassEndInfo" ::: Ptr (SomeStruct SubpassEndInfo))
-> IO ()
mkVkCmdNextSubpass2 FunPtr
(Ptr CommandBuffer_T
-> ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> ("pSubpassEndInfo" ::: Ptr (SomeStruct SubpassEndInfo))
-> IO ())
vkCmdNextSubpass2Ptr
"pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
pSubpassBeginInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (SubpassBeginInfo
subpassBeginInfo)
Ptr (SubpassEndInfo a)
pSubpassEndInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (SubpassEndInfo a
subpassEndInfo)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdNextSubpass2" (Ptr CommandBuffer_T
-> ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> ("pSubpassEndInfo" ::: Ptr (SomeStruct SubpassEndInfo))
-> IO ()
vkCmdNextSubpass2'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
"pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
pSubpassBeginInfo
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (SubpassEndInfo a)
pSubpassEndInfo))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdEndRenderPass2
:: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct SubpassEndInfo) -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct SubpassEndInfo) -> IO ()
cmdEndRenderPass2 :: forall a io
. (Extendss SubpassEndInfo a, PokeChain a, MonadIO io)
=>
CommandBuffer
->
(SubpassEndInfo a)
-> io ()
cmdEndRenderPass2 :: forall (a :: [*]) (io :: * -> *).
(Extendss SubpassEndInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> SubpassEndInfo a -> io ()
cmdEndRenderPass2 CommandBuffer
commandBuffer SubpassEndInfo a
subpassEndInfo = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
let vkCmdEndRenderPass2Ptr :: FunPtr
(Ptr CommandBuffer_T
-> ("pSubpassEndInfo" ::: Ptr (SomeStruct SubpassEndInfo))
-> IO ())
vkCmdEndRenderPass2Ptr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("pSubpassEndInfo" ::: Ptr (SomeStruct SubpassEndInfo))
-> IO ())
pVkCmdEndRenderPass2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("pSubpassEndInfo" ::: Ptr (SomeStruct SubpassEndInfo))
-> IO ())
vkCmdEndRenderPass2Ptr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdEndRenderPass2 is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCmdEndRenderPass2' :: Ptr CommandBuffer_T
-> ("pSubpassEndInfo" ::: Ptr (SomeStruct SubpassEndInfo)) -> IO ()
vkCmdEndRenderPass2' = FunPtr
(Ptr CommandBuffer_T
-> ("pSubpassEndInfo" ::: Ptr (SomeStruct SubpassEndInfo))
-> IO ())
-> Ptr CommandBuffer_T
-> ("pSubpassEndInfo" ::: Ptr (SomeStruct SubpassEndInfo))
-> IO ()
mkVkCmdEndRenderPass2 FunPtr
(Ptr CommandBuffer_T
-> ("pSubpassEndInfo" ::: Ptr (SomeStruct SubpassEndInfo))
-> IO ())
vkCmdEndRenderPass2Ptr
Ptr (SubpassEndInfo a)
pSubpassEndInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (SubpassEndInfo a
subpassEndInfo)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdEndRenderPass2" (Ptr CommandBuffer_T
-> ("pSubpassEndInfo" ::: Ptr (SomeStruct SubpassEndInfo)) -> IO ()
vkCmdEndRenderPass2'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (SubpassEndInfo a)
pSubpassEndInfo))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
data AttachmentDescription2 (es :: [Type]) = AttachmentDescription2
{
forall (es :: [*]). AttachmentDescription2 es -> Chain es
next :: Chain es
,
forall (es :: [*]).
AttachmentDescription2 es -> AttachmentDescriptionFlags
flags :: AttachmentDescriptionFlags
,
forall (es :: [*]). AttachmentDescription2 es -> Format
format :: Format
,
forall (es :: [*]).
AttachmentDescription2 es -> SampleCountFlagBits
samples :: SampleCountFlagBits
,
forall (es :: [*]). AttachmentDescription2 es -> AttachmentLoadOp
loadOp :: AttachmentLoadOp
,
forall (es :: [*]). AttachmentDescription2 es -> AttachmentStoreOp
storeOp :: AttachmentStoreOp
,
forall (es :: [*]). AttachmentDescription2 es -> AttachmentLoadOp
stencilLoadOp :: AttachmentLoadOp
,
forall (es :: [*]). AttachmentDescription2 es -> AttachmentStoreOp
stencilStoreOp :: AttachmentStoreOp
,
forall (es :: [*]). AttachmentDescription2 es -> ImageLayout
initialLayout :: ImageLayout
,
forall (es :: [*]). AttachmentDescription2 es -> ImageLayout
finalLayout :: ImageLayout
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AttachmentDescription2 (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (AttachmentDescription2 es)
instance Extensible AttachmentDescription2 where
extensibleTypeName :: String
extensibleTypeName = String
"AttachmentDescription2"
setNext :: forall (ds :: [*]) (es :: [*]).
AttachmentDescription2 ds -> Chain es -> AttachmentDescription2 es
setNext AttachmentDescription2{Chain ds
Format
ImageLayout
SampleCountFlagBits
AttachmentStoreOp
AttachmentLoadOp
AttachmentDescriptionFlags
finalLayout :: ImageLayout
initialLayout :: ImageLayout
stencilStoreOp :: AttachmentStoreOp
stencilLoadOp :: AttachmentLoadOp
storeOp :: AttachmentStoreOp
loadOp :: AttachmentLoadOp
samples :: SampleCountFlagBits
format :: Format
flags :: AttachmentDescriptionFlags
next :: Chain ds
$sel:finalLayout:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> ImageLayout
$sel:initialLayout:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> ImageLayout
$sel:stencilStoreOp:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentStoreOp
$sel:stencilLoadOp:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentLoadOp
$sel:storeOp:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentStoreOp
$sel:loadOp:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentLoadOp
$sel:samples:AttachmentDescription2 :: forall (es :: [*]).
AttachmentDescription2 es -> SampleCountFlagBits
$sel:format:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> Format
$sel:flags:AttachmentDescription2 :: forall (es :: [*]).
AttachmentDescription2 es -> AttachmentDescriptionFlags
$sel:next:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> Chain es
..} Chain es
next' = AttachmentDescription2{$sel:next:AttachmentDescription2 :: Chain es
next = Chain es
next', Format
ImageLayout
SampleCountFlagBits
AttachmentStoreOp
AttachmentLoadOp
AttachmentDescriptionFlags
finalLayout :: ImageLayout
initialLayout :: ImageLayout
stencilStoreOp :: AttachmentStoreOp
stencilLoadOp :: AttachmentLoadOp
storeOp :: AttachmentStoreOp
loadOp :: AttachmentLoadOp
samples :: SampleCountFlagBits
format :: Format
flags :: AttachmentDescriptionFlags
$sel:finalLayout:AttachmentDescription2 :: ImageLayout
$sel:initialLayout:AttachmentDescription2 :: ImageLayout
$sel:stencilStoreOp:AttachmentDescription2 :: AttachmentStoreOp
$sel:stencilLoadOp:AttachmentDescription2 :: AttachmentLoadOp
$sel:storeOp:AttachmentDescription2 :: AttachmentStoreOp
$sel:loadOp:AttachmentDescription2 :: AttachmentLoadOp
$sel:samples:AttachmentDescription2 :: SampleCountFlagBits
$sel:format:AttachmentDescription2 :: Format
$sel:flags:AttachmentDescription2 :: AttachmentDescriptionFlags
..}
getNext :: forall (es :: [*]). AttachmentDescription2 es -> Chain es
getNext AttachmentDescription2{Chain es
Format
ImageLayout
SampleCountFlagBits
AttachmentStoreOp
AttachmentLoadOp
AttachmentDescriptionFlags
finalLayout :: ImageLayout
initialLayout :: ImageLayout
stencilStoreOp :: AttachmentStoreOp
stencilLoadOp :: AttachmentLoadOp
storeOp :: AttachmentStoreOp
loadOp :: AttachmentLoadOp
samples :: SampleCountFlagBits
format :: Format
flags :: AttachmentDescriptionFlags
next :: Chain es
$sel:finalLayout:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> ImageLayout
$sel:initialLayout:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> ImageLayout
$sel:stencilStoreOp:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentStoreOp
$sel:stencilLoadOp:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentLoadOp
$sel:storeOp:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentStoreOp
$sel:loadOp:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentLoadOp
$sel:samples:AttachmentDescription2 :: forall (es :: [*]).
AttachmentDescription2 es -> SampleCountFlagBits
$sel:format:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> Format
$sel:flags:AttachmentDescription2 :: forall (es :: [*]).
AttachmentDescription2 es -> AttachmentDescriptionFlags
$sel:next:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends AttachmentDescription2 e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends AttachmentDescription2 e => b) -> Maybe b
extends proxy e
_ Extends AttachmentDescription2 e => b
f
| Just e :~: AttachmentDescriptionStencilLayout
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @AttachmentDescriptionStencilLayout = forall a. a -> Maybe a
Just Extends AttachmentDescription2 e => b
f
| Just e :~: ExternalFormatANDROID
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @ExternalFormatANDROID = forall a. a -> Maybe a
Just Extends AttachmentDescription2 e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss AttachmentDescription2 es
, PokeChain es ) => ToCStruct (AttachmentDescription2 es) where
withCStruct :: forall b.
AttachmentDescription2 es
-> (Ptr (AttachmentDescription2 es) -> IO b) -> IO b
withCStruct AttachmentDescription2 es
x Ptr (AttachmentDescription2 es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 forall a b. (a -> b) -> a -> b
$ \Ptr (AttachmentDescription2 es)
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (AttachmentDescription2 es)
p AttachmentDescription2 es
x (Ptr (AttachmentDescription2 es) -> IO b
f Ptr (AttachmentDescription2 es)
p)
pokeCStruct :: forall b.
Ptr (AttachmentDescription2 es)
-> AttachmentDescription2 es -> IO b -> IO b
pokeCStruct Ptr (AttachmentDescription2 es)
p AttachmentDescription2{Chain es
Format
ImageLayout
SampleCountFlagBits
AttachmentStoreOp
AttachmentLoadOp
AttachmentDescriptionFlags
finalLayout :: ImageLayout
initialLayout :: ImageLayout
stencilStoreOp :: AttachmentStoreOp
stencilLoadOp :: AttachmentLoadOp
storeOp :: AttachmentStoreOp
loadOp :: AttachmentLoadOp
samples :: SampleCountFlagBits
format :: Format
flags :: AttachmentDescriptionFlags
next :: Chain es
$sel:finalLayout:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> ImageLayout
$sel:initialLayout:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> ImageLayout
$sel:stencilStoreOp:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentStoreOp
$sel:stencilLoadOp:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentLoadOp
$sel:storeOp:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentStoreOp
$sel:loadOp:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentLoadOp
$sel:samples:AttachmentDescription2 :: forall (es :: [*]).
AttachmentDescription2 es -> SampleCountFlagBits
$sel:format:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> Format
$sel:flags:AttachmentDescription2 :: forall (es :: [*]).
AttachmentDescription2 es -> AttachmentDescriptionFlags
$sel:next:AttachmentDescription2 :: forall (es :: [*]). AttachmentDescription2 es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr AttachmentDescriptionFlags)) (AttachmentDescriptionFlags
flags)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Format)) (Format
format)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr SampleCountFlagBits)) (SampleCountFlagBits
samples)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr AttachmentLoadOp)) (AttachmentLoadOp
loadOp)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr AttachmentStoreOp)) (AttachmentStoreOp
storeOp)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr AttachmentLoadOp)) (AttachmentLoadOp
stencilLoadOp)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr AttachmentStoreOp)) (AttachmentStoreOp
stencilStoreOp)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ImageLayout)) (ImageLayout
initialLayout)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr ImageLayout)) (ImageLayout
finalLayout)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
56
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (AttachmentDescription2 es) -> IO b -> IO b
pokeZeroCStruct Ptr (AttachmentDescription2 es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Format)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr SampleCountFlagBits)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr AttachmentLoadOp)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr AttachmentStoreOp)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr AttachmentLoadOp)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr AttachmentStoreOp)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ImageLayout)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr ImageLayout)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
instance ( Extendss AttachmentDescription2 es
, PeekChain es ) => FromCStruct (AttachmentDescription2 es) where
peekCStruct :: Ptr (AttachmentDescription2 es) -> IO (AttachmentDescription2 es)
peekCStruct Ptr (AttachmentDescription2 es)
p = do
Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
AttachmentDescriptionFlags
flags <- forall a. Storable a => Ptr a -> IO a
peek @AttachmentDescriptionFlags ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr AttachmentDescriptionFlags))
Format
format <- forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Format))
SampleCountFlagBits
samples <- forall a. Storable a => Ptr a -> IO a
peek @SampleCountFlagBits ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr SampleCountFlagBits))
AttachmentLoadOp
loadOp <- forall a. Storable a => Ptr a -> IO a
peek @AttachmentLoadOp ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr AttachmentLoadOp))
AttachmentStoreOp
storeOp <- forall a. Storable a => Ptr a -> IO a
peek @AttachmentStoreOp ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr AttachmentStoreOp))
AttachmentLoadOp
stencilLoadOp <- forall a. Storable a => Ptr a -> IO a
peek @AttachmentLoadOp ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr AttachmentLoadOp))
AttachmentStoreOp
stencilStoreOp <- forall a. Storable a => Ptr a -> IO a
peek @AttachmentStoreOp ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr AttachmentStoreOp))
ImageLayout
initialLayout <- forall a. Storable a => Ptr a -> IO a
peek @ImageLayout ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr ImageLayout))
ImageLayout
finalLayout <- forall a. Storable a => Ptr a -> IO a
peek @ImageLayout ((Ptr (AttachmentDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr ImageLayout))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]).
Chain es
-> AttachmentDescriptionFlags
-> Format
-> SampleCountFlagBits
-> AttachmentLoadOp
-> AttachmentStoreOp
-> AttachmentLoadOp
-> AttachmentStoreOp
-> ImageLayout
-> ImageLayout
-> AttachmentDescription2 es
AttachmentDescription2
Chain es
next
AttachmentDescriptionFlags
flags
Format
format
SampleCountFlagBits
samples
AttachmentLoadOp
loadOp
AttachmentStoreOp
storeOp
AttachmentLoadOp
stencilLoadOp
AttachmentStoreOp
stencilStoreOp
ImageLayout
initialLayout
ImageLayout
finalLayout
instance es ~ '[] => Zero (AttachmentDescription2 es) where
zero :: AttachmentDescription2 es
zero = forall (es :: [*]).
Chain es
-> AttachmentDescriptionFlags
-> Format
-> SampleCountFlagBits
-> AttachmentLoadOp
-> AttachmentStoreOp
-> AttachmentLoadOp
-> AttachmentStoreOp
-> ImageLayout
-> ImageLayout
-> AttachmentDescription2 es
AttachmentDescription2
()
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data AttachmentReference2 (es :: [Type]) = AttachmentReference2
{
forall (es :: [*]). AttachmentReference2 es -> Chain es
next :: Chain es
,
forall (es :: [*]). AttachmentReference2 es -> Word32
attachment :: Word32
,
forall (es :: [*]). AttachmentReference2 es -> ImageLayout
layout :: ImageLayout
,
forall (es :: [*]). AttachmentReference2 es -> ImageAspectFlags
aspectMask :: ImageAspectFlags
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AttachmentReference2 (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (AttachmentReference2 es)
instance Extensible AttachmentReference2 where
extensibleTypeName :: String
extensibleTypeName = String
"AttachmentReference2"
setNext :: forall (ds :: [*]) (es :: [*]).
AttachmentReference2 ds -> Chain es -> AttachmentReference2 es
setNext AttachmentReference2{Word32
Chain ds
ImageAspectFlags
ImageLayout
aspectMask :: ImageAspectFlags
layout :: ImageLayout
attachment :: Word32
next :: Chain ds
$sel:aspectMask:AttachmentReference2 :: forall (es :: [*]). AttachmentReference2 es -> ImageAspectFlags
$sel:layout:AttachmentReference2 :: forall (es :: [*]). AttachmentReference2 es -> ImageLayout
$sel:attachment:AttachmentReference2 :: forall (es :: [*]). AttachmentReference2 es -> Word32
$sel:next:AttachmentReference2 :: forall (es :: [*]). AttachmentReference2 es -> Chain es
..} Chain es
next' = AttachmentReference2{$sel:next:AttachmentReference2 :: Chain es
next = Chain es
next', Word32
ImageAspectFlags
ImageLayout
aspectMask :: ImageAspectFlags
layout :: ImageLayout
attachment :: Word32
$sel:aspectMask:AttachmentReference2 :: ImageAspectFlags
$sel:layout:AttachmentReference2 :: ImageLayout
$sel:attachment:AttachmentReference2 :: Word32
..}
getNext :: forall (es :: [*]). AttachmentReference2 es -> Chain es
getNext AttachmentReference2{Word32
Chain es
ImageAspectFlags
ImageLayout
aspectMask :: ImageAspectFlags
layout :: ImageLayout
attachment :: Word32
next :: Chain es
$sel:aspectMask:AttachmentReference2 :: forall (es :: [*]). AttachmentReference2 es -> ImageAspectFlags
$sel:layout:AttachmentReference2 :: forall (es :: [*]). AttachmentReference2 es -> ImageLayout
$sel:attachment:AttachmentReference2 :: forall (es :: [*]). AttachmentReference2 es -> Word32
$sel:next:AttachmentReference2 :: forall (es :: [*]). AttachmentReference2 es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends AttachmentReference2 e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends AttachmentReference2 e => b) -> Maybe b
extends proxy e
_ Extends AttachmentReference2 e => b
f
| Just e :~: AttachmentReferenceStencilLayout
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @AttachmentReferenceStencilLayout = forall a. a -> Maybe a
Just Extends AttachmentReference2 e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss AttachmentReference2 es
, PokeChain es ) => ToCStruct (AttachmentReference2 es) where
withCStruct :: forall b.
AttachmentReference2 es
-> (Ptr (AttachmentReference2 es) -> IO b) -> IO b
withCStruct AttachmentReference2 es
x Ptr (AttachmentReference2 es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr (AttachmentReference2 es)
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (AttachmentReference2 es)
p AttachmentReference2 es
x (Ptr (AttachmentReference2 es) -> IO b
f Ptr (AttachmentReference2 es)
p)
pokeCStruct :: forall b.
Ptr (AttachmentReference2 es)
-> AttachmentReference2 es -> IO b -> IO b
pokeCStruct Ptr (AttachmentReference2 es)
p AttachmentReference2{Word32
Chain es
ImageAspectFlags
ImageLayout
aspectMask :: ImageAspectFlags
layout :: ImageLayout
attachment :: Word32
next :: Chain es
$sel:aspectMask:AttachmentReference2 :: forall (es :: [*]). AttachmentReference2 es -> ImageAspectFlags
$sel:layout:AttachmentReference2 :: forall (es :: [*]). AttachmentReference2 es -> ImageLayout
$sel:attachment:AttachmentReference2 :: forall (es :: [*]). AttachmentReference2 es -> Word32
$sel:next:AttachmentReference2 :: forall (es :: [*]). AttachmentReference2 es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentReference2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentReference2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentReference2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
attachment)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentReference2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr ImageLayout)) (ImageLayout
layout)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentReference2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageAspectFlags)) (ImageAspectFlags
aspectMask)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (AttachmentReference2 es) -> IO b -> IO b
pokeZeroCStruct Ptr (AttachmentReference2 es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentReference2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentReference2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentReference2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentReference2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr ImageLayout)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (AttachmentReference2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageAspectFlags)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
instance ( Extendss AttachmentReference2 es
, PeekChain es ) => FromCStruct (AttachmentReference2 es) where
peekCStruct :: Ptr (AttachmentReference2 es) -> IO (AttachmentReference2 es)
peekCStruct Ptr (AttachmentReference2 es)
p = do
Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (AttachmentReference2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
Word32
attachment <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (AttachmentReference2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
ImageLayout
layout <- forall a. Storable a => Ptr a -> IO a
peek @ImageLayout ((Ptr (AttachmentReference2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr ImageLayout))
ImageAspectFlags
aspectMask <- forall a. Storable a => Ptr a -> IO a
peek @ImageAspectFlags ((Ptr (AttachmentReference2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageAspectFlags))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]).
Chain es
-> Word32
-> ImageLayout
-> ImageAspectFlags
-> AttachmentReference2 es
AttachmentReference2
Chain es
next Word32
attachment ImageLayout
layout ImageAspectFlags
aspectMask
instance es ~ '[] => Zero (AttachmentReference2 es) where
zero :: AttachmentReference2 es
zero = forall (es :: [*]).
Chain es
-> Word32
-> ImageLayout
-> ImageAspectFlags
-> AttachmentReference2 es
AttachmentReference2
()
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data SubpassDescription2 (es :: [Type]) = SubpassDescription2
{
forall (es :: [*]). SubpassDescription2 es -> Chain es
next :: Chain es
,
forall (es :: [*]).
SubpassDescription2 es -> SubpassDescriptionFlags
flags :: SubpassDescriptionFlags
,
forall (es :: [*]). SubpassDescription2 es -> PipelineBindPoint
pipelineBindPoint :: PipelineBindPoint
,
forall (es :: [*]). SubpassDescription2 es -> Word32
viewMask :: Word32
,
forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
inputAttachments :: Vector (SomeStruct AttachmentReference2)
,
forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
colorAttachments :: Vector (SomeStruct AttachmentReference2)
,
forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
resolveAttachments :: Vector (SomeStruct AttachmentReference2)
,
forall (es :: [*]).
SubpassDescription2 es -> Maybe (SomeStruct AttachmentReference2)
depthStencilAttachment :: Maybe (SomeStruct AttachmentReference2)
,
forall (es :: [*]). SubpassDescription2 es -> Vector Word32
preserveAttachments :: Vector Word32
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SubpassDescription2 (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (SubpassDescription2 es)
instance Extensible SubpassDescription2 where
extensibleTypeName :: String
extensibleTypeName = String
"SubpassDescription2"
setNext :: forall (ds :: [*]) (es :: [*]).
SubpassDescription2 ds -> Chain es -> SubpassDescription2 es
setNext SubpassDescription2{Maybe (SomeStruct AttachmentReference2)
Word32
Vector Word32
Vector (SomeStruct AttachmentReference2)
Chain ds
PipelineBindPoint
SubpassDescriptionFlags
preserveAttachments :: Vector Word32
depthStencilAttachment :: Maybe (SomeStruct AttachmentReference2)
resolveAttachments :: Vector (SomeStruct AttachmentReference2)
colorAttachments :: Vector (SomeStruct AttachmentReference2)
inputAttachments :: Vector (SomeStruct AttachmentReference2)
viewMask :: Word32
pipelineBindPoint :: PipelineBindPoint
flags :: SubpassDescriptionFlags
next :: Chain ds
$sel:preserveAttachments:SubpassDescription2 :: forall (es :: [*]). SubpassDescription2 es -> Vector Word32
$sel:depthStencilAttachment:SubpassDescription2 :: forall (es :: [*]).
SubpassDescription2 es -> Maybe (SomeStruct AttachmentReference2)
$sel:resolveAttachments:SubpassDescription2 :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
$sel:colorAttachments:SubpassDescription2 :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
$sel:inputAttachments:SubpassDescription2 :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
$sel:viewMask:SubpassDescription2 :: forall (es :: [*]). SubpassDescription2 es -> Word32
$sel:pipelineBindPoint:SubpassDescription2 :: forall (es :: [*]). SubpassDescription2 es -> PipelineBindPoint
$sel:flags:SubpassDescription2 :: forall (es :: [*]).
SubpassDescription2 es -> SubpassDescriptionFlags
$sel:next:SubpassDescription2 :: forall (es :: [*]). SubpassDescription2 es -> Chain es
..} Chain es
next' = SubpassDescription2{$sel:next:SubpassDescription2 :: Chain es
next = Chain es
next', Maybe (SomeStruct AttachmentReference2)
Word32
Vector Word32
Vector (SomeStruct AttachmentReference2)
PipelineBindPoint
SubpassDescriptionFlags
preserveAttachments :: Vector Word32
depthStencilAttachment :: Maybe (SomeStruct AttachmentReference2)
resolveAttachments :: Vector (SomeStruct AttachmentReference2)
colorAttachments :: Vector (SomeStruct AttachmentReference2)
inputAttachments :: Vector (SomeStruct AttachmentReference2)
viewMask :: Word32
pipelineBindPoint :: PipelineBindPoint
flags :: SubpassDescriptionFlags
$sel:preserveAttachments:SubpassDescription2 :: Vector Word32
$sel:depthStencilAttachment:SubpassDescription2 :: Maybe (SomeStruct AttachmentReference2)
$sel:resolveAttachments:SubpassDescription2 :: Vector (SomeStruct AttachmentReference2)
$sel:colorAttachments:SubpassDescription2 :: Vector (SomeStruct AttachmentReference2)
$sel:inputAttachments:SubpassDescription2 :: Vector (SomeStruct AttachmentReference2)
$sel:viewMask:SubpassDescription2 :: Word32
$sel:pipelineBindPoint:SubpassDescription2 :: PipelineBindPoint
$sel:flags:SubpassDescription2 :: SubpassDescriptionFlags
..}
getNext :: forall (es :: [*]). SubpassDescription2 es -> Chain es
getNext SubpassDescription2{Maybe (SomeStruct AttachmentReference2)
Word32
Vector Word32
Vector (SomeStruct AttachmentReference2)
Chain es
PipelineBindPoint
SubpassDescriptionFlags
preserveAttachments :: Vector Word32
depthStencilAttachment :: Maybe (SomeStruct AttachmentReference2)
resolveAttachments :: Vector (SomeStruct AttachmentReference2)
colorAttachments :: Vector (SomeStruct AttachmentReference2)
inputAttachments :: Vector (SomeStruct AttachmentReference2)
viewMask :: Word32
pipelineBindPoint :: PipelineBindPoint
flags :: SubpassDescriptionFlags
next :: Chain es
$sel:preserveAttachments:SubpassDescription2 :: forall (es :: [*]). SubpassDescription2 es -> Vector Word32
$sel:depthStencilAttachment:SubpassDescription2 :: forall (es :: [*]).
SubpassDescription2 es -> Maybe (SomeStruct AttachmentReference2)
$sel:resolveAttachments:SubpassDescription2 :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
$sel:colorAttachments:SubpassDescription2 :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
$sel:inputAttachments:SubpassDescription2 :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
$sel:viewMask:SubpassDescription2 :: forall (es :: [*]). SubpassDescription2 es -> Word32
$sel:pipelineBindPoint:SubpassDescription2 :: forall (es :: [*]). SubpassDescription2 es -> PipelineBindPoint
$sel:flags:SubpassDescription2 :: forall (es :: [*]).
SubpassDescription2 es -> SubpassDescriptionFlags
$sel:next:SubpassDescription2 :: forall (es :: [*]). SubpassDescription2 es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends SubpassDescription2 e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends SubpassDescription2 e => b) -> Maybe b
extends proxy e
_ Extends SubpassDescription2 e => b
f
| Just e :~: RenderPassSubpassFeedbackCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @RenderPassSubpassFeedbackCreateInfoEXT = forall a. a -> Maybe a
Just Extends SubpassDescription2 e => b
f
| Just e :~: RenderPassCreationControlEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @RenderPassCreationControlEXT = forall a. a -> Maybe a
Just Extends SubpassDescription2 e => b
f
| Just e :~: MultisampledRenderToSingleSampledInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @MultisampledRenderToSingleSampledInfoEXT = forall a. a -> Maybe a
Just Extends SubpassDescription2 e => b
f
| Just e :~: FragmentShadingRateAttachmentInfoKHR
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @FragmentShadingRateAttachmentInfoKHR = forall a. a -> Maybe a
Just Extends SubpassDescription2 e => b
f
| Just e :~: SubpassDescriptionDepthStencilResolve
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @SubpassDescriptionDepthStencilResolve = forall a. a -> Maybe a
Just Extends SubpassDescription2 e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss SubpassDescription2 es
, PokeChain es ) => ToCStruct (SubpassDescription2 es) where
withCStruct :: forall b.
SubpassDescription2 es
-> (Ptr (SubpassDescription2 es) -> IO b) -> IO b
withCStruct SubpassDescription2 es
x Ptr (SubpassDescription2 es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
88 forall a b. (a -> b) -> a -> b
$ \Ptr (SubpassDescription2 es)
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (SubpassDescription2 es)
p SubpassDescription2 es
x (Ptr (SubpassDescription2 es) -> IO b
f Ptr (SubpassDescription2 es)
p)
pokeCStruct :: forall b.
Ptr (SubpassDescription2 es)
-> SubpassDescription2 es -> IO b -> IO b
pokeCStruct Ptr (SubpassDescription2 es)
p SubpassDescription2{Maybe (SomeStruct AttachmentReference2)
Word32
Vector Word32
Vector (SomeStruct AttachmentReference2)
Chain es
PipelineBindPoint
SubpassDescriptionFlags
preserveAttachments :: Vector Word32
depthStencilAttachment :: Maybe (SomeStruct AttachmentReference2)
resolveAttachments :: Vector (SomeStruct AttachmentReference2)
colorAttachments :: Vector (SomeStruct AttachmentReference2)
inputAttachments :: Vector (SomeStruct AttachmentReference2)
viewMask :: Word32
pipelineBindPoint :: PipelineBindPoint
flags :: SubpassDescriptionFlags
next :: Chain es
$sel:preserveAttachments:SubpassDescription2 :: forall (es :: [*]). SubpassDescription2 es -> Vector Word32
$sel:depthStencilAttachment:SubpassDescription2 :: forall (es :: [*]).
SubpassDescription2 es -> Maybe (SomeStruct AttachmentReference2)
$sel:resolveAttachments:SubpassDescription2 :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
$sel:colorAttachments:SubpassDescription2 :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
$sel:inputAttachments:SubpassDescription2 :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
$sel:viewMask:SubpassDescription2 :: forall (es :: [*]). SubpassDescription2 es -> Word32
$sel:pipelineBindPoint:SubpassDescription2 :: forall (es :: [*]). SubpassDescription2 es -> PipelineBindPoint
$sel:flags:SubpassDescription2 :: forall (es :: [*]).
SubpassDescription2 es -> SubpassDescriptionFlags
$sel:next:SubpassDescription2 :: forall (es :: [*]). SubpassDescription2 es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SubpassDescriptionFlags)) (SubpassDescriptionFlags
flags)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr PipelineBindPoint)) (PipelineBindPoint
pipelineBindPoint)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Word32
viewMask)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct AttachmentReference2)
inputAttachments)) :: Word32))
Ptr (AttachmentReference2 Any)
pPInputAttachments' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(AttachmentReference2 _) ((forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct AttachmentReference2)
inputAttachments)) forall a. Num a => a -> a -> a
* Int
32)
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SomeStruct AttachmentReference2
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (AttachmentReference2 Any)
pPInputAttachments' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
32 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AttachmentReference2 _))) (SomeStruct AttachmentReference2
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) (Vector (SomeStruct AttachmentReference2)
inputAttachments)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr (AttachmentReference2 _)))) (Ptr (AttachmentReference2 Any)
pPInputAttachments')
let pColorAttachmentsLength :: Int
pColorAttachmentsLength = forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct AttachmentReference2)
colorAttachments)
let pResolveAttachmentsLength :: Int
pResolveAttachmentsLength = forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct AttachmentReference2)
resolveAttachments)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pResolveAttachmentsLength forall a. Eq a => a -> a -> Bool
== Int
pColorAttachmentsLength Bool -> Bool -> Bool
|| Int
pResolveAttachmentsLength forall a. Eq a => a -> a -> Bool
== Int
0) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"pResolveAttachments and pColorAttachments must have the same length" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pColorAttachmentsLength :: Word32))
Ptr (AttachmentReference2 Any)
pPColorAttachments' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(AttachmentReference2 _) ((forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct AttachmentReference2)
colorAttachments)) forall a. Num a => a -> a -> a
* Int
32)
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SomeStruct AttachmentReference2
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (AttachmentReference2 Any)
pPColorAttachments' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
32 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AttachmentReference2 _))) (SomeStruct AttachmentReference2
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) (Vector (SomeStruct AttachmentReference2)
colorAttachments)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr (AttachmentReference2 _)))) (Ptr (AttachmentReference2 Any)
pPColorAttachments')
Ptr (AttachmentReference2 Any)
pResolveAttachments'' <- if forall a. Vector a -> Bool
Data.Vector.null (Vector (SomeStruct AttachmentReference2)
resolveAttachments)
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
else do
Ptr (AttachmentReference2 Any)
pPResolveAttachments <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(AttachmentReference2 _) (((forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct AttachmentReference2)
resolveAttachments))) forall a. Num a => a -> a -> a
* Int
32)
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SomeStruct AttachmentReference2
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (AttachmentReference2 Any)
pPResolveAttachments forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
32 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AttachmentReference2 _))) (SomeStruct AttachmentReference2
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) ((Vector (SomeStruct AttachmentReference2)
resolveAttachments))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr (AttachmentReference2 Any)
pPResolveAttachments
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr (Ptr (AttachmentReference2 _)))) Ptr (AttachmentReference2 Any)
pResolveAttachments''
Ptr (AttachmentReference2 '[])
pDepthStencilAttachment'' <- case (Maybe (SomeStruct AttachmentReference2)
depthStencilAttachment) of
Maybe (SomeStruct AttachmentReference2)
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just SomeStruct AttachmentReference2
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (AttachmentReference2 '[])) forall a b. (a -> b) -> a -> b
$ \Ptr (AttachmentReference2 '[]) -> IO b
cont -> forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
(Extendss a es, PokeChain es) =>
Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @AttachmentReference2 (SomeStruct AttachmentReference2
j) (Ptr (AttachmentReference2 '[]) -> IO b
cont forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Ptr a -> Ptr b
castPtr)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr (Ptr (AttachmentReference2 _)))) Ptr (AttachmentReference2 '[])
pDepthStencilAttachment''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector Word32
preserveAttachments)) :: Word32))
Ptr Word32
pPPreserveAttachments' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Word32 ((forall a. Vector a -> Int
Data.Vector.length (Vector Word32
preserveAttachments)) forall a. Num a => a -> a -> a
* Int
4)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Word32
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word32
pPPreserveAttachments' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) (Word32
e)) (Vector Word32
preserveAttachments)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr (Ptr Word32))) (Ptr Word32
pPPreserveAttachments')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
88
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (SubpassDescription2 es) -> IO b -> IO b
pokeZeroCStruct Ptr (SubpassDescription2 es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr PipelineBindPoint)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
instance ( Extendss SubpassDescription2 es
, PeekChain es ) => FromCStruct (SubpassDescription2 es) where
peekCStruct :: Ptr (SubpassDescription2 es) -> IO (SubpassDescription2 es)
peekCStruct Ptr (SubpassDescription2 es)
p = do
Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
SubpassDescriptionFlags
flags <- forall a. Storable a => Ptr a -> IO a
peek @SubpassDescriptionFlags ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SubpassDescriptionFlags))
PipelineBindPoint
pipelineBindPoint <- forall a. Storable a => Ptr a -> IO a
peek @PipelineBindPoint ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr PipelineBindPoint))
Word32
viewMask <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
Word32
inputAttachmentCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32))
Ptr (AttachmentReference2 Any)
pInputAttachments <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (AttachmentReference2 _)) ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr (AttachmentReference2 _))))
Vector (SomeStruct AttachmentReference2)
pInputAttachments' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
inputAttachmentCount) (\Int
i -> forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (AttachmentReference2 Any)
pInputAttachments forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
32 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AttachmentReference2 _)))))
Word32
colorAttachmentCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Word32))
Ptr (AttachmentReference2 Any)
pColorAttachments <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (AttachmentReference2 _)) ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr (AttachmentReference2 _))))
Vector (SomeStruct AttachmentReference2)
pColorAttachments' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
colorAttachmentCount) (\Int
i -> forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (AttachmentReference2 Any)
pColorAttachments forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
32 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AttachmentReference2 _)))))
Ptr (AttachmentReference2 Any)
pResolveAttachments <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (AttachmentReference2 _)) ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr (Ptr (AttachmentReference2 _))))
let pResolveAttachmentsLength :: Int
pResolveAttachmentsLength = if Ptr (AttachmentReference2 Any)
pResolveAttachments forall a. Eq a => a -> a -> Bool
== forall a. Ptr a
nullPtr then Int
0 else (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
colorAttachmentCount)
Vector (SomeStruct AttachmentReference2)
pResolveAttachments' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM Int
pResolveAttachmentsLength (\Int
i -> forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (AttachmentReference2 Any)
pResolveAttachments forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
32 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AttachmentReference2 _)))))
Ptr (AttachmentReference2 Any)
pDepthStencilAttachment <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (AttachmentReference2 _)) ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr (Ptr (AttachmentReference2 _))))
Maybe (SomeStruct AttachmentReference2)
pDepthStencilAttachment' <- forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr (AttachmentReference2 Any)
j -> forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (AttachmentReference2 Any)
j))) Ptr (AttachmentReference2 Any)
pDepthStencilAttachment
Word32
preserveAttachmentCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Word32))
Ptr Word32
pPreserveAttachments <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) ((Ptr (SubpassDescription2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr (Ptr Word32)))
Vector Word32
pPreserveAttachments' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
preserveAttachmentCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr Word32
pPreserveAttachments forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]).
Chain es
-> SubpassDescriptionFlags
-> PipelineBindPoint
-> Word32
-> Vector (SomeStruct AttachmentReference2)
-> Vector (SomeStruct AttachmentReference2)
-> Vector (SomeStruct AttachmentReference2)
-> Maybe (SomeStruct AttachmentReference2)
-> Vector Word32
-> SubpassDescription2 es
SubpassDescription2
Chain es
next
SubpassDescriptionFlags
flags
PipelineBindPoint
pipelineBindPoint
Word32
viewMask
Vector (SomeStruct AttachmentReference2)
pInputAttachments'
Vector (SomeStruct AttachmentReference2)
pColorAttachments'
Vector (SomeStruct AttachmentReference2)
pResolveAttachments'
Maybe (SomeStruct AttachmentReference2)
pDepthStencilAttachment'
Vector Word32
pPreserveAttachments'
instance es ~ '[] => Zero (SubpassDescription2 es) where
zero :: SubpassDescription2 es
zero = forall (es :: [*]).
Chain es
-> SubpassDescriptionFlags
-> PipelineBindPoint
-> Word32
-> Vector (SomeStruct AttachmentReference2)
-> Vector (SomeStruct AttachmentReference2)
-> Vector (SomeStruct AttachmentReference2)
-> Maybe (SomeStruct AttachmentReference2)
-> Vector Word32
-> SubpassDescription2 es
SubpassDescription2
()
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty
forall a. Monoid a => a
mempty
forall a. Monoid a => a
mempty
forall a. Maybe a
Nothing
forall a. Monoid a => a
mempty
data SubpassDependency2 (es :: [Type]) = SubpassDependency2
{
forall (es :: [*]). SubpassDependency2 es -> Chain es
next :: Chain es
,
forall (es :: [*]). SubpassDependency2 es -> Word32
srcSubpass :: Word32
,
forall (es :: [*]). SubpassDependency2 es -> Word32
dstSubpass :: Word32
,
forall (es :: [*]). SubpassDependency2 es -> PipelineStageFlags
srcStageMask :: PipelineStageFlags
,
forall (es :: [*]). SubpassDependency2 es -> PipelineStageFlags
dstStageMask :: PipelineStageFlags
,
forall (es :: [*]). SubpassDependency2 es -> AccessFlags
srcAccessMask :: AccessFlags
,
forall (es :: [*]). SubpassDependency2 es -> AccessFlags
dstAccessMask :: AccessFlags
,
forall (es :: [*]). SubpassDependency2 es -> DependencyFlags
dependencyFlags :: DependencyFlags
,
forall (es :: [*]). SubpassDependency2 es -> Int32
viewOffset :: Int32
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SubpassDependency2 (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (SubpassDependency2 es)
instance Extensible SubpassDependency2 where
extensibleTypeName :: String
extensibleTypeName = String
"SubpassDependency2"
setNext :: forall (ds :: [*]) (es :: [*]).
SubpassDependency2 ds -> Chain es -> SubpassDependency2 es
setNext SubpassDependency2{Int32
Word32
Chain ds
DependencyFlags
PipelineStageFlags
AccessFlags
viewOffset :: Int32
dependencyFlags :: DependencyFlags
dstAccessMask :: AccessFlags
srcAccessMask :: AccessFlags
dstStageMask :: PipelineStageFlags
srcStageMask :: PipelineStageFlags
dstSubpass :: Word32
srcSubpass :: Word32
next :: Chain ds
$sel:viewOffset:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> Int32
$sel:dependencyFlags:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> DependencyFlags
$sel:dstAccessMask:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> AccessFlags
$sel:srcAccessMask:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> AccessFlags
$sel:dstStageMask:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> PipelineStageFlags
$sel:srcStageMask:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> PipelineStageFlags
$sel:dstSubpass:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> Word32
$sel:srcSubpass:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> Word32
$sel:next:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> Chain es
..} Chain es
next' = SubpassDependency2{$sel:next:SubpassDependency2 :: Chain es
next = Chain es
next', Int32
Word32
DependencyFlags
PipelineStageFlags
AccessFlags
viewOffset :: Int32
dependencyFlags :: DependencyFlags
dstAccessMask :: AccessFlags
srcAccessMask :: AccessFlags
dstStageMask :: PipelineStageFlags
srcStageMask :: PipelineStageFlags
dstSubpass :: Word32
srcSubpass :: Word32
$sel:viewOffset:SubpassDependency2 :: Int32
$sel:dependencyFlags:SubpassDependency2 :: DependencyFlags
$sel:dstAccessMask:SubpassDependency2 :: AccessFlags
$sel:srcAccessMask:SubpassDependency2 :: AccessFlags
$sel:dstStageMask:SubpassDependency2 :: PipelineStageFlags
$sel:srcStageMask:SubpassDependency2 :: PipelineStageFlags
$sel:dstSubpass:SubpassDependency2 :: Word32
$sel:srcSubpass:SubpassDependency2 :: Word32
..}
getNext :: forall (es :: [*]). SubpassDependency2 es -> Chain es
getNext SubpassDependency2{Int32
Word32
Chain es
DependencyFlags
PipelineStageFlags
AccessFlags
viewOffset :: Int32
dependencyFlags :: DependencyFlags
dstAccessMask :: AccessFlags
srcAccessMask :: AccessFlags
dstStageMask :: PipelineStageFlags
srcStageMask :: PipelineStageFlags
dstSubpass :: Word32
srcSubpass :: Word32
next :: Chain es
$sel:viewOffset:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> Int32
$sel:dependencyFlags:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> DependencyFlags
$sel:dstAccessMask:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> AccessFlags
$sel:srcAccessMask:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> AccessFlags
$sel:dstStageMask:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> PipelineStageFlags
$sel:srcStageMask:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> PipelineStageFlags
$sel:dstSubpass:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> Word32
$sel:srcSubpass:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> Word32
$sel:next:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends SubpassDependency2 e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends SubpassDependency2 e => b) -> Maybe b
extends proxy e
_ Extends SubpassDependency2 e => b
f
| Just e :~: MemoryBarrier2
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @MemoryBarrier2 = forall a. a -> Maybe a
Just Extends SubpassDependency2 e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss SubpassDependency2 es
, PokeChain es ) => ToCStruct (SubpassDependency2 es) where
withCStruct :: forall b.
SubpassDependency2 es
-> (Ptr (SubpassDependency2 es) -> IO b) -> IO b
withCStruct SubpassDependency2 es
x Ptr (SubpassDependency2 es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 forall a b. (a -> b) -> a -> b
$ \Ptr (SubpassDependency2 es)
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (SubpassDependency2 es)
p SubpassDependency2 es
x (Ptr (SubpassDependency2 es) -> IO b
f Ptr (SubpassDependency2 es)
p)
pokeCStruct :: forall b.
Ptr (SubpassDependency2 es)
-> SubpassDependency2 es -> IO b -> IO b
pokeCStruct Ptr (SubpassDependency2 es)
p SubpassDependency2{Int32
Word32
Chain es
DependencyFlags
PipelineStageFlags
AccessFlags
viewOffset :: Int32
dependencyFlags :: DependencyFlags
dstAccessMask :: AccessFlags
srcAccessMask :: AccessFlags
dstStageMask :: PipelineStageFlags
srcStageMask :: PipelineStageFlags
dstSubpass :: Word32
srcSubpass :: Word32
next :: Chain es
$sel:viewOffset:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> Int32
$sel:dependencyFlags:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> DependencyFlags
$sel:dstAccessMask:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> AccessFlags
$sel:srcAccessMask:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> AccessFlags
$sel:dstStageMask:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> PipelineStageFlags
$sel:srcStageMask:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> PipelineStageFlags
$sel:dstSubpass:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> Word32
$sel:srcSubpass:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> Word32
$sel:next:SubpassDependency2 :: forall (es :: [*]). SubpassDependency2 es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
srcSubpass)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (Word32
dstSubpass)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr PipelineStageFlags)) (PipelineStageFlags
srcStageMask)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr PipelineStageFlags)) (PipelineStageFlags
dstStageMask)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr AccessFlags)) (AccessFlags
srcAccessMask)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr AccessFlags)) (AccessFlags
dstAccessMask)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr DependencyFlags)) (DependencyFlags
dependencyFlags)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Int32)) (Int32
viewOffset)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (SubpassDependency2 es) -> IO b -> IO b
pokeZeroCStruct Ptr (SubpassDependency2 es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Int32)) (forall a. Zero a => a
zero)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
instance ( Extendss SubpassDependency2 es
, PeekChain es ) => FromCStruct (SubpassDependency2 es) where
peekCStruct :: Ptr (SubpassDependency2 es) -> IO (SubpassDependency2 es)
peekCStruct Ptr (SubpassDependency2 es)
p = do
Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
Word32
srcSubpass <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
Word32
dstSubpass <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
PipelineStageFlags
srcStageMask <- forall a. Storable a => Ptr a -> IO a
peek @PipelineStageFlags ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr PipelineStageFlags))
PipelineStageFlags
dstStageMask <- forall a. Storable a => Ptr a -> IO a
peek @PipelineStageFlags ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr PipelineStageFlags))
AccessFlags
srcAccessMask <- forall a. Storable a => Ptr a -> IO a
peek @AccessFlags ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr AccessFlags))
AccessFlags
dstAccessMask <- forall a. Storable a => Ptr a -> IO a
peek @AccessFlags ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr AccessFlags))
DependencyFlags
dependencyFlags <- forall a. Storable a => Ptr a -> IO a
peek @DependencyFlags ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr DependencyFlags))
Int32
viewOffset <- forall a. Storable a => Ptr a -> IO a
peek @Int32 ((Ptr (SubpassDependency2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Int32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]).
Chain es
-> Word32
-> Word32
-> PipelineStageFlags
-> PipelineStageFlags
-> AccessFlags
-> AccessFlags
-> DependencyFlags
-> Int32
-> SubpassDependency2 es
SubpassDependency2
Chain es
next
Word32
srcSubpass
Word32
dstSubpass
PipelineStageFlags
srcStageMask
PipelineStageFlags
dstStageMask
AccessFlags
srcAccessMask
AccessFlags
dstAccessMask
DependencyFlags
dependencyFlags
Int32
viewOffset
instance es ~ '[] => Zero (SubpassDependency2 es) where
zero :: SubpassDependency2 es
zero = forall (es :: [*]).
Chain es
-> Word32
-> Word32
-> PipelineStageFlags
-> PipelineStageFlags
-> AccessFlags
-> AccessFlags
-> DependencyFlags
-> Int32
-> SubpassDependency2 es
SubpassDependency2
()
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data RenderPassCreateInfo2 (es :: [Type]) = RenderPassCreateInfo2
{
forall (es :: [*]). RenderPassCreateInfo2 es -> Chain es
next :: Chain es
,
forall (es :: [*]).
RenderPassCreateInfo2 es -> RenderPassCreateFlags
flags :: RenderPassCreateFlags
,
forall (es :: [*]).
RenderPassCreateInfo2 es
-> Vector (SomeStruct AttachmentDescription2)
attachments :: Vector (SomeStruct AttachmentDescription2)
,
forall (es :: [*]).
RenderPassCreateInfo2 es -> Vector (SomeStruct SubpassDescription2)
subpasses :: Vector (SomeStruct SubpassDescription2)
,
forall (es :: [*]).
RenderPassCreateInfo2 es -> Vector (SomeStruct SubpassDependency2)
dependencies :: Vector (SomeStruct SubpassDependency2)
,
forall (es :: [*]). RenderPassCreateInfo2 es -> Vector Word32
correlatedViewMasks :: Vector Word32
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (RenderPassCreateInfo2 (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (RenderPassCreateInfo2 es)
instance Extensible RenderPassCreateInfo2 where
extensibleTypeName :: String
extensibleTypeName = String
"RenderPassCreateInfo2"
setNext :: forall (ds :: [*]) (es :: [*]).
RenderPassCreateInfo2 ds -> Chain es -> RenderPassCreateInfo2 es
setNext RenderPassCreateInfo2{Vector Word32
Vector (SomeStruct SubpassDescription2)
Vector (SomeStruct SubpassDependency2)
Vector (SomeStruct AttachmentDescription2)
Chain ds
RenderPassCreateFlags
correlatedViewMasks :: Vector Word32
dependencies :: Vector (SomeStruct SubpassDependency2)
subpasses :: Vector (SomeStruct SubpassDescription2)
attachments :: Vector (SomeStruct AttachmentDescription2)
flags :: RenderPassCreateFlags
next :: Chain ds
$sel:correlatedViewMasks:RenderPassCreateInfo2 :: forall (es :: [*]). RenderPassCreateInfo2 es -> Vector Word32
$sel:dependencies:RenderPassCreateInfo2 :: forall (es :: [*]).
RenderPassCreateInfo2 es -> Vector (SomeStruct SubpassDependency2)
$sel:subpasses:RenderPassCreateInfo2 :: forall (es :: [*]).
RenderPassCreateInfo2 es -> Vector (SomeStruct SubpassDescription2)
$sel:attachments:RenderPassCreateInfo2 :: forall (es :: [*]).
RenderPassCreateInfo2 es
-> Vector (SomeStruct AttachmentDescription2)
$sel:flags:RenderPassCreateInfo2 :: forall (es :: [*]).
RenderPassCreateInfo2 es -> RenderPassCreateFlags
$sel:next:RenderPassCreateInfo2 :: forall (es :: [*]). RenderPassCreateInfo2 es -> Chain es
..} Chain es
next' = RenderPassCreateInfo2{$sel:next:RenderPassCreateInfo2 :: Chain es
next = Chain es
next', Vector Word32
Vector (SomeStruct SubpassDescription2)
Vector (SomeStruct SubpassDependency2)
Vector (SomeStruct AttachmentDescription2)
RenderPassCreateFlags
correlatedViewMasks :: Vector Word32
dependencies :: Vector (SomeStruct SubpassDependency2)
subpasses :: Vector (SomeStruct SubpassDescription2)
attachments :: Vector (SomeStruct AttachmentDescription2)
flags :: RenderPassCreateFlags
$sel:correlatedViewMasks:RenderPassCreateInfo2 :: Vector Word32
$sel:dependencies:RenderPassCreateInfo2 :: Vector (SomeStruct SubpassDependency2)
$sel:subpasses:RenderPassCreateInfo2 :: Vector (SomeStruct SubpassDescription2)
$sel:attachments:RenderPassCreateInfo2 :: Vector (SomeStruct AttachmentDescription2)
$sel:flags:RenderPassCreateInfo2 :: RenderPassCreateFlags
..}
getNext :: forall (es :: [*]). RenderPassCreateInfo2 es -> Chain es
getNext RenderPassCreateInfo2{Vector Word32
Vector (SomeStruct SubpassDescription2)
Vector (SomeStruct SubpassDependency2)
Vector (SomeStruct AttachmentDescription2)
Chain es
RenderPassCreateFlags
correlatedViewMasks :: Vector Word32
dependencies :: Vector (SomeStruct SubpassDependency2)
subpasses :: Vector (SomeStruct SubpassDescription2)
attachments :: Vector (SomeStruct AttachmentDescription2)
flags :: RenderPassCreateFlags
next :: Chain es
$sel:correlatedViewMasks:RenderPassCreateInfo2 :: forall (es :: [*]). RenderPassCreateInfo2 es -> Vector Word32
$sel:dependencies:RenderPassCreateInfo2 :: forall (es :: [*]).
RenderPassCreateInfo2 es -> Vector (SomeStruct SubpassDependency2)
$sel:subpasses:RenderPassCreateInfo2 :: forall (es :: [*]).
RenderPassCreateInfo2 es -> Vector (SomeStruct SubpassDescription2)
$sel:attachments:RenderPassCreateInfo2 :: forall (es :: [*]).
RenderPassCreateInfo2 es
-> Vector (SomeStruct AttachmentDescription2)
$sel:flags:RenderPassCreateInfo2 :: forall (es :: [*]).
RenderPassCreateInfo2 es -> RenderPassCreateFlags
$sel:next:RenderPassCreateInfo2 :: forall (es :: [*]). RenderPassCreateInfo2 es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends RenderPassCreateInfo2 e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends RenderPassCreateInfo2 e => b) -> Maybe b
extends proxy e
_ Extends RenderPassCreateInfo2 e => b
f
| Just e :~: RenderPassCreationFeedbackCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @RenderPassCreationFeedbackCreateInfoEXT = forall a. a -> Maybe a
Just Extends RenderPassCreateInfo2 e => b
f
| Just e :~: RenderPassCreationControlEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @RenderPassCreationControlEXT = forall a. a -> Maybe a
Just Extends RenderPassCreateInfo2 e => b
f
| Just e :~: RenderPassFragmentDensityMapCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @RenderPassFragmentDensityMapCreateInfoEXT = forall a. a -> Maybe a
Just Extends RenderPassCreateInfo2 e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss RenderPassCreateInfo2 es
, PokeChain es ) => ToCStruct (RenderPassCreateInfo2 es) where
withCStruct :: forall b.
RenderPassCreateInfo2 es
-> (Ptr (RenderPassCreateInfo2 es) -> IO b) -> IO b
withCStruct RenderPassCreateInfo2 es
x Ptr (RenderPassCreateInfo2 es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
80 forall a b. (a -> b) -> a -> b
$ \Ptr (RenderPassCreateInfo2 es)
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (RenderPassCreateInfo2 es)
p RenderPassCreateInfo2 es
x (Ptr (RenderPassCreateInfo2 es) -> IO b
f Ptr (RenderPassCreateInfo2 es)
p)
pokeCStruct :: forall b.
Ptr (RenderPassCreateInfo2 es)
-> RenderPassCreateInfo2 es -> IO b -> IO b
pokeCStruct Ptr (RenderPassCreateInfo2 es)
p RenderPassCreateInfo2{Vector Word32
Vector (SomeStruct SubpassDescription2)
Vector (SomeStruct SubpassDependency2)
Vector (SomeStruct AttachmentDescription2)
Chain es
RenderPassCreateFlags
correlatedViewMasks :: Vector Word32
dependencies :: Vector (SomeStruct SubpassDependency2)
subpasses :: Vector (SomeStruct SubpassDescription2)
attachments :: Vector (SomeStruct AttachmentDescription2)
flags :: RenderPassCreateFlags
next :: Chain es
$sel:correlatedViewMasks:RenderPassCreateInfo2 :: forall (es :: [*]). RenderPassCreateInfo2 es -> Vector Word32
$sel:dependencies:RenderPassCreateInfo2 :: forall (es :: [*]).
RenderPassCreateInfo2 es -> Vector (SomeStruct SubpassDependency2)
$sel:subpasses:RenderPassCreateInfo2 :: forall (es :: [*]).
RenderPassCreateInfo2 es -> Vector (SomeStruct SubpassDescription2)
$sel:attachments:RenderPassCreateInfo2 :: forall (es :: [*]).
RenderPassCreateInfo2 es
-> Vector (SomeStruct AttachmentDescription2)
$sel:flags:RenderPassCreateInfo2 :: forall (es :: [*]).
RenderPassCreateInfo2 es -> RenderPassCreateFlags
$sel:next:RenderPassCreateInfo2 :: forall (es :: [*]). RenderPassCreateInfo2 es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr RenderPassCreateFlags)) (RenderPassCreateFlags
flags)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct AttachmentDescription2)
attachments)) :: Word32))
Ptr (AttachmentDescription2 Any)
pPAttachments' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(AttachmentDescription2 _) ((forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct AttachmentDescription2)
attachments)) forall a. Num a => a -> a -> a
* Int
56)
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SomeStruct AttachmentDescription2
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (AttachmentDescription2 Any)
pPAttachments' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
56 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AttachmentDescription2 _))) (SomeStruct AttachmentDescription2
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) (Vector (SomeStruct AttachmentDescription2)
attachments)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr (AttachmentDescription2 _)))) (Ptr (AttachmentDescription2 Any)
pPAttachments')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct SubpassDescription2)
subpasses)) :: Word32))
Ptr (SubpassDescription2 Any)
pPSubpasses' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(SubpassDescription2 _) ((forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct SubpassDescription2)
subpasses)) forall a. Num a => a -> a -> a
* Int
88)
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SomeStruct SubpassDescription2
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (SubpassDescription2 Any)
pPSubpasses' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
88 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (SubpassDescription2 _))) (SomeStruct SubpassDescription2
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) (Vector (SomeStruct SubpassDescription2)
subpasses)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr (SubpassDescription2 _)))) (Ptr (SubpassDescription2 Any)
pPSubpasses')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct SubpassDependency2)
dependencies)) :: Word32))
Ptr (SubpassDependency2 Any)
pPDependencies' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(SubpassDependency2 _) ((forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct SubpassDependency2)
dependencies)) forall a. Num a => a -> a -> a
* Int
48)
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SomeStruct SubpassDependency2
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (SubpassDependency2 Any)
pPDependencies' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
48 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (SubpassDependency2 _))) (SomeStruct SubpassDependency2
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) (Vector (SomeStruct SubpassDependency2)
dependencies)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr (Ptr (SubpassDependency2 _)))) (Ptr (SubpassDependency2 Any)
pPDependencies')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector Word32
correlatedViewMasks)) :: Word32))
Ptr Word32
pPCorrelatedViewMasks' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Word32 ((forall a. Vector a -> Int
Data.Vector.length (Vector Word32
correlatedViewMasks)) forall a. Num a => a -> a -> a
* Int
4)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Word32
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word32
pPCorrelatedViewMasks' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) (Word32
e)) (Vector Word32
correlatedViewMasks)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr (Ptr Word32))) (Ptr Word32
pPCorrelatedViewMasks')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
80
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (RenderPassCreateInfo2 es) -> IO b -> IO b
pokeZeroCStruct Ptr (RenderPassCreateInfo2 es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
instance ( Extendss RenderPassCreateInfo2 es
, PeekChain es ) => FromCStruct (RenderPassCreateInfo2 es) where
peekCStruct :: Ptr (RenderPassCreateInfo2 es) -> IO (RenderPassCreateInfo2 es)
peekCStruct Ptr (RenderPassCreateInfo2 es)
p = do
Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
RenderPassCreateFlags
flags <- forall a. Storable a => Ptr a -> IO a
peek @RenderPassCreateFlags ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr RenderPassCreateFlags))
Word32
attachmentCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
Ptr (AttachmentDescription2 Any)
pAttachments <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (AttachmentDescription2 _)) ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr (AttachmentDescription2 _))))
Vector (SomeStruct AttachmentDescription2)
pAttachments' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
attachmentCount) (\Int
i -> forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (AttachmentDescription2 Any)
pAttachments forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
56 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AttachmentDescription2 _)))))
Word32
subpassCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32))
Ptr (SubpassDescription2 Any)
pSubpasses <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (SubpassDescription2 _)) ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr (SubpassDescription2 _))))
Vector (SomeStruct SubpassDescription2)
pSubpasses' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
subpassCount) (\Int
i -> forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (SubpassDescription2 Any)
pSubpasses forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
88 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (SubpassDescription2 _)))))
Word32
dependencyCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word32))
Ptr (SubpassDependency2 Any)
pDependencies <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr (SubpassDependency2 _)) ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr (Ptr (SubpassDependency2 _))))
Vector (SomeStruct SubpassDependency2)
pDependencies' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
dependencyCount) (\Int
i -> forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (SubpassDependency2 Any)
pDependencies forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
48 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (SubpassDependency2 _)))))
Word32
correlatedViewMaskCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr Word32))
Ptr Word32
pCorrelatedViewMasks <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) ((Ptr (RenderPassCreateInfo2 es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr (Ptr Word32)))
Vector Word32
pCorrelatedViewMasks' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
correlatedViewMaskCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr Word32
pCorrelatedViewMasks forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]).
Chain es
-> RenderPassCreateFlags
-> Vector (SomeStruct AttachmentDescription2)
-> Vector (SomeStruct SubpassDescription2)
-> Vector (SomeStruct SubpassDependency2)
-> Vector Word32
-> RenderPassCreateInfo2 es
RenderPassCreateInfo2
Chain es
next
RenderPassCreateFlags
flags
Vector (SomeStruct AttachmentDescription2)
pAttachments'
Vector (SomeStruct SubpassDescription2)
pSubpasses'
Vector (SomeStruct SubpassDependency2)
pDependencies'
Vector Word32
pCorrelatedViewMasks'
instance es ~ '[] => Zero (RenderPassCreateInfo2 es) where
zero :: RenderPassCreateInfo2 es
zero = forall (es :: [*]).
Chain es
-> RenderPassCreateFlags
-> Vector (SomeStruct AttachmentDescription2)
-> Vector (SomeStruct SubpassDescription2)
-> Vector (SomeStruct SubpassDependency2)
-> Vector Word32
-> RenderPassCreateInfo2 es
RenderPassCreateInfo2
()
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty
forall a. Monoid a => a
mempty
forall a. Monoid a => a
mempty
forall a. Monoid a => a
mempty
data SubpassBeginInfo = SubpassBeginInfo
{
SubpassBeginInfo -> SubpassContents
contents :: SubpassContents }
deriving (Typeable, SubpassBeginInfo -> SubpassBeginInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SubpassBeginInfo -> SubpassBeginInfo -> Bool
$c/= :: SubpassBeginInfo -> SubpassBeginInfo -> Bool
== :: SubpassBeginInfo -> SubpassBeginInfo -> Bool
$c== :: SubpassBeginInfo -> SubpassBeginInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SubpassBeginInfo)
#endif
deriving instance Show SubpassBeginInfo
instance ToCStruct SubpassBeginInfo where
withCStruct :: forall b.
SubpassBeginInfo
-> (("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo) -> IO b) -> IO b
withCStruct SubpassBeginInfo
x ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \"pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
p SubpassBeginInfo
x (("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo) -> IO b
f "pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
p)
pokeCStruct :: forall b.
("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> SubpassBeginInfo -> IO b -> IO b
pokeCStruct "pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
p SubpassBeginInfo{SubpassContents
contents :: SubpassContents
$sel:contents:SubpassBeginInfo :: SubpassBeginInfo -> SubpassContents
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_BEGIN_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SubpassContents)) (SubpassContents
contents)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo) -> IO b -> IO b
pokeZeroCStruct "pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_BEGIN_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SubpassContents)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct SubpassBeginInfo where
peekCStruct :: ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> IO SubpassBeginInfo
peekCStruct "pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
p = do
SubpassContents
contents <- forall a. Storable a => Ptr a -> IO a
peek @SubpassContents (("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SubpassContents))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ SubpassContents -> SubpassBeginInfo
SubpassBeginInfo
SubpassContents
contents
instance Storable SubpassBeginInfo where
sizeOf :: SubpassBeginInfo -> Int
sizeOf ~SubpassBeginInfo
_ = Int
24
alignment :: SubpassBeginInfo -> Int
alignment ~SubpassBeginInfo
_ = Int
8
peek :: ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> IO SubpassBeginInfo
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pSubpassBeginInfo" ::: Ptr SubpassBeginInfo)
-> SubpassBeginInfo -> IO ()
poke "pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
ptr SubpassBeginInfo
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pSubpassBeginInfo" ::: Ptr SubpassBeginInfo
ptr SubpassBeginInfo
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero SubpassBeginInfo where
zero :: SubpassBeginInfo
zero = SubpassContents -> SubpassBeginInfo
SubpassBeginInfo
forall a. Zero a => a
zero
data SubpassEndInfo (es :: [Type]) = SubpassEndInfo
{
forall (es :: [*]). SubpassEndInfo es -> Chain es
next :: Chain es }
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SubpassEndInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (SubpassEndInfo es)
instance Extensible SubpassEndInfo where
extensibleTypeName :: String
extensibleTypeName = String
"SubpassEndInfo"
setNext :: forall (ds :: [*]) (es :: [*]).
SubpassEndInfo ds -> Chain es -> SubpassEndInfo es
setNext SubpassEndInfo ds
_ Chain es
next' = SubpassEndInfo{$sel:next:SubpassEndInfo :: Chain es
next = Chain es
next'}
getNext :: forall (es :: [*]). SubpassEndInfo es -> Chain es
getNext SubpassEndInfo{Chain es
next :: Chain es
$sel:next:SubpassEndInfo :: forall (es :: [*]). SubpassEndInfo es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends SubpassEndInfo e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends SubpassEndInfo e => b) -> Maybe b
extends proxy e
_ Extends SubpassEndInfo e => b
f
| Just e :~: SubpassFragmentDensityMapOffsetEndInfoQCOM
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
eqT @e @SubpassFragmentDensityMapOffsetEndInfoQCOM = forall a. a -> Maybe a
Just Extends SubpassEndInfo e => b
f
| Bool
otherwise = forall a. Maybe a
Nothing
instance ( Extendss SubpassEndInfo es
, PokeChain es ) => ToCStruct (SubpassEndInfo es) where
withCStruct :: forall b.
SubpassEndInfo es -> (Ptr (SubpassEndInfo es) -> IO b) -> IO b
withCStruct SubpassEndInfo es
x Ptr (SubpassEndInfo es) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
16 forall a b. (a -> b) -> a -> b
$ \Ptr (SubpassEndInfo es)
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (SubpassEndInfo es)
p SubpassEndInfo es
x (Ptr (SubpassEndInfo es) -> IO b
f Ptr (SubpassEndInfo es)
p)
pokeCStruct :: forall b.
Ptr (SubpassEndInfo es) -> SubpassEndInfo es -> IO b -> IO b
pokeCStruct Ptr (SubpassEndInfo es)
p SubpassEndInfo{Chain es
next :: Chain es
$sel:next:SubpassEndInfo :: forall (es :: [*]). SubpassEndInfo es -> Chain es
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassEndInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_END_INFO)
Ptr ()
pNext'' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassEndInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
16
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (SubpassEndInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (SubpassEndInfo es)
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassEndInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_END_INFO)
Ptr ()
pNext' <- forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. Ptr a -> Ptr b
castPtr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (SubpassEndInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
instance ( Extendss SubpassEndInfo es
, PeekChain es ) => FromCStruct (SubpassEndInfo es) where
peekCStruct :: Ptr (SubpassEndInfo es) -> IO (SubpassEndInfo es)
peekCStruct Ptr (SubpassEndInfo es)
p = do
Ptr ()
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (SubpassEndInfo es)
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
Chain es
next <- forall (es :: [*]). PeekChain es => Ptr (Chain es) -> IO (Chain es)
peekChain (forall a b. Ptr a -> Ptr b
castPtr Ptr ()
pNext)
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall (es :: [*]). Chain es -> SubpassEndInfo es
SubpassEndInfo
Chain es
next
instance es ~ '[] => Zero (SubpassEndInfo es) where
zero :: SubpassEndInfo es
zero = forall (es :: [*]). Chain es -> SubpassEndInfo es
SubpassEndInfo
()