{-# language CPP #-}
module Vulkan.Extensions.VK_KHR_dynamic_rendering_local_read ( cmdSetRenderingAttachmentLocationsKHR
, cmdSetRenderingInputAttachmentIndicesKHR
, PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR(..)
, RenderingAttachmentLocationInfoKHR(..)
, RenderingInputAttachmentIndexInfoKHR(..)
, KHR_DYNAMIC_RENDERING_LOCAL_READ_SPEC_VERSION
, pattern KHR_DYNAMIC_RENDERING_LOCAL_READ_SPEC_VERSION
, KHR_DYNAMIC_RENDERING_LOCAL_READ_EXTENSION_NAME
, pattern KHR_DYNAMIC_RENDERING_LOCAL_READ_EXTENSION_NAME
) where
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Marshal.Utils (maybePeek)
import Foreign.Marshal.Utils (with)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import 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.String (IsString)
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.Core10.FundamentalTypes (Bool32)
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(pVkCmdSetRenderingAttachmentLocationsKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdSetRenderingInputAttachmentIndicesKHR))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO_KHR))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdSetRenderingAttachmentLocationsKHR
:: FunPtr (Ptr CommandBuffer_T -> Ptr RenderingAttachmentLocationInfoKHR -> IO ()) -> Ptr CommandBuffer_T -> Ptr RenderingAttachmentLocationInfoKHR -> IO ()
cmdSetRenderingAttachmentLocationsKHR :: forall io
. (MonadIO io)
=>
CommandBuffer
->
RenderingAttachmentLocationInfoKHR
-> io ()
cmdSetRenderingAttachmentLocationsKHR :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer -> RenderingAttachmentLocationInfoKHR -> io ()
cmdSetRenderingAttachmentLocationsKHR CommandBuffer
commandBuffer
RenderingAttachmentLocationInfoKHR
locationInfo = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdSetRenderingAttachmentLocationsKHRPtr :: FunPtr
(Ptr CommandBuffer_T
-> Ptr RenderingAttachmentLocationInfoKHR -> IO ())
vkCmdSetRenderingAttachmentLocationsKHRPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> Ptr RenderingAttachmentLocationInfoKHR -> IO ())
pVkCmdSetRenderingAttachmentLocationsKHR (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> Ptr RenderingAttachmentLocationInfoKHR -> IO ())
vkCmdSetRenderingAttachmentLocationsKHRPtr FunPtr
(Ptr CommandBuffer_T
-> Ptr RenderingAttachmentLocationInfoKHR -> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> Ptr RenderingAttachmentLocationInfoKHR -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> Ptr RenderingAttachmentLocationInfoKHR -> 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 vkCmdSetRenderingAttachmentLocationsKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdSetRenderingAttachmentLocationsKHR' :: Ptr CommandBuffer_T
-> Ptr RenderingAttachmentLocationInfoKHR -> IO ()
vkCmdSetRenderingAttachmentLocationsKHR' = FunPtr
(Ptr CommandBuffer_T
-> Ptr RenderingAttachmentLocationInfoKHR -> IO ())
-> Ptr CommandBuffer_T
-> Ptr RenderingAttachmentLocationInfoKHR
-> IO ()
mkVkCmdSetRenderingAttachmentLocationsKHR FunPtr
(Ptr CommandBuffer_T
-> Ptr RenderingAttachmentLocationInfoKHR -> IO ())
vkCmdSetRenderingAttachmentLocationsKHRPtr
Ptr RenderingAttachmentLocationInfoKHR
pLocationInfo <- ((Ptr RenderingAttachmentLocationInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr RenderingAttachmentLocationInfoKHR)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr RenderingAttachmentLocationInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr RenderingAttachmentLocationInfoKHR))
-> ((Ptr RenderingAttachmentLocationInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr RenderingAttachmentLocationInfoKHR)
forall a b. (a -> b) -> a -> b
$ RenderingAttachmentLocationInfoKHR
-> (Ptr RenderingAttachmentLocationInfoKHR -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
RenderingAttachmentLocationInfoKHR
-> (Ptr RenderingAttachmentLocationInfoKHR -> IO b) -> IO b
withCStruct (RenderingAttachmentLocationInfoKHR
locationInfo)
IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdSetRenderingAttachmentLocationsKHR" (Ptr CommandBuffer_T
-> Ptr RenderingAttachmentLocationInfoKHR -> IO ()
vkCmdSetRenderingAttachmentLocationsKHR'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
Ptr RenderingAttachmentLocationInfoKHR
pLocationInfo)
() -> ContT () IO ()
forall a. a -> ContT () IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdSetRenderingInputAttachmentIndicesKHR
:: FunPtr (Ptr CommandBuffer_T -> Ptr RenderingInputAttachmentIndexInfoKHR -> IO ()) -> Ptr CommandBuffer_T -> Ptr RenderingInputAttachmentIndexInfoKHR -> IO ()
cmdSetRenderingInputAttachmentIndicesKHR :: forall io
. (MonadIO io)
=>
CommandBuffer
->
RenderingInputAttachmentIndexInfoKHR
-> io ()
cmdSetRenderingInputAttachmentIndicesKHR :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer -> RenderingInputAttachmentIndexInfoKHR -> io ()
cmdSetRenderingInputAttachmentIndicesKHR CommandBuffer
commandBuffer
RenderingInputAttachmentIndexInfoKHR
inputAttachmentIndexInfo = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdSetRenderingInputAttachmentIndicesKHRPtr :: FunPtr
(Ptr CommandBuffer_T
-> Ptr RenderingInputAttachmentIndexInfoKHR -> IO ())
vkCmdSetRenderingInputAttachmentIndicesKHRPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> Ptr RenderingInputAttachmentIndexInfoKHR -> IO ())
pVkCmdSetRenderingInputAttachmentIndicesKHR (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> Ptr RenderingInputAttachmentIndexInfoKHR -> IO ())
vkCmdSetRenderingInputAttachmentIndicesKHRPtr FunPtr
(Ptr CommandBuffer_T
-> Ptr RenderingInputAttachmentIndexInfoKHR -> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> Ptr RenderingInputAttachmentIndexInfoKHR -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> Ptr RenderingInputAttachmentIndexInfoKHR -> 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 vkCmdSetRenderingInputAttachmentIndicesKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdSetRenderingInputAttachmentIndicesKHR' :: Ptr CommandBuffer_T
-> Ptr RenderingInputAttachmentIndexInfoKHR -> IO ()
vkCmdSetRenderingInputAttachmentIndicesKHR' = FunPtr
(Ptr CommandBuffer_T
-> Ptr RenderingInputAttachmentIndexInfoKHR -> IO ())
-> Ptr CommandBuffer_T
-> Ptr RenderingInputAttachmentIndexInfoKHR
-> IO ()
mkVkCmdSetRenderingInputAttachmentIndicesKHR FunPtr
(Ptr CommandBuffer_T
-> Ptr RenderingInputAttachmentIndexInfoKHR -> IO ())
vkCmdSetRenderingInputAttachmentIndicesKHRPtr
Ptr RenderingInputAttachmentIndexInfoKHR
pInputAttachmentIndexInfo <- ((Ptr RenderingInputAttachmentIndexInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr RenderingInputAttachmentIndexInfoKHR)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr RenderingInputAttachmentIndexInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr RenderingInputAttachmentIndexInfoKHR))
-> ((Ptr RenderingInputAttachmentIndexInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr RenderingInputAttachmentIndexInfoKHR)
forall a b. (a -> b) -> a -> b
$ RenderingInputAttachmentIndexInfoKHR
-> (Ptr RenderingInputAttachmentIndexInfoKHR -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
RenderingInputAttachmentIndexInfoKHR
-> (Ptr RenderingInputAttachmentIndexInfoKHR -> IO b) -> IO b
withCStruct (RenderingInputAttachmentIndexInfoKHR
inputAttachmentIndexInfo)
IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdSetRenderingInputAttachmentIndicesKHR" (Ptr CommandBuffer_T
-> Ptr RenderingInputAttachmentIndexInfoKHR -> IO ()
vkCmdSetRenderingInputAttachmentIndicesKHR'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
Ptr RenderingInputAttachmentIndexInfoKHR
pInputAttachmentIndexInfo)
() -> ContT () IO ()
forall a. a -> ContT () IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()
data PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR = PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
{
PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> Bool
dynamicRenderingLocalRead :: Bool }
deriving (Typeable, PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> Bool
(PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> Bool)
-> (PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> Bool)
-> Eq PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> Bool
== :: PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> Bool
$c/= :: PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> Bool
/= :: PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR)
#endif
deriving instance Show PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
instance ToCStruct PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR where
withCStruct :: forall b.
PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> (Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> IO b)
-> IO b
withCStruct PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
x Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> IO b
f = Int
-> (Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> IO b)
-> IO b)
-> (Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
p -> Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> IO b
-> IO b
forall b.
Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> IO b
-> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
p PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
x (Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> IO b
f Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> IO b
-> IO b
pokeCStruct Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
p PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR{Bool
$sel:dynamicRenderingLocalRead:PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR :: PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> Bool
dynamicRenderingLocalRead :: Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
p Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES_KHR)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
p Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> 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 PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
p Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
dynamicRenderingLocalRead))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
p Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES_KHR)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
p Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> 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 PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
p Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> 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 PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR where
peekCStruct :: Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> IO PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
peekCStruct Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
p = do
Bool32
dynamicRenderingLocalRead <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
p Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> IO PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> IO PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR)
-> PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> IO PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
(Bool32 -> Bool
bool32ToBool Bool32
dynamicRenderingLocalRead)
instance Storable PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR where
sizeOf :: PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> Int
sizeOf ~PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
_ = Int
24
alignment :: PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> Int
alignment ~PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
_ = Int
8
peek :: Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> IO PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
peek = Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> IO PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR -> IO ()
poke Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
poked = Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> IO ()
-> IO ()
forall b.
Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
-> IO b
-> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
ptr PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR where
zero :: PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
zero = Bool -> PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
PhysicalDeviceDynamicRenderingLocalReadFeaturesKHR
Bool
forall a. Zero a => a
zero
data RenderingAttachmentLocationInfoKHR = RenderingAttachmentLocationInfoKHR
{
RenderingAttachmentLocationInfoKHR -> Vector Word32
colorAttachmentLocations :: Vector Word32 }
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (RenderingAttachmentLocationInfoKHR)
#endif
deriving instance Show RenderingAttachmentLocationInfoKHR
instance ToCStruct RenderingAttachmentLocationInfoKHR where
withCStruct :: forall b.
RenderingAttachmentLocationInfoKHR
-> (Ptr RenderingAttachmentLocationInfoKHR -> IO b) -> IO b
withCStruct RenderingAttachmentLocationInfoKHR
x Ptr RenderingAttachmentLocationInfoKHR -> IO b
f = Int -> (Ptr RenderingAttachmentLocationInfoKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr RenderingAttachmentLocationInfoKHR -> IO b) -> IO b)
-> (Ptr RenderingAttachmentLocationInfoKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr RenderingAttachmentLocationInfoKHR
p -> Ptr RenderingAttachmentLocationInfoKHR
-> RenderingAttachmentLocationInfoKHR -> IO b -> IO b
forall b.
Ptr RenderingAttachmentLocationInfoKHR
-> RenderingAttachmentLocationInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr RenderingAttachmentLocationInfoKHR
p RenderingAttachmentLocationInfoKHR
x (Ptr RenderingAttachmentLocationInfoKHR -> IO b
f Ptr RenderingAttachmentLocationInfoKHR
p)
pokeCStruct :: forall b.
Ptr RenderingAttachmentLocationInfoKHR
-> RenderingAttachmentLocationInfoKHR -> IO b -> IO b
pokeCStruct Ptr RenderingAttachmentLocationInfoKHR
p RenderingAttachmentLocationInfoKHR{Vector Word32
$sel:colorAttachmentLocations:RenderingAttachmentLocationInfoKHR :: RenderingAttachmentLocationInfoKHR -> Vector Word32
colorAttachmentLocations :: Vector Word32
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentLocationInfoKHR
p Ptr RenderingAttachmentLocationInfoKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO_KHR)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentLocationInfoKHR
p Ptr RenderingAttachmentLocationInfoKHR -> 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentLocationInfoKHR
p Ptr RenderingAttachmentLocationInfoKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector Word32 -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Word32 -> Int) -> Vector Word32 -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Word32
colorAttachmentLocations)) :: Word32))
Ptr Word32
pPColorAttachmentLocations' <- ((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32))
-> ((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Word32 ((Vector Word32 -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Word32
colorAttachmentLocations)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
4)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> Word32 -> IO ()) -> Vector Word32 -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Word32
e -> Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word32
pPColorAttachmentLocations' Ptr Word32 -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) (Word32
e)) (Vector Word32
colorAttachmentLocations)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr Word32) -> Ptr Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentLocationInfoKHR
p Ptr RenderingAttachmentLocationInfoKHR -> Int -> Ptr (Ptr Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Word32))) (Ptr Word32
pPColorAttachmentLocations')
IO b -> ContT b IO b
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO 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
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr RenderingAttachmentLocationInfoKHR -> IO b -> IO b
pokeZeroCStruct Ptr RenderingAttachmentLocationInfoKHR
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentLocationInfoKHR
p Ptr RenderingAttachmentLocationInfoKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO_KHR)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAttachmentLocationInfoKHR
p Ptr RenderingAttachmentLocationInfoKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct RenderingAttachmentLocationInfoKHR where
peekCStruct :: Ptr RenderingAttachmentLocationInfoKHR
-> IO RenderingAttachmentLocationInfoKHR
peekCStruct Ptr RenderingAttachmentLocationInfoKHR
p = do
Word32
colorAttachmentCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr RenderingAttachmentLocationInfoKHR
p Ptr RenderingAttachmentLocationInfoKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
Ptr Word32
pColorAttachmentLocations <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) ((Ptr RenderingAttachmentLocationInfoKHR
p Ptr RenderingAttachmentLocationInfoKHR -> Int -> Ptr (Ptr Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Word32)))
Vector Word32
pColorAttachmentLocations' <- Int -> (Int -> IO Word32) -> IO (Vector Word32)
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 @Word32 ((Ptr Word32
pColorAttachmentLocations Ptr Word32 -> Int -> Ptr Word32
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
RenderingAttachmentLocationInfoKHR
-> IO RenderingAttachmentLocationInfoKHR
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RenderingAttachmentLocationInfoKHR
-> IO RenderingAttachmentLocationInfoKHR)
-> RenderingAttachmentLocationInfoKHR
-> IO RenderingAttachmentLocationInfoKHR
forall a b. (a -> b) -> a -> b
$ Vector Word32 -> RenderingAttachmentLocationInfoKHR
RenderingAttachmentLocationInfoKHR
Vector Word32
pColorAttachmentLocations'
instance Zero RenderingAttachmentLocationInfoKHR where
zero :: RenderingAttachmentLocationInfoKHR
zero = Vector Word32 -> RenderingAttachmentLocationInfoKHR
RenderingAttachmentLocationInfoKHR
Vector Word32
forall a. Monoid a => a
mempty
data RenderingInputAttachmentIndexInfoKHR = RenderingInputAttachmentIndexInfoKHR
{
RenderingInputAttachmentIndexInfoKHR -> Word32
colorAttachmentCount :: Word32
,
RenderingInputAttachmentIndexInfoKHR -> Vector Word32
colorAttachmentInputIndices :: Vector Word32
,
RenderingInputAttachmentIndexInfoKHR -> Maybe Word32
depthInputAttachmentIndex :: Maybe Word32
,
RenderingInputAttachmentIndexInfoKHR -> Maybe Word32
stencilInputAttachmentIndex :: Maybe Word32
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (RenderingInputAttachmentIndexInfoKHR)
#endif
deriving instance Show RenderingInputAttachmentIndexInfoKHR
instance ToCStruct RenderingInputAttachmentIndexInfoKHR where
withCStruct :: forall b.
RenderingInputAttachmentIndexInfoKHR
-> (Ptr RenderingInputAttachmentIndexInfoKHR -> IO b) -> IO b
withCStruct RenderingInputAttachmentIndexInfoKHR
x Ptr RenderingInputAttachmentIndexInfoKHR -> IO b
f = Int -> (Ptr RenderingInputAttachmentIndexInfoKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr RenderingInputAttachmentIndexInfoKHR -> IO b) -> IO b)
-> (Ptr RenderingInputAttachmentIndexInfoKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr RenderingInputAttachmentIndexInfoKHR
p -> Ptr RenderingInputAttachmentIndexInfoKHR
-> RenderingInputAttachmentIndexInfoKHR -> IO b -> IO b
forall b.
Ptr RenderingInputAttachmentIndexInfoKHR
-> RenderingInputAttachmentIndexInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr RenderingInputAttachmentIndexInfoKHR
p RenderingInputAttachmentIndexInfoKHR
x (Ptr RenderingInputAttachmentIndexInfoKHR -> IO b
f Ptr RenderingInputAttachmentIndexInfoKHR
p)
pokeCStruct :: forall b.
Ptr RenderingInputAttachmentIndexInfoKHR
-> RenderingInputAttachmentIndexInfoKHR -> IO b -> IO b
pokeCStruct Ptr RenderingInputAttachmentIndexInfoKHR
p RenderingInputAttachmentIndexInfoKHR{Maybe Word32
Word32
Vector Word32
$sel:colorAttachmentCount:RenderingInputAttachmentIndexInfoKHR :: RenderingInputAttachmentIndexInfoKHR -> Word32
$sel:colorAttachmentInputIndices:RenderingInputAttachmentIndexInfoKHR :: RenderingInputAttachmentIndexInfoKHR -> Vector Word32
$sel:depthInputAttachmentIndex:RenderingInputAttachmentIndexInfoKHR :: RenderingInputAttachmentIndexInfoKHR -> Maybe Word32
$sel:stencilInputAttachmentIndex:RenderingInputAttachmentIndexInfoKHR :: RenderingInputAttachmentIndexInfoKHR -> Maybe Word32
colorAttachmentCount :: Word32
colorAttachmentInputIndices :: Vector Word32
depthInputAttachmentIndex :: Maybe Word32
stencilInputAttachmentIndex :: Maybe Word32
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingInputAttachmentIndexInfoKHR
p Ptr RenderingInputAttachmentIndexInfoKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO_KHR)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingInputAttachmentIndexInfoKHR
p Ptr RenderingInputAttachmentIndexInfoKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
let pColorAttachmentInputIndicesLength :: Int
pColorAttachmentInputIndicesLength = Vector Word32 -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Word32 -> Int) -> Vector Word32 -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Word32
colorAttachmentInputIndices)
Word32
colorAttachmentCount'' <- IO Word32 -> ContT b IO Word32
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Word32 -> ContT b IO Word32) -> IO Word32 -> ContT b IO Word32
forall a b. (a -> b) -> a -> b
$ if (Word32
colorAttachmentCount) Word32 -> Word32 -> Bool
forall a. Eq a => a -> a -> Bool
== Word32
0
then Word32 -> IO Word32
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Word32 -> IO Word32) -> Word32 -> IO Word32
forall a b. (a -> b) -> a -> b
$ Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pColorAttachmentInputIndicesLength
else do
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pColorAttachmentInputIndicesLength Word32 -> Word32 -> Bool
forall a. Eq a => a -> a -> Bool
== (Word32
colorAttachmentCount) Bool -> Bool -> Bool
|| Int
pColorAttachmentInputIndicesLength Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
0) (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
"pColorAttachmentInputIndices must be empty or have 'colorAttachmentCount' elements" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
Word32 -> IO Word32
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Word32
colorAttachmentCount)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingInputAttachmentIndexInfoKHR
p Ptr RenderingInputAttachmentIndexInfoKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
colorAttachmentCount'')
Ptr Word32
pColorAttachmentInputIndices'' <- if Vector Word32 -> Bool
forall a. Vector a -> Bool
Data.Vector.null (Vector Word32
colorAttachmentInputIndices)
then Ptr Word32 -> ContT b IO (Ptr Word32)
forall a. a -> ContT b IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr Word32
forall a. Ptr a
nullPtr
else do
Ptr Word32
pPColorAttachmentInputIndices <- ((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32))
-> ((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Word32 (((Vector Word32 -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Word32
colorAttachmentInputIndices))) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
4)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ (Int -> Word32 -> IO ()) -> Vector Word32 -> IO ()
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Word32
e -> Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word32
pPColorAttachmentInputIndices Ptr Word32 -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) (Word32
e)) ((Vector Word32
colorAttachmentInputIndices))
Ptr Word32 -> ContT b IO (Ptr Word32)
forall a. a -> ContT b IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Ptr Word32 -> ContT b IO (Ptr Word32))
-> Ptr Word32 -> ContT b IO (Ptr Word32)
forall a b. (a -> b) -> a -> b
$ Ptr Word32
pPColorAttachmentInputIndices
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr Word32) -> Ptr Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingInputAttachmentIndexInfoKHR
p Ptr RenderingInputAttachmentIndexInfoKHR -> Int -> Ptr (Ptr Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Word32))) Ptr Word32
pColorAttachmentInputIndices''
Ptr Word32
pDepthInputAttachmentIndex'' <- case (Maybe Word32
depthInputAttachmentIndex) of
Maybe Word32
Nothing -> Ptr Word32 -> ContT b IO (Ptr Word32)
forall a. a -> ContT b IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr Word32
forall a. Ptr a
nullPtr
Just Word32
j -> ((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32))
-> ((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32)
forall a b. (a -> b) -> a -> b
$ Word32 -> (Ptr Word32 -> IO b) -> IO b
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with (Word32
j)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr Word32) -> Ptr Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingInputAttachmentIndexInfoKHR
p Ptr RenderingInputAttachmentIndexInfoKHR -> Int -> Ptr (Ptr Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr Word32))) Ptr Word32
pDepthInputAttachmentIndex''
Ptr Word32
pStencilInputAttachmentIndex'' <- case (Maybe Word32
stencilInputAttachmentIndex) of
Maybe Word32
Nothing -> Ptr Word32 -> ContT b IO (Ptr Word32)
forall a. a -> ContT b IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr Word32
forall a. Ptr a
nullPtr
Just Word32
j -> ((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32))
-> ((Ptr Word32 -> IO b) -> IO b) -> ContT b IO (Ptr Word32)
forall a b. (a -> b) -> a -> b
$ Word32 -> (Ptr Word32 -> IO b) -> IO b
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with (Word32
j)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr Word32) -> Ptr Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingInputAttachmentIndexInfoKHR
p Ptr RenderingInputAttachmentIndexInfoKHR -> Int -> Ptr (Ptr Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr Word32))) Ptr Word32
pStencilInputAttachmentIndex''
IO b -> ContT b IO b
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO 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
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr RenderingInputAttachmentIndexInfoKHR -> IO b -> IO b
pokeZeroCStruct Ptr RenderingInputAttachmentIndexInfoKHR
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingInputAttachmentIndexInfoKHR
p Ptr RenderingInputAttachmentIndexInfoKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO_KHR)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingInputAttachmentIndexInfoKHR
p Ptr RenderingInputAttachmentIndexInfoKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct RenderingInputAttachmentIndexInfoKHR where
peekCStruct :: Ptr RenderingInputAttachmentIndexInfoKHR
-> IO RenderingInputAttachmentIndexInfoKHR
peekCStruct Ptr RenderingInputAttachmentIndexInfoKHR
p = do
Word32
colorAttachmentCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr RenderingInputAttachmentIndexInfoKHR
p Ptr RenderingInputAttachmentIndexInfoKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
Ptr Word32
pColorAttachmentInputIndices <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) ((Ptr RenderingInputAttachmentIndexInfoKHR
p Ptr RenderingInputAttachmentIndexInfoKHR -> Int -> Ptr (Ptr Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Word32)))
let pColorAttachmentInputIndicesLength :: Int
pColorAttachmentInputIndicesLength = if Ptr Word32
pColorAttachmentInputIndices Ptr Word32 -> Ptr Word32 -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Word32
forall a. Ptr a
nullPtr then Int
0 else (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
colorAttachmentCount)
Vector Word32
pColorAttachmentInputIndices' <- Int -> (Int -> IO Word32) -> IO (Vector Word32)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM Int
pColorAttachmentInputIndicesLength (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr Word32
pColorAttachmentInputIndices Ptr Word32 -> Int -> Ptr Word32
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
Ptr Word32
pDepthInputAttachmentIndex <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) ((Ptr RenderingInputAttachmentIndexInfoKHR
p Ptr RenderingInputAttachmentIndexInfoKHR -> Int -> Ptr (Ptr Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr Word32)))
Maybe Word32
pDepthInputAttachmentIndex' <- (Ptr Word32 -> IO Word32) -> Ptr Word32 -> IO (Maybe Word32)
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr Word32
j -> forall a. Storable a => Ptr a -> IO a
peek @Word32 (Ptr Word32
j)) Ptr Word32
pDepthInputAttachmentIndex
Ptr Word32
pStencilInputAttachmentIndex <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) ((Ptr RenderingInputAttachmentIndexInfoKHR
p Ptr RenderingInputAttachmentIndexInfoKHR -> Int -> Ptr (Ptr Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr Word32)))
Maybe Word32
pStencilInputAttachmentIndex' <- (Ptr Word32 -> IO Word32) -> Ptr Word32 -> IO (Maybe Word32)
forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr Word32
j -> forall a. Storable a => Ptr a -> IO a
peek @Word32 (Ptr Word32
j)) Ptr Word32
pStencilInputAttachmentIndex
RenderingInputAttachmentIndexInfoKHR
-> IO RenderingInputAttachmentIndexInfoKHR
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RenderingInputAttachmentIndexInfoKHR
-> IO RenderingInputAttachmentIndexInfoKHR)
-> RenderingInputAttachmentIndexInfoKHR
-> IO RenderingInputAttachmentIndexInfoKHR
forall a b. (a -> b) -> a -> b
$ Word32
-> Vector Word32
-> Maybe Word32
-> Maybe Word32
-> RenderingInputAttachmentIndexInfoKHR
RenderingInputAttachmentIndexInfoKHR
Word32
colorAttachmentCount
Vector Word32
pColorAttachmentInputIndices'
Maybe Word32
pDepthInputAttachmentIndex'
Maybe Word32
pStencilInputAttachmentIndex'
instance Zero RenderingInputAttachmentIndexInfoKHR where
zero :: RenderingInputAttachmentIndexInfoKHR
zero = Word32
-> Vector Word32
-> Maybe Word32
-> Maybe Word32
-> RenderingInputAttachmentIndexInfoKHR
RenderingInputAttachmentIndexInfoKHR
Word32
forall a. Zero a => a
zero
Vector Word32
forall a. Monoid a => a
mempty
Maybe Word32
forall a. Maybe a
Nothing
Maybe Word32
forall a. Maybe a
Nothing
type KHR_DYNAMIC_RENDERING_LOCAL_READ_SPEC_VERSION = 1
pattern KHR_DYNAMIC_RENDERING_LOCAL_READ_SPEC_VERSION :: forall a . Integral a => a
pattern $mKHR_DYNAMIC_RENDERING_LOCAL_READ_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bKHR_DYNAMIC_RENDERING_LOCAL_READ_SPEC_VERSION :: forall a. Integral a => a
KHR_DYNAMIC_RENDERING_LOCAL_READ_SPEC_VERSION = 1
type KHR_DYNAMIC_RENDERING_LOCAL_READ_EXTENSION_NAME = "VK_KHR_dynamic_rendering_local_read"
pattern KHR_DYNAMIC_RENDERING_LOCAL_READ_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mKHR_DYNAMIC_RENDERING_LOCAL_READ_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bKHR_DYNAMIC_RENDERING_LOCAL_READ_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
KHR_DYNAMIC_RENDERING_LOCAL_READ_EXTENSION_NAME = "VK_KHR_dynamic_rendering_local_read"