{-# language CPP #-}
module Vulkan.Core13.Promoted_From_VK_KHR_dynamic_rendering ( cmdBeginRendering
, cmdUseRendering
, cmdEndRendering
, PipelineRenderingCreateInfo(..)
, RenderingInfo(..)
, RenderingAttachmentInfo(..)
, PhysicalDeviceDynamicRenderingFeatures(..)
, CommandBufferInheritanceRenderingInfo(..)
, AttachmentStoreOp(..)
, StructureType(..)
, RenderingFlagBits(..)
, RenderingFlags
) where
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytes)
import GHC.IO (throwIO)
import GHC.Ptr (castPtr)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.Type.Equality ((:~:)(Refl))
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.Core10.Enums.AttachmentLoadOp (AttachmentLoadOp)
import Vulkan.Core10.Enums.AttachmentStoreOp (AttachmentStoreOp)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.CStruct.Extends (Chain)
import Vulkan.Core10.CommandBufferBuilding (ClearValue)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer(CommandBuffer))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Dynamic (DeviceCmds(pVkCmdBeginRendering))
import Vulkan.Dynamic (DeviceCmds(pVkCmdEndRendering))
import {-# SOURCE #-} Vulkan.Core11.Promoted_From_VK_KHR_device_group (DeviceGroupRenderPassBeginInfo)
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import Vulkan.Core10.Enums.Format (Format)
import Vulkan.Core10.Enums.ImageLayout (ImageLayout)
import Vulkan.Core10.Handles (ImageView)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_multisampled_render_to_single_sampled (MultisampledRenderToSingleSampledInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_KHR_dynamic_rendering (MultiviewPerViewAttributesInfoNVX)
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import Vulkan.Core10.FundamentalTypes (Rect2D)
import Vulkan.Core13.Enums.RenderingFlagBits (RenderingFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_KHR_dynamic_rendering (RenderingFragmentDensityMapAttachmentInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_KHR_dynamic_rendering (RenderingFragmentShadingRateAttachmentInfoKHR)
import Vulkan.Core12.Enums.ResolveModeFlagBits (ResolveModeFlagBits)
import Vulkan.Core10.Enums.SampleCountFlagBits (SampleCountFlagBits)
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RENDERING_INFO))
import Vulkan.Core10.Enums.AttachmentStoreOp (AttachmentStoreOp(..))
import Vulkan.Core13.Enums.RenderingFlagBits (RenderingFlagBits(..))
import Vulkan.Core13.Enums.RenderingFlagBits (RenderingFlags)
import Vulkan.Core10.Enums.StructureType (StructureType(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdBeginRendering
:: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct RenderingInfo) -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct RenderingInfo) -> IO ()
cmdBeginRendering :: forall a io
. (Extendss RenderingInfo a, PokeChain a, MonadIO io)
=>
CommandBuffer
->
(RenderingInfo a)
-> io ()
cmdBeginRendering :: forall (a :: [*]) (io :: * -> *).
(Extendss RenderingInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> RenderingInfo a -> io ()
cmdBeginRendering CommandBuffer
commandBuffer RenderingInfo a
renderingInfo = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdBeginRenderingPtr :: FunPtr
(Ptr CommandBuffer_T
-> ("pRenderingInfo" ::: Ptr (SomeStruct RenderingInfo)) -> IO ())
vkCmdBeginRenderingPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("pRenderingInfo" ::: Ptr (SomeStruct RenderingInfo)) -> IO ())
pVkCmdBeginRendering (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("pRenderingInfo" ::: Ptr (SomeStruct RenderingInfo)) -> IO ())
vkCmdBeginRenderingPtr FunPtr
(Ptr CommandBuffer_T
-> ("pRenderingInfo" ::: Ptr (SomeStruct RenderingInfo)) -> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> ("pRenderingInfo" ::: Ptr (SomeStruct RenderingInfo)) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> ("pRenderingInfo" ::: Ptr (SomeStruct RenderingInfo)) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdBeginRendering is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdBeginRendering' :: Ptr CommandBuffer_T
-> ("pRenderingInfo" ::: Ptr (SomeStruct RenderingInfo)) -> IO ()
vkCmdBeginRendering' = FunPtr
(Ptr CommandBuffer_T
-> ("pRenderingInfo" ::: Ptr (SomeStruct RenderingInfo)) -> IO ())
-> Ptr CommandBuffer_T
-> ("pRenderingInfo" ::: Ptr (SomeStruct RenderingInfo))
-> IO ()
mkVkCmdBeginRendering FunPtr
(Ptr CommandBuffer_T
-> ("pRenderingInfo" ::: Ptr (SomeStruct RenderingInfo)) -> IO ())
vkCmdBeginRenderingPtr
Ptr (RenderingInfo a)
pRenderingInfo <- ((Ptr (RenderingInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (RenderingInfo a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (RenderingInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (RenderingInfo a)))
-> ((Ptr (RenderingInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (RenderingInfo a))
forall a b. (a -> b) -> a -> b
$ RenderingInfo a -> (Ptr (RenderingInfo a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (RenderingInfo a
renderingInfo)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdBeginRendering" (Ptr CommandBuffer_T
-> ("pRenderingInfo" ::: Ptr (SomeStruct RenderingInfo)) -> IO ()
vkCmdBeginRendering'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
(Ptr (RenderingInfo a)
-> "pRenderingInfo" ::: Ptr (SomeStruct RenderingInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (RenderingInfo a)
pRenderingInfo))
() -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()
cmdUseRendering :: forall a io r . (Extendss RenderingInfo a, PokeChain a, MonadIO io) => CommandBuffer -> RenderingInfo a -> io r -> io r
cmdUseRendering :: forall (a :: [*]) (io :: * -> *) r.
(Extendss RenderingInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> RenderingInfo a -> io r -> io r
cmdUseRendering CommandBuffer
commandBuffer RenderingInfo a
pRenderingInfo io r
a =
(CommandBuffer -> RenderingInfo a -> io ()
forall (a :: [*]) (io :: * -> *).
(Extendss RenderingInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> RenderingInfo a -> io ()
cmdBeginRendering CommandBuffer
commandBuffer
RenderingInfo a
pRenderingInfo) io () -> io r -> io r
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
*> io r
a io r -> io () -> io r
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f a
<* (CommandBuffer -> io ()
forall (io :: * -> *). MonadIO io => CommandBuffer -> io ()
cmdEndRendering CommandBuffer
commandBuffer)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdEndRendering
:: FunPtr (Ptr CommandBuffer_T -> IO ()) -> Ptr CommandBuffer_T -> IO ()
cmdEndRendering :: forall io
. (MonadIO io)
=>
CommandBuffer
-> io ()
cmdEndRendering :: forall (io :: * -> *). MonadIO io => CommandBuffer -> io ()
cmdEndRendering CommandBuffer
commandBuffer = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ()) -> IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdEndRenderingPtr :: FunPtr (Ptr CommandBuffer_T -> IO ())
vkCmdEndRenderingPtr = DeviceCmds -> FunPtr (Ptr CommandBuffer_T -> IO ())
pVkCmdEndRendering (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr (Ptr CommandBuffer_T -> IO ())
vkCmdEndRenderingPtr FunPtr (Ptr CommandBuffer_T -> IO ())
-> FunPtr (Ptr CommandBuffer_T -> IO ()) -> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr (Ptr CommandBuffer_T -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdEndRendering is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdEndRendering' :: Ptr CommandBuffer_T -> IO ()
vkCmdEndRendering' = FunPtr (Ptr CommandBuffer_T -> IO ())
-> Ptr CommandBuffer_T -> IO ()
mkVkCmdEndRendering FunPtr (Ptr CommandBuffer_T -> IO ())
vkCmdEndRenderingPtr
String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdEndRendering" (Ptr CommandBuffer_T -> IO ()
vkCmdEndRendering'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)))
() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> IO ()) -> () -> IO ()
forall a b. (a -> b) -> a -> b
$ ()
data PipelineRenderingCreateInfo = PipelineRenderingCreateInfo
{
PipelineRenderingCreateInfo -> Word32
viewMask :: Word32
,
PipelineRenderingCreateInfo -> Vector Format
colorAttachmentFormats :: Vector Format
,
PipelineRenderingCreateInfo -> Format
depthAttachmentFormat :: Format
,
PipelineRenderingCreateInfo -> Format
stencilAttachmentFormat :: Format
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineRenderingCreateInfo)
#endif
deriving instance Show PipelineRenderingCreateInfo
instance ToCStruct PipelineRenderingCreateInfo where
withCStruct :: forall b.
PipelineRenderingCreateInfo
-> (Ptr PipelineRenderingCreateInfo -> IO b) -> IO b
withCStruct PipelineRenderingCreateInfo
x Ptr PipelineRenderingCreateInfo -> IO b
f = Int -> (Ptr PipelineRenderingCreateInfo -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr PipelineRenderingCreateInfo -> IO b) -> IO b)
-> (Ptr PipelineRenderingCreateInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PipelineRenderingCreateInfo
p -> Ptr PipelineRenderingCreateInfo
-> PipelineRenderingCreateInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineRenderingCreateInfo
p PipelineRenderingCreateInfo
x (Ptr PipelineRenderingCreateInfo -> IO b
f Ptr PipelineRenderingCreateInfo
p)
pokeCStruct :: forall b.
Ptr PipelineRenderingCreateInfo
-> PipelineRenderingCreateInfo -> IO b -> IO b
pokeCStruct Ptr PipelineRenderingCreateInfo
p PipelineRenderingCreateInfo{Word32
Vector Format
Format
stencilAttachmentFormat :: Format
depthAttachmentFormat :: Format
colorAttachmentFormats :: Vector Format
viewMask :: Word32
$sel:stencilAttachmentFormat:PipelineRenderingCreateInfo :: PipelineRenderingCreateInfo -> Format
$sel:depthAttachmentFormat:PipelineRenderingCreateInfo :: PipelineRenderingCreateInfo -> Format
$sel:colorAttachmentFormats:PipelineRenderingCreateInfo :: PipelineRenderingCreateInfo -> Vector Format
$sel:viewMask:PipelineRenderingCreateInfo :: PipelineRenderingCreateInfo -> Word32
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRenderingCreateInfo
p Ptr PipelineRenderingCreateInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRenderingCreateInfo
p Ptr PipelineRenderingCreateInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRenderingCreateInfo
p Ptr PipelineRenderingCreateInfo -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
viewMask)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRenderingCreateInfo
p Ptr PipelineRenderingCreateInfo -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector Format -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Format -> Int) -> Vector Format -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Format
colorAttachmentFormats)) :: Word32))
Ptr Format
pPColorAttachmentFormats' <- ((Ptr Format -> IO b) -> IO b) -> ContT b IO (Ptr Format)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Format -> IO b) -> IO b) -> ContT b IO (Ptr Format))
-> ((Ptr Format -> IO b) -> IO b) -> ContT b IO (Ptr Format)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Format ((Vector Format -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Format
colorAttachmentFormats)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
4)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> Format -> IO ()) -> Vector Format -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Format
e -> Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Format
pPColorAttachmentFormats' Ptr Format -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Format) (Format
e)) (Vector Format
colorAttachmentFormats)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr Format) -> Ptr Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRenderingCreateInfo
p Ptr PipelineRenderingCreateInfo -> Int -> Ptr (Ptr Format)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Format))) (Ptr Format
pPColorAttachmentFormats')
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRenderingCreateInfo
p Ptr PipelineRenderingCreateInfo -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Format)) (Format
depthAttachmentFormat)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRenderingCreateInfo
p Ptr PipelineRenderingCreateInfo -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Format)) (Format
stencilAttachmentFormat)
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr PipelineRenderingCreateInfo -> IO b -> IO b
pokeZeroCStruct Ptr PipelineRenderingCreateInfo
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRenderingCreateInfo
p Ptr PipelineRenderingCreateInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRenderingCreateInfo
p Ptr PipelineRenderingCreateInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRenderingCreateInfo
p Ptr PipelineRenderingCreateInfo -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRenderingCreateInfo
p Ptr PipelineRenderingCreateInfo -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Format)) (Format
forall a. Zero a => a
zero)
Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRenderingCreateInfo
p Ptr PipelineRenderingCreateInfo -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Format)) (Format
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct PipelineRenderingCreateInfo where
peekCStruct :: Ptr PipelineRenderingCreateInfo -> IO PipelineRenderingCreateInfo
peekCStruct Ptr PipelineRenderingCreateInfo
p = do
Word32
viewMask <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PipelineRenderingCreateInfo
p Ptr PipelineRenderingCreateInfo -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
Word32
colorAttachmentCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PipelineRenderingCreateInfo
p Ptr PipelineRenderingCreateInfo -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
Ptr Format
pColorAttachmentFormats <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Format) ((Ptr PipelineRenderingCreateInfo
p Ptr PipelineRenderingCreateInfo -> Int -> Ptr (Ptr Format)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Format)))
Vector Format
pColorAttachmentFormats' <- Int -> (Int -> IO Format) -> IO (Vector Format)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
colorAttachmentCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr Format
pColorAttachmentFormats Ptr Format -> Int -> Ptr Format
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Format)))
Format
depthAttachmentFormat <- forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr PipelineRenderingCreateInfo
p Ptr PipelineRenderingCreateInfo -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Format))
Format
stencilAttachmentFormat <- forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr PipelineRenderingCreateInfo
p Ptr PipelineRenderingCreateInfo -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Format))
PipelineRenderingCreateInfo -> IO PipelineRenderingCreateInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineRenderingCreateInfo -> IO PipelineRenderingCreateInfo)
-> PipelineRenderingCreateInfo -> IO PipelineRenderingCreateInfo
forall a b. (a -> b) -> a -> b
$ Word32
-> Vector Format -> Format -> Format -> PipelineRenderingCreateInfo
PipelineRenderingCreateInfo
Word32
viewMask
Vector Format
pColorAttachmentFormats'
Format
depthAttachmentFormat
Format
stencilAttachmentFormat
instance Zero PipelineRenderingCreateInfo where
zero :: PipelineRenderingCreateInfo
zero = Word32
-> Vector Format -> Format -> Format -> PipelineRenderingCreateInfo
PipelineRenderingCreateInfo
Word32
forall a. Zero a => a
zero
Vector Format
forall a. Monoid a => a
mempty
Format
forall a. Zero a => a
zero
Format
forall a. Zero a => a
zero
data RenderingInfo (es :: [Type]) = RenderingInfo
{
forall (es :: [*]). RenderingInfo es -> Chain es
next :: Chain es
,
forall (es :: [*]). RenderingInfo es -> RenderingFlags
flags :: RenderingFlags
,
forall (es :: [*]). RenderingInfo es -> Rect2D
renderArea :: Rect2D
,
forall (es :: [*]). RenderingInfo es -> Word32
layerCount :: Word32
,
forall (es :: [*]). RenderingInfo es -> Word32
viewMask :: Word32
,
forall (es :: [*]).
RenderingInfo es -> Vector RenderingAttachmentInfo
colorAttachments :: Vector RenderingAttachmentInfo
,
forall (es :: [*]).
RenderingInfo es -> Maybe RenderingAttachmentInfo
depthAttachment :: Maybe RenderingAttachmentInfo
,
forall (es :: [*]).
RenderingInfo es -> Maybe RenderingAttachmentInfo
stencilAttachment :: Maybe RenderingAttachmentInfo
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (RenderingInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (RenderingInfo es)
instance Extensible RenderingInfo where
extensibleTypeName :: String
extensibleTypeName = String
"RenderingInfo"
setNext :: forall (ds :: [*]) (es :: [*]).
RenderingInfo ds -> Chain es -> RenderingInfo es
setNext RenderingInfo{Maybe RenderingAttachmentInfo
Word32
Vector RenderingAttachmentInfo
Chain ds
Rect2D
RenderingFlags
stencilAttachment :: Maybe RenderingAttachmentInfo
depthAttachment :: Maybe RenderingAttachmentInfo
colorAttachments :: Vector RenderingAttachmentInfo
viewMask :: Word32
layerCount :: Word32
renderArea :: Rect2D
flags :: RenderingFlags
next :: Chain ds
$sel:stencilAttachment:RenderingInfo :: forall (es :: [*]).
RenderingInfo es -> Maybe RenderingAttachmentInfo
$sel:depthAttachment:RenderingInfo :: forall (es :: [*]).
RenderingInfo es -> Maybe RenderingAttachmentInfo
$sel:colorAttachments:RenderingInfo :: forall (es :: [*]).
RenderingInfo es -> Vector RenderingAttachmentInfo
$sel:viewMask:RenderingInfo :: forall (es :: [*]). RenderingInfo es -> Word32
$sel:layerCount:RenderingInfo :: forall (es :: [*]). RenderingInfo es -> Word32
$sel:renderArea:RenderingInfo :: forall (es :: [*]). RenderingInfo es -> Rect2D
$sel:flags:RenderingInfo :: forall (es :: [*]). RenderingInfo es -> RenderingFlags
$sel:next:RenderingInfo :: forall (es :: [*]). RenderingInfo es -> Chain es
..} Chain es
next' = RenderingInfo :: forall (es :: [*]).
Chain es
-> RenderingFlags
-> Rect2D
-> Word32
-> Word32
-> Vector RenderingAttachmentInfo
-> Maybe RenderingAttachmentInfo
-> Maybe RenderingAttachmentInfo
-> RenderingInfo es
RenderingInfo{$sel:next:RenderingInfo :: Chain es
next = Chain es
next', Maybe RenderingAttachmentInfo
Word32
Vector RenderingAttachmentInfo
Rect2D
RenderingFlags
stencilAttachment :: Maybe RenderingAttachmentInfo
depthAttachment :: Maybe RenderingAttachmentInfo
colorAttachments :: Vector RenderingAttachmentInfo
viewMask :: Word32
layerCount :: Word32
renderArea :: Rect2D
flags :: RenderingFlags
$sel:stencilAttachment:RenderingInfo :: Maybe RenderingAttachmentInfo
$sel:depthAttachment:RenderingInfo :: Maybe RenderingAttachmentInfo
$sel:colorAttachments:RenderingInfo :: Vector RenderingAttachmentInfo
$sel:viewMask:RenderingInfo :: Word32
$sel:layerCount:RenderingInfo :: Word32
$sel:renderArea:RenderingInfo :: Rect2D
$sel:flags:RenderingInfo :: RenderingFlags
..}
getNext :: forall (es :: [*]). RenderingInfo es -> Chain es
getNext RenderingInfo{Maybe RenderingAttachmentInfo
Word32
Vector RenderingAttachmentInfo
Chain es
Rect2D
RenderingFlags
stencilAttachment :: Maybe RenderingAttachmentInfo
depthAttachment :: Maybe RenderingAttachmentInfo
colorAttachments :: Vector RenderingAttachmentInfo
viewMask :: Word32
layerCount :: Word32
renderArea :: Rect2D
flags :: RenderingFlags
next :: Chain es
$sel:stencilAttachment:RenderingInfo :: forall (es :: [*]).
RenderingInfo es -> Maybe RenderingAttachmentInfo
$sel:depthAttachment:RenderingInfo :: forall (es :: [*]).
RenderingInfo es -> Maybe RenderingAttachmentInfo
$sel:colorAttachments:RenderingInfo :: forall (es :: [*]).
RenderingInfo es -> Vector RenderingAttachmentInfo
$sel:viewMask:RenderingInfo :: forall (es :: [*]). RenderingInfo es -> Word32
$sel:layerCount:RenderingInfo :: forall (es :: [*]). RenderingInfo es -> Word32
$sel:renderArea:RenderingInfo :: forall (es :: [*]). RenderingInfo es -> Rect2D
$sel:flags:RenderingInfo :: forall (es :: [*]). RenderingInfo es -> RenderingFlags
$sel:next:RenderingInfo :: forall (es :: [*]). RenderingInfo es -> Chain es
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends RenderingInfo e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends RenderingInfo e => b) -> Maybe b
extends proxy e
_ Extends RenderingInfo e => b
f
| Just e :~: MultiviewPerViewAttributesInfoNVX
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @MultiviewPerViewAttributesInfoNVX = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends RenderingInfo e => b
f
| Just e :~: RenderingFragmentDensityMapAttachmentInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @RenderingFragmentDensityMapAttachmentInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends RenderingInfo e => b
f
| Just e :~: RenderingFragmentShadingRateAttachmentInfoKHR
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @RenderingFragmentShadingRateAttachmentInfoKHR = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends RenderingInfo e => b
f
| Just e :~: MultisampledRenderToSingleSampledInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @MultisampledRenderToSingleSampledInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends RenderingInfo e => b
f
| Just e :~: DeviceGroupRenderPassBeginInfo
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @DeviceGroupRenderPassBeginInfo = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends RenderingInfo e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance ( Extendss RenderingInfo es
, PokeChain es ) => ToCStruct (RenderingInfo es) where
withCStruct :: forall b.
RenderingInfo es -> (Ptr (RenderingInfo es) -> IO b) -> IO b
withCStruct RenderingInfo es
x Ptr (RenderingInfo es) -> IO b
f = Int -> (Ptr (RenderingInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
72 ((Ptr (RenderingInfo es) -> IO b) -> IO b)
-> (Ptr (RenderingInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (RenderingInfo es)
p -> Ptr (RenderingInfo es) -> RenderingInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (RenderingInfo es)
p RenderingInfo es
x (Ptr (RenderingInfo es) -> IO b
f Ptr (RenderingInfo es)
p)
pokeCStruct :: forall b.
Ptr (RenderingInfo es) -> RenderingInfo es -> IO b -> IO b
pokeCStruct Ptr (RenderingInfo es)
p RenderingInfo{Maybe RenderingAttachmentInfo
Word32
Vector RenderingAttachmentInfo
Chain es
Rect2D
RenderingFlags
stencilAttachment :: Maybe RenderingAttachmentInfo
depthAttachment :: Maybe RenderingAttachmentInfo
colorAttachments :: Vector RenderingAttachmentInfo
viewMask :: Word32
layerCount :: Word32
renderArea :: Rect2D
flags :: RenderingFlags
next :: Chain es
$sel:stencilAttachment:RenderingInfo :: forall (es :: [*]).
RenderingInfo es -> Maybe RenderingAttachmentInfo
$sel:depthAttachment:RenderingInfo :: forall (es :: [*]).
RenderingInfo es -> Maybe RenderingAttachmentInfo
$sel:colorAttachments:RenderingInfo :: forall (es :: [*]).
RenderingInfo es -> Vector RenderingAttachmentInfo
$sel:viewMask:RenderingInfo :: forall (es :: [*]). RenderingInfo es -> Word32
$sel:layerCount:RenderingInfo :: forall (es :: [*]). RenderingInfo es -> Word32
$sel:renderArea:RenderingInfo :: forall (es :: [*]). RenderingInfo es -> Rect2D
$sel:flags:RenderingInfo :: forall (es :: [*]). RenderingInfo es -> RenderingFlags
$sel:next:RenderingInfo :: forall (es :: [*]). RenderingInfo es -> Chain es
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderingInfo es)
p Ptr (RenderingInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDERING_INFO)
Ptr ()
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderingInfo es)
p Ptr (RenderingInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext''
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr RenderingFlags -> RenderingFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderingInfo es)
p Ptr (RenderingInfo es) -> Int -> Ptr RenderingFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr RenderingFlags)) (RenderingFlags
flags)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Rect2D -> Rect2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderingInfo es)
p Ptr (RenderingInfo es) -> Int -> Ptr Rect2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Rect2D)) (Rect2D
renderArea)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderingInfo es)
p Ptr (RenderingInfo es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Word32)) (Word32
layerCount)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderingInfo es)
p Ptr (RenderingInfo es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Word32)) (Word32
viewMask)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderingInfo es)
p Ptr (RenderingInfo es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector RenderingAttachmentInfo -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector RenderingAttachmentInfo -> Int)
-> Vector RenderingAttachmentInfo -> Int
forall a b. (a -> b) -> a -> b
$ (Vector RenderingAttachmentInfo
colorAttachments)) :: Word32))
Ptr RenderingAttachmentInfo
pPColorAttachments' <- ((Ptr RenderingAttachmentInfo -> IO b) -> IO b)
-> ContT b IO (Ptr RenderingAttachmentInfo)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr RenderingAttachmentInfo -> IO b) -> IO b)
-> ContT b IO (Ptr RenderingAttachmentInfo))
-> ((Ptr RenderingAttachmentInfo -> IO b) -> IO b)
-> ContT b IO (Ptr RenderingAttachmentInfo)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @RenderingAttachmentInfo ((Vector RenderingAttachmentInfo -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector RenderingAttachmentInfo
colorAttachments)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
72)
(Int -> RenderingAttachmentInfo -> ContT b IO ())
-> Vector RenderingAttachmentInfo -> ContT b IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i RenderingAttachmentInfo
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr RenderingAttachmentInfo
-> RenderingAttachmentInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr RenderingAttachmentInfo
pPColorAttachments' Ptr RenderingAttachmentInfo -> Int -> Ptr RenderingAttachmentInfo
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
72 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr RenderingAttachmentInfo) (RenderingAttachmentInfo
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) (Vector RenderingAttachmentInfo
colorAttachments)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr RenderingAttachmentInfo)
-> Ptr RenderingAttachmentInfo -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderingInfo es)
p Ptr (RenderingInfo es) -> Int -> Ptr (Ptr RenderingAttachmentInfo)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr RenderingAttachmentInfo))) (Ptr RenderingAttachmentInfo
pPColorAttachments')
Ptr RenderingAttachmentInfo
pDepthAttachment'' <- case (Maybe RenderingAttachmentInfo
depthAttachment) of
Maybe RenderingAttachmentInfo
Nothing -> Ptr RenderingAttachmentInfo
-> ContT b IO (Ptr RenderingAttachmentInfo)
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr RenderingAttachmentInfo
forall a. Ptr a
nullPtr
Just RenderingAttachmentInfo
j -> ((Ptr RenderingAttachmentInfo -> IO b) -> IO b)
-> ContT b IO (Ptr RenderingAttachmentInfo)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr RenderingAttachmentInfo -> IO b) -> IO b)
-> ContT b IO (Ptr RenderingAttachmentInfo))
-> ((Ptr RenderingAttachmentInfo -> IO b) -> IO b)
-> ContT b IO (Ptr RenderingAttachmentInfo)
forall a b. (a -> b) -> a -> b
$ RenderingAttachmentInfo
-> (Ptr RenderingAttachmentInfo -> IO b) -> IO b
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (RenderingAttachmentInfo
j)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr RenderingAttachmentInfo)
-> Ptr RenderingAttachmentInfo -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderingInfo es)
p Ptr (RenderingInfo es) -> Int -> Ptr (Ptr RenderingAttachmentInfo)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr (Ptr RenderingAttachmentInfo))) Ptr RenderingAttachmentInfo
pDepthAttachment''
Ptr RenderingAttachmentInfo
pStencilAttachment'' <- case (Maybe RenderingAttachmentInfo
stencilAttachment) of
Maybe RenderingAttachmentInfo
Nothing -> Ptr RenderingAttachmentInfo
-> ContT b IO (Ptr RenderingAttachmentInfo)
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr RenderingAttachmentInfo
forall a. Ptr a
nullPtr
Just RenderingAttachmentInfo
j -> ((Ptr RenderingAttachmentInfo -> IO b) -> IO b)
-> ContT b IO (Ptr RenderingAttachmentInfo)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr RenderingAttachmentInfo -> IO b) -> IO b)
-> ContT b IO (Ptr RenderingAttachmentInfo))
-> ((Ptr RenderingAttachmentInfo -> IO b) -> IO b)
-> ContT b IO (Ptr RenderingAttachmentInfo)
forall a b. (a -> b) -> a -> b
$ RenderingAttachmentInfo
-> (Ptr RenderingAttachmentInfo -> IO b) -> IO b
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (RenderingAttachmentInfo
j)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr RenderingAttachmentInfo)
-> Ptr RenderingAttachmentInfo -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderingInfo es)
p Ptr (RenderingInfo es) -> Int -> Ptr (Ptr RenderingAttachmentInfo)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr (Ptr RenderingAttachmentInfo))) Ptr RenderingAttachmentInfo
pStencilAttachment''
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
72
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (RenderingInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (RenderingInfo es)
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderingInfo es)
p Ptr (RenderingInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDERING_INFO)
Ptr ()
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderingInfo es)
p Ptr (RenderingInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) Ptr ()
pNext'
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Rect2D -> Rect2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderingInfo es)
p Ptr (RenderingInfo es) -> Int -> Ptr Rect2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Rect2D)) (Rect2D
forall a. Zero a => a
zero)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderingInfo es)
p Ptr (RenderingInfo es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (RenderingInfo es)
p Ptr (RenderingInfo es) -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
instance es ~ '[] => Zero (RenderingInfo es) where
zero :: RenderingInfo es
zero = Chain es
-> RenderingFlags
-> Rect2D
-> Word32
-> Word32
-> Vector RenderingAttachmentInfo
-> Maybe RenderingAttachmentInfo
-> Maybe RenderingAttachmentInfo
-> RenderingInfo es
forall (es :: [*]).
Chain es
-> RenderingFlags
-> Rect2D
-> Word32
-> Word32
-> Vector RenderingAttachmentInfo
-> Maybe RenderingAttachmentInfo
-> Maybe RenderingAttachmentInfo
-> RenderingInfo es
RenderingInfo
()
RenderingFlags
forall a. Zero a => a
zero
Rect2D
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Vector RenderingAttachmentInfo
forall a. Monoid a => a
mempty
Maybe RenderingAttachmentInfo
forall a. Maybe a
Nothing
Maybe RenderingAttachmentInfo
forall a. Maybe a
Nothing
data RenderingAttachmentInfo = RenderingAttachmentInfo
{
RenderingAttachmentInfo -> ImageView
imageView :: ImageView
,
RenderingAttachmentInfo -> ImageLayout
imageLayout :: ImageLayout
,
RenderingAttachmentInfo -> ResolveModeFlagBits
resolveMode :: ResolveModeFlagBits
,
RenderingAttachmentInfo -> ImageView
resolveImageView :: ImageView
,
RenderingAttachmentInfo -> ImageLayout
resolveImageLayout :: ImageLayout
,
RenderingAttachmentInfo -> AttachmentLoadOp
loadOp :: AttachmentLoadOp
,
RenderingAttachmentInfo -> AttachmentStoreOp
storeOp :: AttachmentStoreOp
,
RenderingAttachmentInfo -> ClearValue
clearValue :: ClearValue
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (RenderingAttachmentInfo)
#endif
deriving instance Show RenderingAttachmentInfo
instance ToCStruct RenderingAttachmentInfo where
withCStruct :: forall b.
RenderingAttachmentInfo
-> (Ptr RenderingAttachmentInfo -> IO b) -> IO b
withCStruct RenderingAttachmentInfo
x Ptr RenderingAttachmentInfo -> IO b
f = Int -> (Ptr RenderingAttachmentInfo -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
72 ((Ptr RenderingAttachmentInfo -> IO b) -> IO b)
-> (Ptr RenderingAttachmentInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr RenderingAttachmentInfo
p -> Ptr RenderingAttachmentInfo
-> RenderingAttachmentInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr RenderingAttachmentInfo
p RenderingAttachmentInfo
x (Ptr RenderingAttachmentInfo -> IO b
f Ptr RenderingAttachmentInfo
p)
pokeCStruct :: forall b.
Ptr RenderingAttachmentInfo
-> RenderingAttachmentInfo -> IO b -> IO b
pokeCStruct Ptr RenderingAttachmentInfo
p RenderingAttachmentInfo{ImageLayout
ImageView
ResolveModeFlagBits
AttachmentStoreOp
AttachmentLoadOp
ClearValue
clearValue :: ClearValue
storeOp :: AttachmentStoreOp
loadOp :: AttachmentLoadOp
resolveImageLayout :: ImageLayout
resolveImageView :: ImageView
resolveMode :: ResolveModeFlagBits
imageLayout :: ImageLayout
imageView :: ImageView
$sel:clearValue:RenderingAttachmentInfo :: RenderingAttachmentInfo -> ClearValue
$sel:storeOp:RenderingAttachmentInfo :: RenderingAttachmentInfo -> AttachmentStoreOp
$sel:loadOp:RenderingAttachmentInfo :: RenderingAttachmentInfo -> AttachmentLoadOp
$sel:resolveImageLayout:RenderingAttachmentInfo :: RenderingAttachmentInfo -> ImageLayout
$sel:resolveImageView:RenderingAttachmentInfo :: RenderingAttachmentInfo -> ImageView
$sel:resolveMode:RenderingAttachmentInfo :: RenderingAttachmentInfo -> ResolveModeFlagBits
$sel:imageLayout:RenderingAttachmentInfo :: RenderingAttachmentInfo -> ImageLayout
$sel:imageView:RenderingAttachmentInfo :: RenderingAttachmentInfo -> ImageView
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentInfo
p Ptr RenderingAttachmentInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentInfo
p Ptr RenderingAttachmentInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ImageView -> ImageView -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentInfo
p Ptr RenderingAttachmentInfo -> Int -> Ptr ImageView
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageView)) (ImageView
imageView)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentInfo
p Ptr RenderingAttachmentInfo -> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageLayout)) (ImageLayout
imageLayout)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ResolveModeFlagBits -> ResolveModeFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentInfo
p Ptr RenderingAttachmentInfo -> Int -> Ptr ResolveModeFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr ResolveModeFlagBits)) (ResolveModeFlagBits
resolveMode)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ImageView -> ImageView -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentInfo
p Ptr RenderingAttachmentInfo -> Int -> Ptr ImageView
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr ImageView)) (ImageView
resolveImageView)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentInfo
p Ptr RenderingAttachmentInfo -> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ImageLayout)) (ImageLayout
resolveImageLayout)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr AttachmentLoadOp -> AttachmentLoadOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentInfo
p Ptr RenderingAttachmentInfo -> Int -> Ptr AttachmentLoadOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr AttachmentLoadOp)) (AttachmentLoadOp
loadOp)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr AttachmentStoreOp -> AttachmentStoreOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentInfo
p Ptr RenderingAttachmentInfo -> Int -> Ptr AttachmentStoreOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr AttachmentStoreOp)) (AttachmentStoreOp
storeOp)
((() -> IO b) -> IO b) -> ContT b IO ()
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ClearValue -> ClearValue -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr RenderingAttachmentInfo
p Ptr RenderingAttachmentInfo -> Int -> Ptr ClearValue
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
52 :: Ptr ClearValue)) (ClearValue
clearValue) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
72
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr RenderingAttachmentInfo -> IO b -> IO b
pokeZeroCStruct Ptr RenderingAttachmentInfo
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentInfo
p Ptr RenderingAttachmentInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentInfo
p Ptr RenderingAttachmentInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentInfo
p Ptr RenderingAttachmentInfo -> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ImageLayout)) (ImageLayout
forall a. Zero a => a
zero)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentInfo
p Ptr RenderingAttachmentInfo -> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr ImageLayout)) (ImageLayout
forall a. Zero a => a
zero)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr AttachmentLoadOp -> AttachmentLoadOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentInfo
p Ptr RenderingAttachmentInfo -> Int -> Ptr AttachmentLoadOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr AttachmentLoadOp)) (AttachmentLoadOp
forall a. Zero a => a
zero)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr AttachmentStoreOp -> AttachmentStoreOp -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentInfo
p Ptr RenderingAttachmentInfo -> Int -> Ptr AttachmentStoreOp
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr AttachmentStoreOp)) (AttachmentStoreOp
forall a. Zero a => a
zero)
((() -> IO b) -> IO b) -> ContT b IO ()
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr ClearValue -> ClearValue -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr RenderingAttachmentInfo
p Ptr RenderingAttachmentInfo -> Int -> Ptr ClearValue
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
52 :: Ptr ClearValue)) (ClearValue
forall a. Zero a => a
zero) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
instance Zero RenderingAttachmentInfo where
zero :: RenderingAttachmentInfo
zero = ImageView
-> ImageLayout
-> ResolveModeFlagBits
-> ImageView
-> ImageLayout
-> AttachmentLoadOp
-> AttachmentStoreOp
-> ClearValue
-> RenderingAttachmentInfo
RenderingAttachmentInfo
ImageView
forall a. Zero a => a
zero
ImageLayout
forall a. Zero a => a
zero
ResolveModeFlagBits
forall a. Zero a => a
zero
ImageView
forall a. Zero a => a
zero
ImageLayout
forall a. Zero a => a
zero
AttachmentLoadOp
forall a. Zero a => a
zero
AttachmentStoreOp
forall a. Zero a => a
zero
ClearValue
forall a. Zero a => a
zero
data PhysicalDeviceDynamicRenderingFeatures = PhysicalDeviceDynamicRenderingFeatures
{
PhysicalDeviceDynamicRenderingFeatures -> Bool
dynamicRendering :: Bool }
deriving (Typeable, PhysicalDeviceDynamicRenderingFeatures
-> PhysicalDeviceDynamicRenderingFeatures -> Bool
(PhysicalDeviceDynamicRenderingFeatures
-> PhysicalDeviceDynamicRenderingFeatures -> Bool)
-> (PhysicalDeviceDynamicRenderingFeatures
-> PhysicalDeviceDynamicRenderingFeatures -> Bool)
-> Eq PhysicalDeviceDynamicRenderingFeatures
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceDynamicRenderingFeatures
-> PhysicalDeviceDynamicRenderingFeatures -> Bool
$c/= :: PhysicalDeviceDynamicRenderingFeatures
-> PhysicalDeviceDynamicRenderingFeatures -> Bool
== :: PhysicalDeviceDynamicRenderingFeatures
-> PhysicalDeviceDynamicRenderingFeatures -> Bool
$c== :: PhysicalDeviceDynamicRenderingFeatures
-> PhysicalDeviceDynamicRenderingFeatures -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceDynamicRenderingFeatures)
#endif
deriving instance Show PhysicalDeviceDynamicRenderingFeatures
instance ToCStruct PhysicalDeviceDynamicRenderingFeatures where
withCStruct :: forall b.
PhysicalDeviceDynamicRenderingFeatures
-> (Ptr PhysicalDeviceDynamicRenderingFeatures -> IO b) -> IO b
withCStruct PhysicalDeviceDynamicRenderingFeatures
x Ptr PhysicalDeviceDynamicRenderingFeatures -> IO b
f = Int -> (Ptr PhysicalDeviceDynamicRenderingFeatures -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceDynamicRenderingFeatures -> IO b) -> IO b)
-> (Ptr PhysicalDeviceDynamicRenderingFeatures -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceDynamicRenderingFeatures
p -> Ptr PhysicalDeviceDynamicRenderingFeatures
-> PhysicalDeviceDynamicRenderingFeatures -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDynamicRenderingFeatures
p PhysicalDeviceDynamicRenderingFeatures
x (Ptr PhysicalDeviceDynamicRenderingFeatures -> IO b
f Ptr PhysicalDeviceDynamicRenderingFeatures
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceDynamicRenderingFeatures
-> PhysicalDeviceDynamicRenderingFeatures -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDynamicRenderingFeatures
p PhysicalDeviceDynamicRenderingFeatures{Bool
dynamicRendering :: Bool
$sel:dynamicRendering:PhysicalDeviceDynamicRenderingFeatures :: PhysicalDeviceDynamicRenderingFeatures -> Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDynamicRenderingFeatures
p Ptr PhysicalDeviceDynamicRenderingFeatures
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDynamicRenderingFeatures
p Ptr PhysicalDeviceDynamicRenderingFeatures -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDynamicRenderingFeatures
p Ptr PhysicalDeviceDynamicRenderingFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
dynamicRendering))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceDynamicRenderingFeatures -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceDynamicRenderingFeatures
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDynamicRenderingFeatures
p Ptr PhysicalDeviceDynamicRenderingFeatures
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDynamicRenderingFeatures
p Ptr PhysicalDeviceDynamicRenderingFeatures -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDynamicRenderingFeatures
p Ptr PhysicalDeviceDynamicRenderingFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceDynamicRenderingFeatures where
peekCStruct :: Ptr PhysicalDeviceDynamicRenderingFeatures
-> IO PhysicalDeviceDynamicRenderingFeatures
peekCStruct Ptr PhysicalDeviceDynamicRenderingFeatures
p = do
Bool32
dynamicRendering <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceDynamicRenderingFeatures
p Ptr PhysicalDeviceDynamicRenderingFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
PhysicalDeviceDynamicRenderingFeatures
-> IO PhysicalDeviceDynamicRenderingFeatures
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceDynamicRenderingFeatures
-> IO PhysicalDeviceDynamicRenderingFeatures)
-> PhysicalDeviceDynamicRenderingFeatures
-> IO PhysicalDeviceDynamicRenderingFeatures
forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDeviceDynamicRenderingFeatures
PhysicalDeviceDynamicRenderingFeatures
(Bool32 -> Bool
bool32ToBool Bool32
dynamicRendering)
instance Storable PhysicalDeviceDynamicRenderingFeatures where
sizeOf :: PhysicalDeviceDynamicRenderingFeatures -> Int
sizeOf ~PhysicalDeviceDynamicRenderingFeatures
_ = Int
24
alignment :: PhysicalDeviceDynamicRenderingFeatures -> Int
alignment ~PhysicalDeviceDynamicRenderingFeatures
_ = Int
8
peek :: Ptr PhysicalDeviceDynamicRenderingFeatures
-> IO PhysicalDeviceDynamicRenderingFeatures
peek = Ptr PhysicalDeviceDynamicRenderingFeatures
-> IO PhysicalDeviceDynamicRenderingFeatures
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceDynamicRenderingFeatures
-> PhysicalDeviceDynamicRenderingFeatures -> IO ()
poke Ptr PhysicalDeviceDynamicRenderingFeatures
ptr PhysicalDeviceDynamicRenderingFeatures
poked = Ptr PhysicalDeviceDynamicRenderingFeatures
-> PhysicalDeviceDynamicRenderingFeatures -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDynamicRenderingFeatures
ptr PhysicalDeviceDynamicRenderingFeatures
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceDynamicRenderingFeatures where
zero :: PhysicalDeviceDynamicRenderingFeatures
zero = Bool -> PhysicalDeviceDynamicRenderingFeatures
PhysicalDeviceDynamicRenderingFeatures
Bool
forall a. Zero a => a
zero
data CommandBufferInheritanceRenderingInfo = CommandBufferInheritanceRenderingInfo
{
CommandBufferInheritanceRenderingInfo -> RenderingFlags
flags :: RenderingFlags
,
CommandBufferInheritanceRenderingInfo -> Word32
viewMask :: Word32
,
CommandBufferInheritanceRenderingInfo -> Vector Format
colorAttachmentFormats :: Vector Format
,
CommandBufferInheritanceRenderingInfo -> Format
depthAttachmentFormat :: Format
,
CommandBufferInheritanceRenderingInfo -> Format
stencilAttachmentFormat :: Format
,
CommandBufferInheritanceRenderingInfo -> SampleCountFlagBits
rasterizationSamples :: SampleCountFlagBits
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CommandBufferInheritanceRenderingInfo)
#endif
deriving instance Show CommandBufferInheritanceRenderingInfo
instance ToCStruct CommandBufferInheritanceRenderingInfo where
withCStruct :: forall b.
CommandBufferInheritanceRenderingInfo
-> (Ptr CommandBufferInheritanceRenderingInfo -> IO b) -> IO b
withCStruct CommandBufferInheritanceRenderingInfo
x Ptr CommandBufferInheritanceRenderingInfo -> IO b
f = Int -> (Ptr CommandBufferInheritanceRenderingInfo -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 ((Ptr CommandBufferInheritanceRenderingInfo -> IO b) -> IO b)
-> (Ptr CommandBufferInheritanceRenderingInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr CommandBufferInheritanceRenderingInfo
p -> Ptr CommandBufferInheritanceRenderingInfo
-> CommandBufferInheritanceRenderingInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr CommandBufferInheritanceRenderingInfo
p CommandBufferInheritanceRenderingInfo
x (Ptr CommandBufferInheritanceRenderingInfo -> IO b
f Ptr CommandBufferInheritanceRenderingInfo
p)
pokeCStruct :: forall b.
Ptr CommandBufferInheritanceRenderingInfo
-> CommandBufferInheritanceRenderingInfo -> IO b -> IO b
pokeCStruct Ptr CommandBufferInheritanceRenderingInfo
p CommandBufferInheritanceRenderingInfo{Word32
Vector Format
Format
SampleCountFlagBits
RenderingFlags
rasterizationSamples :: SampleCountFlagBits
stencilAttachmentFormat :: Format
depthAttachmentFormat :: Format
colorAttachmentFormats :: Vector Format
viewMask :: Word32
flags :: RenderingFlags
$sel:rasterizationSamples:CommandBufferInheritanceRenderingInfo :: CommandBufferInheritanceRenderingInfo -> SampleCountFlagBits
$sel:stencilAttachmentFormat:CommandBufferInheritanceRenderingInfo :: CommandBufferInheritanceRenderingInfo -> Format
$sel:depthAttachmentFormat:CommandBufferInheritanceRenderingInfo :: CommandBufferInheritanceRenderingInfo -> Format
$sel:colorAttachmentFormats:CommandBufferInheritanceRenderingInfo :: CommandBufferInheritanceRenderingInfo -> Vector Format
$sel:viewMask:CommandBufferInheritanceRenderingInfo :: CommandBufferInheritanceRenderingInfo -> Word32
$sel:flags:CommandBufferInheritanceRenderingInfo :: CommandBufferInheritanceRenderingInfo -> RenderingFlags
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr RenderingFlags -> RenderingFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo
-> Int -> Ptr RenderingFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr RenderingFlags)) (RenderingFlags
flags)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (Word32
viewMask)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector Format -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Format -> Int) -> Vector Format -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Format
colorAttachmentFormats)) :: Word32))
Ptr Format
pPColorAttachmentFormats' <- ((Ptr Format -> IO b) -> IO b) -> ContT b IO (Ptr Format)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Format -> IO b) -> IO b) -> ContT b IO (Ptr Format))
-> ((Ptr Format -> IO b) -> IO b) -> ContT b IO (Ptr Format)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Format ((Vector Format -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Format
colorAttachmentFormats)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
4)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> Format -> IO ()) -> Vector Format -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Format
e -> Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Format
pPColorAttachmentFormats' Ptr Format -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Format) (Format
e)) (Vector Format
colorAttachmentFormats)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr Format) -> Ptr Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo
-> Int -> Ptr (Ptr Format)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr Format))) (Ptr Format
pPColorAttachmentFormats')
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Format)) (Format
depthAttachmentFormat)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Format)) (Format
stencilAttachmentFormat)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr SampleCountFlagBits -> SampleCountFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo
-> Int -> Ptr SampleCountFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr SampleCountFlagBits)) (SampleCountFlagBits
rasterizationSamples)
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
56
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr CommandBufferInheritanceRenderingInfo -> IO b -> IO b
pokeZeroCStruct Ptr CommandBufferInheritanceRenderingInfo
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Format)) (Format
forall a. Zero a => a
zero)
Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Format)) (Format
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct CommandBufferInheritanceRenderingInfo where
peekCStruct :: Ptr CommandBufferInheritanceRenderingInfo
-> IO CommandBufferInheritanceRenderingInfo
peekCStruct Ptr CommandBufferInheritanceRenderingInfo
p = do
RenderingFlags
flags <- forall a. Storable a => Ptr a -> IO a
peek @RenderingFlags ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo
-> Int -> Ptr RenderingFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr RenderingFlags))
Word32
viewMask <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
Word32
colorAttachmentCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
Ptr Format
pColorAttachmentFormats <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Format) ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo
-> Int -> Ptr (Ptr Format)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr Format)))
Vector Format
pColorAttachmentFormats' <- Int -> (Int -> IO Format) -> IO (Vector Format)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
colorAttachmentCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr Format
pColorAttachmentFormats Ptr Format -> Int -> Ptr Format
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Format)))
Format
depthAttachmentFormat <- forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Format))
Format
stencilAttachmentFormat <- forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Format))
SampleCountFlagBits
rasterizationSamples <- forall a. Storable a => Ptr a -> IO a
peek @SampleCountFlagBits ((Ptr CommandBufferInheritanceRenderingInfo
p Ptr CommandBufferInheritanceRenderingInfo
-> Int -> Ptr SampleCountFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr SampleCountFlagBits))
CommandBufferInheritanceRenderingInfo
-> IO CommandBufferInheritanceRenderingInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CommandBufferInheritanceRenderingInfo
-> IO CommandBufferInheritanceRenderingInfo)
-> CommandBufferInheritanceRenderingInfo
-> IO CommandBufferInheritanceRenderingInfo
forall a b. (a -> b) -> a -> b
$ RenderingFlags
-> Word32
-> Vector Format
-> Format
-> Format
-> SampleCountFlagBits
-> CommandBufferInheritanceRenderingInfo
CommandBufferInheritanceRenderingInfo
RenderingFlags
flags
Word32
viewMask
Vector Format
pColorAttachmentFormats'
Format
depthAttachmentFormat
Format
stencilAttachmentFormat
SampleCountFlagBits
rasterizationSamples
instance Zero CommandBufferInheritanceRenderingInfo where
zero :: CommandBufferInheritanceRenderingInfo
zero = RenderingFlags
-> Word32
-> Vector Format
-> Format
-> Format
-> SampleCountFlagBits
-> CommandBufferInheritanceRenderingInfo
CommandBufferInheritanceRenderingInfo
RenderingFlags
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Vector Format
forall a. Monoid a => a
mempty
Format
forall a. Zero a => a
zero
Format
forall a. Zero a => a
zero
SampleCountFlagBits
forall a. Zero a => a
zero