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