{-# language CPP #-}
module Vulkan.Extensions.VK_NV_device_diagnostic_checkpoints ( cmdSetCheckpointNV
, getQueueCheckpointDataNV
, QueueFamilyCheckpointPropertiesNV(..)
, CheckpointDataNV(..)
, NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_SPEC_VERSION
, pattern NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_SPEC_VERSION
, NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_EXTENSION_NAME
, pattern NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_EXTENSION_NAME
) where
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytesAligned)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.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 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.NamedType ((:::))
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Dynamic (DeviceCmds(pVkCmdSetCheckpointNV))
import Vulkan.Dynamic (DeviceCmds(pVkGetQueueCheckpointDataNV))
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.Core10.Enums.PipelineStageFlagBits (PipelineStageFlagBits)
import Vulkan.Core10.Enums.PipelineStageFlagBits (PipelineStageFlags)
import Vulkan.Core10.Handles (Queue)
import Vulkan.Core10.Handles (Queue(..))
import Vulkan.Core10.Handles (Queue_T)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_CHECKPOINT_DATA_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdSetCheckpointNV
:: FunPtr (Ptr CommandBuffer_T -> Ptr () -> IO ()) -> Ptr CommandBuffer_T -> Ptr () -> IO ()
cmdSetCheckpointNV :: forall io
. (MonadIO io)
=>
CommandBuffer
->
("checkpointMarker" ::: Ptr ())
-> io ()
cmdSetCheckpointNV :: CommandBuffer -> ("checkpointMarker" ::: Ptr ()) -> io ()
cmdSetCheckpointNV commandBuffer :: CommandBuffer
commandBuffer checkpointMarker :: "checkpointMarker" ::: Ptr ()
checkpointMarker = 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 vkCmdSetCheckpointNVPtr :: FunPtr
(Ptr CommandBuffer_T -> ("checkpointMarker" ::: Ptr ()) -> IO ())
vkCmdSetCheckpointNVPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T -> ("checkpointMarker" ::: Ptr ()) -> IO ())
pVkCmdSetCheckpointNV (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T -> ("checkpointMarker" ::: Ptr ()) -> IO ())
vkCmdSetCheckpointNVPtr FunPtr
(Ptr CommandBuffer_T -> ("checkpointMarker" ::: Ptr ()) -> IO ())
-> FunPtr
(Ptr CommandBuffer_T -> ("checkpointMarker" ::: Ptr ()) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T -> ("checkpointMarker" ::: Ptr ()) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCmdSetCheckpointNV is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdSetCheckpointNV' :: Ptr CommandBuffer_T -> ("checkpointMarker" ::: Ptr ()) -> IO ()
vkCmdSetCheckpointNV' = FunPtr
(Ptr CommandBuffer_T -> ("checkpointMarker" ::: Ptr ()) -> IO ())
-> Ptr CommandBuffer_T -> ("checkpointMarker" ::: Ptr ()) -> IO ()
mkVkCmdSetCheckpointNV FunPtr
(Ptr CommandBuffer_T -> ("checkpointMarker" ::: Ptr ()) -> IO ())
vkCmdSetCheckpointNVPtr
Ptr CommandBuffer_T -> ("checkpointMarker" ::: Ptr ()) -> IO ()
vkCmdSetCheckpointNV' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) ("checkpointMarker" ::: Ptr ()
checkpointMarker)
() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> IO ()) -> () -> IO ()
forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetQueueCheckpointDataNV
:: FunPtr (Ptr Queue_T -> Ptr Word32 -> Ptr CheckpointDataNV -> IO ()) -> Ptr Queue_T -> Ptr Word32 -> Ptr CheckpointDataNV -> IO ()
getQueueCheckpointDataNV :: forall io
. (MonadIO io)
=>
Queue
-> io (("checkpointData" ::: Vector CheckpointDataNV))
getQueueCheckpointDataNV :: Queue -> io ("checkpointData" ::: Vector CheckpointDataNV)
getQueueCheckpointDataNV queue :: Queue
queue = IO ("checkpointData" ::: Vector CheckpointDataNV)
-> io ("checkpointData" ::: Vector CheckpointDataNV)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ("checkpointData" ::: Vector CheckpointDataNV)
-> io ("checkpointData" ::: Vector CheckpointDataNV))
-> (ContT
("checkpointData" ::: Vector CheckpointDataNV)
IO
("checkpointData" ::: Vector CheckpointDataNV)
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> ContT
("checkpointData" ::: Vector CheckpointDataNV)
IO
("checkpointData" ::: Vector CheckpointDataNV)
-> io ("checkpointData" ::: Vector CheckpointDataNV)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
("checkpointData" ::: Vector CheckpointDataNV)
IO
("checkpointData" ::: Vector CheckpointDataNV)
-> IO ("checkpointData" ::: Vector CheckpointDataNV)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
("checkpointData" ::: Vector CheckpointDataNV)
IO
("checkpointData" ::: Vector CheckpointDataNV)
-> io ("checkpointData" ::: Vector CheckpointDataNV))
-> ContT
("checkpointData" ::: Vector CheckpointDataNV)
IO
("checkpointData" ::: Vector CheckpointDataNV)
-> io ("checkpointData" ::: Vector CheckpointDataNV)
forall a b. (a -> b) -> a -> b
$ do
let vkGetQueueCheckpointDataNVPtr :: FunPtr
(Ptr Queue_T
-> ("pCheckpointDataCount" ::: Ptr Word32)
-> ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> IO ())
vkGetQueueCheckpointDataNVPtr = DeviceCmds
-> FunPtr
(Ptr Queue_T
-> ("pCheckpointDataCount" ::: Ptr Word32)
-> ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> IO ())
pVkGetQueueCheckpointDataNV (Queue -> DeviceCmds
deviceCmds (Queue
queue :: Queue))
IO () -> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
-> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO ())
-> IO ()
-> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Queue_T
-> ("pCheckpointDataCount" ::: Ptr Word32)
-> ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> IO ())
vkGetQueueCheckpointDataNVPtr FunPtr
(Ptr Queue_T
-> ("pCheckpointDataCount" ::: Ptr Word32)
-> ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> IO ())
-> FunPtr
(Ptr Queue_T
-> ("pCheckpointDataCount" ::: Ptr Word32)
-> ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Queue_T
-> ("pCheckpointDataCount" ::: Ptr Word32)
-> ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkGetQueueCheckpointDataNV is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkGetQueueCheckpointDataNV' :: Ptr Queue_T
-> ("pCheckpointDataCount" ::: Ptr Word32)
-> ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> IO ()
vkGetQueueCheckpointDataNV' = FunPtr
(Ptr Queue_T
-> ("pCheckpointDataCount" ::: Ptr Word32)
-> ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> IO ())
-> Ptr Queue_T
-> ("pCheckpointDataCount" ::: Ptr Word32)
-> ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> IO ()
mkVkGetQueueCheckpointDataNV FunPtr
(Ptr Queue_T
-> ("pCheckpointDataCount" ::: Ptr Word32)
-> ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> IO ())
vkGetQueueCheckpointDataNVPtr
let queue' :: Ptr Queue_T
queue' = Queue -> Ptr Queue_T
queueHandle (Queue
queue)
"pCheckpointDataCount" ::: Ptr Word32
pPCheckpointDataCount <- ((("pCheckpointDataCount" ::: Ptr Word32)
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> ContT
("checkpointData" ::: Vector CheckpointDataNV)
IO
("pCheckpointDataCount" ::: Ptr Word32)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCheckpointDataCount" ::: Ptr Word32)
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> ContT
("checkpointData" ::: Vector CheckpointDataNV)
IO
("pCheckpointDataCount" ::: Ptr Word32))
-> ((("pCheckpointDataCount" ::: Ptr Word32)
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> ContT
("checkpointData" ::: Vector CheckpointDataNV)
IO
("pCheckpointDataCount" ::: Ptr Word32)
forall a b. (a -> b) -> a -> b
$ IO ("pCheckpointDataCount" ::: Ptr Word32)
-> (("pCheckpointDataCount" ::: Ptr Word32) -> IO ())
-> (("pCheckpointDataCount" ::: Ptr Word32)
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> IO ("checkpointData" ::: Vector CheckpointDataNV)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pCheckpointDataCount" ::: Ptr Word32)
forall a. Int -> IO (Ptr a)
callocBytes @Word32 4) ("pCheckpointDataCount" ::: Ptr Word32) -> IO ()
forall a. Ptr a -> IO ()
free
IO () -> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
-> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO ())
-> IO ()
-> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Queue_T
-> ("pCheckpointDataCount" ::: Ptr Word32)
-> ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> IO ()
vkGetQueueCheckpointDataNV' Ptr Queue_T
queue' ("pCheckpointDataCount" ::: Ptr Word32
pPCheckpointDataCount) ("pCheckpointData" ::: Ptr CheckpointDataNV
forall a. Ptr a
nullPtr)
Word32
pCheckpointDataCount <- IO Word32
-> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO Word32
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Word32
-> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO Word32)
-> IO Word32
-> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO Word32
forall a b. (a -> b) -> a -> b
$ ("pCheckpointDataCount" ::: Ptr Word32) -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 "pCheckpointDataCount" ::: Ptr Word32
pPCheckpointDataCount
"pCheckpointData" ::: Ptr CheckpointDataNV
pPCheckpointData <- ((("pCheckpointData" ::: Ptr CheckpointDataNV)
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> ContT
("checkpointData" ::: Vector CheckpointDataNV)
IO
("pCheckpointData" ::: Ptr CheckpointDataNV)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCheckpointData" ::: Ptr CheckpointDataNV)
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> ContT
("checkpointData" ::: Vector CheckpointDataNV)
IO
("pCheckpointData" ::: Ptr CheckpointDataNV))
-> ((("pCheckpointData" ::: Ptr CheckpointDataNV)
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> ContT
("checkpointData" ::: Vector CheckpointDataNV)
IO
("pCheckpointData" ::: Ptr CheckpointDataNV)
forall a b. (a -> b) -> a -> b
$ IO ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> (("pCheckpointData" ::: Ptr CheckpointDataNV) -> IO ())
-> (("pCheckpointData" ::: Ptr CheckpointDataNV)
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> IO ("checkpointData" ::: Vector CheckpointDataNV)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pCheckpointData" ::: Ptr CheckpointDataNV)
forall a. Int -> IO (Ptr a)
callocBytes @CheckpointDataNV ((Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pCheckpointDataCount)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 32)) ("pCheckpointData" ::: Ptr CheckpointDataNV) -> IO ()
forall a. Ptr a -> IO ()
free
[()]
_ <- (Int -> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO ())
-> [Int]
-> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO [()]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (\i :: Int
i -> ((() -> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO ())
-> ((() -> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO ()
forall a b. (a -> b) -> a -> b
$ ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> IO ("checkpointData" ::: Vector CheckpointDataNV)
-> IO ("checkpointData" ::: Vector CheckpointDataNV)
forall a b. ToCStruct a => Ptr a -> IO b -> IO b
pokeZeroCStruct ("pCheckpointData" ::: Ptr CheckpointDataNV
pPCheckpointData ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> Int -> "pCheckpointData" ::: Ptr CheckpointDataNV
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
i Int -> Int -> Int
forall a. Num a => a -> a -> a
* 32) :: Ptr CheckpointDataNV) (IO ("checkpointData" ::: Vector CheckpointDataNV)
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> ((() -> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> (() -> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> IO ("checkpointData" ::: Vector CheckpointDataNV)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO ("checkpointData" ::: Vector CheckpointDataNV))
-> () -> IO ("checkpointData" ::: Vector CheckpointDataNV)
forall a b. (a -> b) -> a -> b
$ ())) [0..(Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pCheckpointDataCount)) Int -> Int -> Int
forall a. Num a => a -> a -> a
- 1]
IO () -> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
-> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO ())
-> IO ()
-> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Queue_T
-> ("pCheckpointDataCount" ::: Ptr Word32)
-> ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> IO ()
vkGetQueueCheckpointDataNV' Ptr Queue_T
queue' ("pCheckpointDataCount" ::: Ptr Word32
pPCheckpointDataCount) (("pCheckpointData" ::: Ptr CheckpointDataNV
pPCheckpointData))
Word32
pCheckpointDataCount' <- IO Word32
-> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO Word32
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Word32
-> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO Word32)
-> IO Word32
-> ContT ("checkpointData" ::: Vector CheckpointDataNV) IO Word32
forall a b. (a -> b) -> a -> b
$ ("pCheckpointDataCount" ::: Ptr Word32) -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 "pCheckpointDataCount" ::: Ptr Word32
pPCheckpointDataCount
"checkpointData" ::: Vector CheckpointDataNV
pCheckpointData' <- IO ("checkpointData" ::: Vector CheckpointDataNV)
-> ContT
("checkpointData" ::: Vector CheckpointDataNV)
IO
("checkpointData" ::: Vector CheckpointDataNV)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("checkpointData" ::: Vector CheckpointDataNV)
-> ContT
("checkpointData" ::: Vector CheckpointDataNV)
IO
("checkpointData" ::: Vector CheckpointDataNV))
-> IO ("checkpointData" ::: Vector CheckpointDataNV)
-> ContT
("checkpointData" ::: Vector CheckpointDataNV)
IO
("checkpointData" ::: Vector CheckpointDataNV)
forall a b. (a -> b) -> a -> b
$ Int
-> (Int -> IO CheckpointDataNV)
-> IO ("checkpointData" ::: Vector CheckpointDataNV)
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
pCheckpointDataCount')) (\i :: Int
i -> ("pCheckpointData" ::: Ptr CheckpointDataNV) -> IO CheckpointDataNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @CheckpointDataNV ((("pCheckpointData" ::: Ptr CheckpointDataNV
pPCheckpointData) ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> Int -> "pCheckpointData" ::: Ptr CheckpointDataNV
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (32 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr CheckpointDataNV)))
("checkpointData" ::: Vector CheckpointDataNV)
-> ContT
("checkpointData" ::: Vector CheckpointDataNV)
IO
("checkpointData" ::: Vector CheckpointDataNV)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("checkpointData" ::: Vector CheckpointDataNV)
-> ContT
("checkpointData" ::: Vector CheckpointDataNV)
IO
("checkpointData" ::: Vector CheckpointDataNV))
-> ("checkpointData" ::: Vector CheckpointDataNV)
-> ContT
("checkpointData" ::: Vector CheckpointDataNV)
IO
("checkpointData" ::: Vector CheckpointDataNV)
forall a b. (a -> b) -> a -> b
$ ("checkpointData" ::: Vector CheckpointDataNV
pCheckpointData')
data QueueFamilyCheckpointPropertiesNV = QueueFamilyCheckpointPropertiesNV
{
QueueFamilyCheckpointPropertiesNV -> PipelineStageFlags
checkpointExecutionStageMask :: PipelineStageFlags }
deriving (Typeable, QueueFamilyCheckpointPropertiesNV
-> QueueFamilyCheckpointPropertiesNV -> Bool
(QueueFamilyCheckpointPropertiesNV
-> QueueFamilyCheckpointPropertiesNV -> Bool)
-> (QueueFamilyCheckpointPropertiesNV
-> QueueFamilyCheckpointPropertiesNV -> Bool)
-> Eq QueueFamilyCheckpointPropertiesNV
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QueueFamilyCheckpointPropertiesNV
-> QueueFamilyCheckpointPropertiesNV -> Bool
$c/= :: QueueFamilyCheckpointPropertiesNV
-> QueueFamilyCheckpointPropertiesNV -> Bool
== :: QueueFamilyCheckpointPropertiesNV
-> QueueFamilyCheckpointPropertiesNV -> Bool
$c== :: QueueFamilyCheckpointPropertiesNV
-> QueueFamilyCheckpointPropertiesNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (QueueFamilyCheckpointPropertiesNV)
#endif
deriving instance Show QueueFamilyCheckpointPropertiesNV
instance ToCStruct QueueFamilyCheckpointPropertiesNV where
withCStruct :: QueueFamilyCheckpointPropertiesNV
-> (Ptr QueueFamilyCheckpointPropertiesNV -> IO b) -> IO b
withCStruct x :: QueueFamilyCheckpointPropertiesNV
x f :: Ptr QueueFamilyCheckpointPropertiesNV -> IO b
f = Int
-> Int -> (Ptr QueueFamilyCheckpointPropertiesNV -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr QueueFamilyCheckpointPropertiesNV -> IO b) -> IO b)
-> (Ptr QueueFamilyCheckpointPropertiesNV -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr QueueFamilyCheckpointPropertiesNV
p -> Ptr QueueFamilyCheckpointPropertiesNV
-> QueueFamilyCheckpointPropertiesNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr QueueFamilyCheckpointPropertiesNV
p QueueFamilyCheckpointPropertiesNV
x (Ptr QueueFamilyCheckpointPropertiesNV -> IO b
f Ptr QueueFamilyCheckpointPropertiesNV
p)
pokeCStruct :: Ptr QueueFamilyCheckpointPropertiesNV
-> QueueFamilyCheckpointPropertiesNV -> IO b -> IO b
pokeCStruct p :: Ptr QueueFamilyCheckpointPropertiesNV
p QueueFamilyCheckpointPropertiesNV{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr QueueFamilyCheckpointPropertiesNV
p Ptr QueueFamilyCheckpointPropertiesNV -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV)
Ptr ("checkpointMarker" ::: Ptr ())
-> ("checkpointMarker" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr QueueFamilyCheckpointPropertiesNV
p Ptr QueueFamilyCheckpointPropertiesNV
-> Int -> Ptr ("checkpointMarker" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("checkpointMarker" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr PipelineStageFlags -> PipelineStageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr QueueFamilyCheckpointPropertiesNV
p Ptr QueueFamilyCheckpointPropertiesNV
-> Int -> Ptr PipelineStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr PipelineStageFlags)) (PipelineStageFlags
checkpointExecutionStageMask)
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr QueueFamilyCheckpointPropertiesNV -> IO b -> IO b
pokeZeroCStruct p :: Ptr QueueFamilyCheckpointPropertiesNV
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr QueueFamilyCheckpointPropertiesNV
p Ptr QueueFamilyCheckpointPropertiesNV -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV)
Ptr ("checkpointMarker" ::: Ptr ())
-> ("checkpointMarker" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr QueueFamilyCheckpointPropertiesNV
p Ptr QueueFamilyCheckpointPropertiesNV
-> Int -> Ptr ("checkpointMarker" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("checkpointMarker" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr PipelineStageFlags -> PipelineStageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr QueueFamilyCheckpointPropertiesNV
p Ptr QueueFamilyCheckpointPropertiesNV
-> Int -> Ptr PipelineStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr PipelineStageFlags)) (PipelineStageFlags
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct QueueFamilyCheckpointPropertiesNV where
peekCStruct :: Ptr QueueFamilyCheckpointPropertiesNV
-> IO QueueFamilyCheckpointPropertiesNV
peekCStruct p :: Ptr QueueFamilyCheckpointPropertiesNV
p = do
PipelineStageFlags
checkpointExecutionStageMask <- Ptr PipelineStageFlags -> IO PipelineStageFlags
forall a. Storable a => Ptr a -> IO a
peek @PipelineStageFlags ((Ptr QueueFamilyCheckpointPropertiesNV
p Ptr QueueFamilyCheckpointPropertiesNV
-> Int -> Ptr PipelineStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr PipelineStageFlags))
QueueFamilyCheckpointPropertiesNV
-> IO QueueFamilyCheckpointPropertiesNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (QueueFamilyCheckpointPropertiesNV
-> IO QueueFamilyCheckpointPropertiesNV)
-> QueueFamilyCheckpointPropertiesNV
-> IO QueueFamilyCheckpointPropertiesNV
forall a b. (a -> b) -> a -> b
$ PipelineStageFlags -> QueueFamilyCheckpointPropertiesNV
QueueFamilyCheckpointPropertiesNV
PipelineStageFlags
checkpointExecutionStageMask
instance Storable QueueFamilyCheckpointPropertiesNV where
sizeOf :: QueueFamilyCheckpointPropertiesNV -> Int
sizeOf ~QueueFamilyCheckpointPropertiesNV
_ = 24
alignment :: QueueFamilyCheckpointPropertiesNV -> Int
alignment ~QueueFamilyCheckpointPropertiesNV
_ = 8
peek :: Ptr QueueFamilyCheckpointPropertiesNV
-> IO QueueFamilyCheckpointPropertiesNV
peek = Ptr QueueFamilyCheckpointPropertiesNV
-> IO QueueFamilyCheckpointPropertiesNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr QueueFamilyCheckpointPropertiesNV
-> QueueFamilyCheckpointPropertiesNV -> IO ()
poke ptr :: Ptr QueueFamilyCheckpointPropertiesNV
ptr poked :: QueueFamilyCheckpointPropertiesNV
poked = Ptr QueueFamilyCheckpointPropertiesNV
-> QueueFamilyCheckpointPropertiesNV -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr QueueFamilyCheckpointPropertiesNV
ptr QueueFamilyCheckpointPropertiesNV
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero QueueFamilyCheckpointPropertiesNV where
zero :: QueueFamilyCheckpointPropertiesNV
zero = PipelineStageFlags -> QueueFamilyCheckpointPropertiesNV
QueueFamilyCheckpointPropertiesNV
PipelineStageFlags
forall a. Zero a => a
zero
data CheckpointDataNV = CheckpointDataNV
{
CheckpointDataNV -> PipelineStageFlags
stage :: PipelineStageFlagBits
,
CheckpointDataNV -> "checkpointMarker" ::: Ptr ()
checkpointMarker :: Ptr ()
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CheckpointDataNV)
#endif
deriving instance Show CheckpointDataNV
instance ToCStruct CheckpointDataNV where
withCStruct :: CheckpointDataNV
-> (("pCheckpointData" ::: Ptr CheckpointDataNV) -> IO b) -> IO b
withCStruct x :: CheckpointDataNV
x f :: ("pCheckpointData" ::: Ptr CheckpointDataNV) -> IO b
f = Int
-> Int
-> (("pCheckpointData" ::: Ptr CheckpointDataNV) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((("pCheckpointData" ::: Ptr CheckpointDataNV) -> IO b) -> IO b)
-> (("pCheckpointData" ::: Ptr CheckpointDataNV) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pCheckpointData" ::: Ptr CheckpointDataNV
p -> ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> CheckpointDataNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCheckpointData" ::: Ptr CheckpointDataNV
p CheckpointDataNV
x (("pCheckpointData" ::: Ptr CheckpointDataNV) -> IO b
f "pCheckpointData" ::: Ptr CheckpointDataNV
p)
pokeCStruct :: ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> CheckpointDataNV -> IO b -> IO b
pokeCStruct p :: "pCheckpointData" ::: Ptr CheckpointDataNV
p CheckpointDataNV{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCheckpointData" ::: Ptr CheckpointDataNV
p ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CHECKPOINT_DATA_NV)
Ptr ("checkpointMarker" ::: Ptr ())
-> ("checkpointMarker" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCheckpointData" ::: Ptr CheckpointDataNV
p ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> Int -> Ptr ("checkpointMarker" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("checkpointMarker" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr PipelineStageFlags -> PipelineStageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCheckpointData" ::: Ptr CheckpointDataNV
p ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> Int -> Ptr PipelineStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr PipelineStageFlagBits)) (PipelineStageFlags
stage)
Ptr ("checkpointMarker" ::: Ptr ())
-> ("checkpointMarker" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCheckpointData" ::: Ptr CheckpointDataNV
p ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> Int -> Ptr ("checkpointMarker" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr ()))) ("checkpointMarker" ::: Ptr ()
checkpointMarker)
IO b
f
cStructSize :: Int
cStructSize = 32
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: ("pCheckpointData" ::: Ptr CheckpointDataNV) -> IO b -> IO b
pokeZeroCStruct p :: "pCheckpointData" ::: Ptr CheckpointDataNV
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCheckpointData" ::: Ptr CheckpointDataNV
p ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CHECKPOINT_DATA_NV)
Ptr ("checkpointMarker" ::: Ptr ())
-> ("checkpointMarker" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCheckpointData" ::: Ptr CheckpointDataNV
p ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> Int -> Ptr ("checkpointMarker" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) ("checkpointMarker" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr PipelineStageFlags -> PipelineStageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCheckpointData" ::: Ptr CheckpointDataNV
p ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> Int -> Ptr PipelineStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr PipelineStageFlagBits)) (PipelineStageFlags
forall a. Zero a => a
zero)
Ptr ("checkpointMarker" ::: Ptr ())
-> ("checkpointMarker" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCheckpointData" ::: Ptr CheckpointDataNV
p ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> Int -> Ptr ("checkpointMarker" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr ()))) ("checkpointMarker" ::: Ptr ()
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct CheckpointDataNV where
peekCStruct :: ("pCheckpointData" ::: Ptr CheckpointDataNV) -> IO CheckpointDataNV
peekCStruct p :: "pCheckpointData" ::: Ptr CheckpointDataNV
p = do
PipelineStageFlags
stage <- Ptr PipelineStageFlags -> IO PipelineStageFlags
forall a. Storable a => Ptr a -> IO a
peek @PipelineStageFlagBits (("pCheckpointData" ::: Ptr CheckpointDataNV
p ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> Int -> Ptr PipelineStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr PipelineStageFlagBits))
"checkpointMarker" ::: Ptr ()
pCheckpointMarker <- Ptr ("checkpointMarker" ::: Ptr ())
-> IO ("checkpointMarker" ::: Ptr ())
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) (("pCheckpointData" ::: Ptr CheckpointDataNV
p ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> Int -> Ptr ("checkpointMarker" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr ())))
CheckpointDataNV -> IO CheckpointDataNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CheckpointDataNV -> IO CheckpointDataNV)
-> CheckpointDataNV -> IO CheckpointDataNV
forall a b. (a -> b) -> a -> b
$ PipelineStageFlags
-> ("checkpointMarker" ::: Ptr ()) -> CheckpointDataNV
CheckpointDataNV
PipelineStageFlags
stage "checkpointMarker" ::: Ptr ()
pCheckpointMarker
instance Storable CheckpointDataNV where
sizeOf :: CheckpointDataNV -> Int
sizeOf ~CheckpointDataNV
_ = 32
alignment :: CheckpointDataNV -> Int
alignment ~CheckpointDataNV
_ = 8
peek :: ("pCheckpointData" ::: Ptr CheckpointDataNV) -> IO CheckpointDataNV
peek = ("pCheckpointData" ::: Ptr CheckpointDataNV) -> IO CheckpointDataNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> CheckpointDataNV -> IO ()
poke ptr :: "pCheckpointData" ::: Ptr CheckpointDataNV
ptr poked :: CheckpointDataNV
poked = ("pCheckpointData" ::: Ptr CheckpointDataNV)
-> CheckpointDataNV -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCheckpointData" ::: Ptr CheckpointDataNV
ptr CheckpointDataNV
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero CheckpointDataNV where
zero :: CheckpointDataNV
zero = PipelineStageFlags
-> ("checkpointMarker" ::: Ptr ()) -> CheckpointDataNV
CheckpointDataNV
PipelineStageFlags
forall a. Zero a => a
zero
"checkpointMarker" ::: Ptr ()
forall a. Zero a => a
zero
type NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_SPEC_VERSION = 2
pattern NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_SPEC_VERSION :: forall a . Integral a => a
pattern $bNV_DEVICE_DIAGNOSTIC_CHECKPOINTS_SPEC_VERSION :: a
$mNV_DEVICE_DIAGNOSTIC_CHECKPOINTS_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_SPEC_VERSION = 2
type NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_EXTENSION_NAME = "VK_NV_device_diagnostic_checkpoints"
pattern NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bNV_DEVICE_DIAGNOSTIC_CHECKPOINTS_EXTENSION_NAME :: a
$mNV_DEVICE_DIAGNOSTIC_CHECKPOINTS_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_EXTENSION_NAME = "VK_NV_device_diagnostic_checkpoints"