{-# language CPP #-}
module Graphics.Vulkan.Core12.Promoted_From_VK_KHR_timeline_semaphore ( getSemaphoreCounterValue
, waitSemaphores
, signalSemaphore
, PhysicalDeviceTimelineSemaphoreFeatures(..)
, PhysicalDeviceTimelineSemaphoreProperties(..)
, SemaphoreTypeCreateInfo(..)
, TimelineSemaphoreSubmitInfo(..)
, SemaphoreWaitInfo(..)
, SemaphoreSignalInfo(..)
, StructureType(..)
, SemaphoreType(..)
, SemaphoreWaitFlagBits(..)
, SemaphoreWaitFlags
) 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 Foreign.Marshal.Utils (maybePeek)
import GHC.Base (when)
import GHC.IO (throwIO)
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 Control.Monad.IO.Class (MonadIO)
import Data.Either (Either)
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.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Word (Word64)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Graphics.Vulkan.CStruct.Utils (advancePtrBytes)
import Graphics.Vulkan.Core10.BaseType (bool32ToBool)
import Graphics.Vulkan.Core10.BaseType (boolToBool32)
import Graphics.Vulkan.NamedType ((:::))
import Graphics.Vulkan.Core10.BaseType (Bool32)
import Graphics.Vulkan.Core10.Handles (Device)
import Graphics.Vulkan.Core10.Handles (Device(..))
import Graphics.Vulkan.Dynamic (DeviceCmds(pVkGetSemaphoreCounterValue))
import Graphics.Vulkan.Dynamic (DeviceCmds(pVkSignalSemaphore))
import Graphics.Vulkan.Dynamic (DeviceCmds(pVkWaitSemaphores))
import Graphics.Vulkan.Core10.Handles (Device_T)
import Graphics.Vulkan.CStruct (FromCStruct)
import Graphics.Vulkan.CStruct (FromCStruct(..))
import Graphics.Vulkan.Core10.Enums.Result (Result)
import Graphics.Vulkan.Core10.Enums.Result (Result(..))
import Graphics.Vulkan.Core10.Handles (Semaphore)
import Graphics.Vulkan.Core10.Handles (Semaphore(..))
import Graphics.Vulkan.Core12.Enums.SemaphoreType (SemaphoreType)
import Graphics.Vulkan.Core12.Enums.SemaphoreWaitFlagBits (SemaphoreWaitFlags)
import Graphics.Vulkan.Core10.Enums.StructureType (StructureType)
import Graphics.Vulkan.CStruct (ToCStruct)
import Graphics.Vulkan.CStruct (ToCStruct(..))
import Graphics.Vulkan.Exception (VulkanException(..))
import Graphics.Vulkan.Zero (Zero(..))
import Graphics.Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES))
import Graphics.Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES))
import Graphics.Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO))
import Graphics.Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO))
import Graphics.Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO))
import Graphics.Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO))
import Graphics.Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Graphics.Vulkan.Core12.Enums.SemaphoreType (SemaphoreType(..))
import Graphics.Vulkan.Core12.Enums.SemaphoreWaitFlagBits (SemaphoreWaitFlagBits(..))
import Graphics.Vulkan.Core12.Enums.SemaphoreWaitFlagBits (SemaphoreWaitFlags)
import Graphics.Vulkan.Core10.Enums.StructureType (StructureType(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetSemaphoreCounterValue
:: FunPtr (Ptr Device_T -> Semaphore -> Ptr Word64 -> IO Result) -> Ptr Device_T -> Semaphore -> Ptr Word64 -> IO Result
getSemaphoreCounterValue :: forall io . MonadIO io => Device -> Semaphore -> io (("value" ::: Word64))
getSemaphoreCounterValue device semaphore = liftIO . evalContT $ do
let vkGetSemaphoreCounterValue' = mkVkGetSemaphoreCounterValue (pVkGetSemaphoreCounterValue (deviceCmds (device :: Device)))
pPValue <- ContT $ bracket (callocBytes @Word64 8) free
r <- lift $ vkGetSemaphoreCounterValue' (deviceHandle (device)) (semaphore) (pPValue)
lift $ when (r < SUCCESS) (throwIO (VulkanException r))
pValue <- lift $ peek @Word64 pPValue
pure $ (pValue)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkWaitSemaphores
:: FunPtr (Ptr Device_T -> Ptr SemaphoreWaitInfo -> Word64 -> IO Result) -> Ptr Device_T -> Ptr SemaphoreWaitInfo -> Word64 -> IO Result
waitSemaphores :: forall io . MonadIO io => Device -> SemaphoreWaitInfo -> ("timeout" ::: Word64) -> io (Result)
waitSemaphores device waitInfo timeout = liftIO . evalContT $ do
let vkWaitSemaphores' = mkVkWaitSemaphores (pVkWaitSemaphores (deviceCmds (device :: Device)))
pWaitInfo <- ContT $ withCStruct (waitInfo)
r <- lift $ vkWaitSemaphores' (deviceHandle (device)) pWaitInfo (timeout)
lift $ when (r < SUCCESS) (throwIO (VulkanException r))
pure $ (r)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkSignalSemaphore
:: FunPtr (Ptr Device_T -> Ptr SemaphoreSignalInfo -> IO Result) -> Ptr Device_T -> Ptr SemaphoreSignalInfo -> IO Result
signalSemaphore :: forall io . MonadIO io => Device -> SemaphoreSignalInfo -> io ()
signalSemaphore device signalInfo = liftIO . evalContT $ do
let vkSignalSemaphore' = mkVkSignalSemaphore (pVkSignalSemaphore (deviceCmds (device :: Device)))
pSignalInfo <- ContT $ withCStruct (signalInfo)
r <- lift $ vkSignalSemaphore' (deviceHandle (device)) pSignalInfo
lift $ when (r < SUCCESS) (throwIO (VulkanException r))
data PhysicalDeviceTimelineSemaphoreFeatures = PhysicalDeviceTimelineSemaphoreFeatures
{
timelineSemaphore :: Bool }
deriving (Typeable)
deriving instance Show PhysicalDeviceTimelineSemaphoreFeatures
instance ToCStruct PhysicalDeviceTimelineSemaphoreFeatures where
withCStruct x f = allocaBytesAligned 24 8 $ \p -> pokeCStruct p x (f p)
pokeCStruct p PhysicalDeviceTimelineSemaphoreFeatures{..} f = do
poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES)
poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
poke ((p `plusPtr` 16 :: Ptr Bool32)) (boolToBool32 (timelineSemaphore))
f
cStructSize = 24
cStructAlignment = 8
pokeZeroCStruct p f = do
poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES)
poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
poke ((p `plusPtr` 16 :: Ptr Bool32)) (boolToBool32 (zero))
f
instance FromCStruct PhysicalDeviceTimelineSemaphoreFeatures where
peekCStruct p = do
timelineSemaphore <- peek @Bool32 ((p `plusPtr` 16 :: Ptr Bool32))
pure $ PhysicalDeviceTimelineSemaphoreFeatures
(bool32ToBool timelineSemaphore)
instance Storable PhysicalDeviceTimelineSemaphoreFeatures where
sizeOf ~_ = 24
alignment ~_ = 8
peek = peekCStruct
poke ptr poked = pokeCStruct ptr poked (pure ())
instance Zero PhysicalDeviceTimelineSemaphoreFeatures where
zero = PhysicalDeviceTimelineSemaphoreFeatures
zero
data PhysicalDeviceTimelineSemaphoreProperties = PhysicalDeviceTimelineSemaphoreProperties
{
maxTimelineSemaphoreValueDifference :: Word64 }
deriving (Typeable)
deriving instance Show PhysicalDeviceTimelineSemaphoreProperties
instance ToCStruct PhysicalDeviceTimelineSemaphoreProperties where
withCStruct x f = allocaBytesAligned 24 8 $ \p -> pokeCStruct p x (f p)
pokeCStruct p PhysicalDeviceTimelineSemaphoreProperties{..} f = do
poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES)
poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
poke ((p `plusPtr` 16 :: Ptr Word64)) (maxTimelineSemaphoreValueDifference)
f
cStructSize = 24
cStructAlignment = 8
pokeZeroCStruct p f = do
poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES)
poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
poke ((p `plusPtr` 16 :: Ptr Word64)) (zero)
f
instance FromCStruct PhysicalDeviceTimelineSemaphoreProperties where
peekCStruct p = do
maxTimelineSemaphoreValueDifference <- peek @Word64 ((p `plusPtr` 16 :: Ptr Word64))
pure $ PhysicalDeviceTimelineSemaphoreProperties
maxTimelineSemaphoreValueDifference
instance Storable PhysicalDeviceTimelineSemaphoreProperties where
sizeOf ~_ = 24
alignment ~_ = 8
peek = peekCStruct
poke ptr poked = pokeCStruct ptr poked (pure ())
instance Zero PhysicalDeviceTimelineSemaphoreProperties where
zero = PhysicalDeviceTimelineSemaphoreProperties
zero
data SemaphoreTypeCreateInfo = SemaphoreTypeCreateInfo
{
semaphoreType :: SemaphoreType
,
initialValue :: Word64
}
deriving (Typeable)
deriving instance Show SemaphoreTypeCreateInfo
instance ToCStruct SemaphoreTypeCreateInfo where
withCStruct x f = allocaBytesAligned 32 8 $ \p -> pokeCStruct p x (f p)
pokeCStruct p SemaphoreTypeCreateInfo{..} f = do
poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO)
poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
poke ((p `plusPtr` 16 :: Ptr SemaphoreType)) (semaphoreType)
poke ((p `plusPtr` 24 :: Ptr Word64)) (initialValue)
f
cStructSize = 32
cStructAlignment = 8
pokeZeroCStruct p f = do
poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO)
poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
poke ((p `plusPtr` 16 :: Ptr SemaphoreType)) (zero)
poke ((p `plusPtr` 24 :: Ptr Word64)) (zero)
f
instance FromCStruct SemaphoreTypeCreateInfo where
peekCStruct p = do
semaphoreType <- peek @SemaphoreType ((p `plusPtr` 16 :: Ptr SemaphoreType))
initialValue <- peek @Word64 ((p `plusPtr` 24 :: Ptr Word64))
pure $ SemaphoreTypeCreateInfo
semaphoreType initialValue
instance Storable SemaphoreTypeCreateInfo where
sizeOf ~_ = 32
alignment ~_ = 8
peek = peekCStruct
poke ptr poked = pokeCStruct ptr poked (pure ())
instance Zero SemaphoreTypeCreateInfo where
zero = SemaphoreTypeCreateInfo
zero
zero
data TimelineSemaphoreSubmitInfo = TimelineSemaphoreSubmitInfo
{
waitSemaphoreValues :: Either Word32 (Vector Word64)
,
signalSemaphoreValues :: Either Word32 (Vector Word64)
}
deriving (Typeable)
deriving instance Show TimelineSemaphoreSubmitInfo
instance ToCStruct TimelineSemaphoreSubmitInfo where
withCStruct x f = allocaBytesAligned 48 8 $ \p -> pokeCStruct p x (f p)
pokeCStruct p TimelineSemaphoreSubmitInfo{..} f = evalContT $ do
lift $ poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO)
lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
lift $ poke ((p `plusPtr` 16 :: Ptr Word32)) ((fromIntegral (either id (fromIntegral . Data.Vector.length) (waitSemaphoreValues)) :: Word32))
pWaitSemaphoreValues'' <- case (waitSemaphoreValues) of
Left _ -> pure nullPtr
Right v -> do
pPWaitSemaphoreValues' <- ContT $ allocaBytesAligned @Word64 ((Data.Vector.length (v)) * 8) 8
lift $ Data.Vector.imapM_ (\i e -> poke (pPWaitSemaphoreValues' `plusPtr` (8 * (i)) :: Ptr Word64) (e)) (v)
pure $ pPWaitSemaphoreValues'
lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr Word64))) pWaitSemaphoreValues''
lift $ poke ((p `plusPtr` 32 :: Ptr Word32)) ((fromIntegral (either id (fromIntegral . Data.Vector.length) (signalSemaphoreValues)) :: Word32))
pSignalSemaphoreValues'' <- case (signalSemaphoreValues) of
Left _ -> pure nullPtr
Right v -> do
pPSignalSemaphoreValues' <- ContT $ allocaBytesAligned @Word64 ((Data.Vector.length (v)) * 8) 8
lift $ Data.Vector.imapM_ (\i e -> poke (pPSignalSemaphoreValues' `plusPtr` (8 * (i)) :: Ptr Word64) (e)) (v)
pure $ pPSignalSemaphoreValues'
lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr Word64))) pSignalSemaphoreValues''
lift $ f
cStructSize = 48
cStructAlignment = 8
pokeZeroCStruct p f = do
poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO)
poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
f
instance FromCStruct TimelineSemaphoreSubmitInfo where
peekCStruct p = do
waitSemaphoreValueCount <- peek @Word32 ((p `plusPtr` 16 :: Ptr Word32))
pWaitSemaphoreValues <- peek @(Ptr Word64) ((p `plusPtr` 24 :: Ptr (Ptr Word64)))
pWaitSemaphoreValues' <- maybePeek (\j -> generateM (fromIntegral waitSemaphoreValueCount) (\i -> peek @Word64 (((j) `advancePtrBytes` (8 * (i)) :: Ptr Word64)))) pWaitSemaphoreValues
let pWaitSemaphoreValues'' = maybe (Left waitSemaphoreValueCount) Right pWaitSemaphoreValues'
signalSemaphoreValueCount <- peek @Word32 ((p `plusPtr` 32 :: Ptr Word32))
pSignalSemaphoreValues <- peek @(Ptr Word64) ((p `plusPtr` 40 :: Ptr (Ptr Word64)))
pSignalSemaphoreValues' <- maybePeek (\j -> generateM (fromIntegral signalSemaphoreValueCount) (\i -> peek @Word64 (((j) `advancePtrBytes` (8 * (i)) :: Ptr Word64)))) pSignalSemaphoreValues
let pSignalSemaphoreValues'' = maybe (Left signalSemaphoreValueCount) Right pSignalSemaphoreValues'
pure $ TimelineSemaphoreSubmitInfo
pWaitSemaphoreValues'' pSignalSemaphoreValues''
instance Zero TimelineSemaphoreSubmitInfo where
zero = TimelineSemaphoreSubmitInfo
(Left 0)
(Left 0)
data SemaphoreWaitInfo = SemaphoreWaitInfo
{
flags :: SemaphoreWaitFlags
,
semaphores :: Vector Semaphore
,
values :: Vector Word64
}
deriving (Typeable)
deriving instance Show SemaphoreWaitInfo
instance ToCStruct SemaphoreWaitInfo where
withCStruct x f = allocaBytesAligned 40 8 $ \p -> pokeCStruct p x (f p)
pokeCStruct p SemaphoreWaitInfo{..} f = evalContT $ do
lift $ poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO)
lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
lift $ poke ((p `plusPtr` 16 :: Ptr SemaphoreWaitFlags)) (flags)
let pSemaphoresLength = Data.Vector.length $ (semaphores)
let pValuesLength = Data.Vector.length $ (values)
lift $ unless (pValuesLength == pSemaphoresLength) $
throwIO $ IOError Nothing InvalidArgument "" "pValues and pSemaphores must have the same length" Nothing Nothing
lift $ poke ((p `plusPtr` 20 :: Ptr Word32)) ((fromIntegral pSemaphoresLength :: Word32))
pPSemaphores' <- ContT $ allocaBytesAligned @Semaphore ((Data.Vector.length (semaphores)) * 8) 8
lift $ Data.Vector.imapM_ (\i e -> poke (pPSemaphores' `plusPtr` (8 * (i)) :: Ptr Semaphore) (e)) (semaphores)
lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr Semaphore))) (pPSemaphores')
pPValues' <- ContT $ allocaBytesAligned @Word64 ((Data.Vector.length (values)) * 8) 8
lift $ Data.Vector.imapM_ (\i e -> poke (pPValues' `plusPtr` (8 * (i)) :: Ptr Word64) (e)) (values)
lift $ poke ((p `plusPtr` 32 :: Ptr (Ptr Word64))) (pPValues')
lift $ f
cStructSize = 40
cStructAlignment = 8
pokeZeroCStruct p f = evalContT $ do
lift $ poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO)
lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
pPSemaphores' <- ContT $ allocaBytesAligned @Semaphore ((Data.Vector.length (mempty)) * 8) 8
lift $ Data.Vector.imapM_ (\i e -> poke (pPSemaphores' `plusPtr` (8 * (i)) :: Ptr Semaphore) (e)) (mempty)
lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr Semaphore))) (pPSemaphores')
pPValues' <- ContT $ allocaBytesAligned @Word64 ((Data.Vector.length (mempty)) * 8) 8
lift $ Data.Vector.imapM_ (\i e -> poke (pPValues' `plusPtr` (8 * (i)) :: Ptr Word64) (e)) (mempty)
lift $ poke ((p `plusPtr` 32 :: Ptr (Ptr Word64))) (pPValues')
lift $ f
instance FromCStruct SemaphoreWaitInfo where
peekCStruct p = do
flags <- peek @SemaphoreWaitFlags ((p `plusPtr` 16 :: Ptr SemaphoreWaitFlags))
semaphoreCount <- peek @Word32 ((p `plusPtr` 20 :: Ptr Word32))
pSemaphores <- peek @(Ptr Semaphore) ((p `plusPtr` 24 :: Ptr (Ptr Semaphore)))
pSemaphores' <- generateM (fromIntegral semaphoreCount) (\i -> peek @Semaphore ((pSemaphores `advancePtrBytes` (8 * (i)) :: Ptr Semaphore)))
pValues <- peek @(Ptr Word64) ((p `plusPtr` 32 :: Ptr (Ptr Word64)))
pValues' <- generateM (fromIntegral semaphoreCount) (\i -> peek @Word64 ((pValues `advancePtrBytes` (8 * (i)) :: Ptr Word64)))
pure $ SemaphoreWaitInfo
flags pSemaphores' pValues'
instance Zero SemaphoreWaitInfo where
zero = SemaphoreWaitInfo
zero
mempty
mempty
data SemaphoreSignalInfo = SemaphoreSignalInfo
{
semaphore :: Semaphore
,
value :: Word64
}
deriving (Typeable)
deriving instance Show SemaphoreSignalInfo
instance ToCStruct SemaphoreSignalInfo where
withCStruct x f = allocaBytesAligned 32 8 $ \p -> pokeCStruct p x (f p)
pokeCStruct p SemaphoreSignalInfo{..} f = do
poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO)
poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
poke ((p `plusPtr` 16 :: Ptr Semaphore)) (semaphore)
poke ((p `plusPtr` 24 :: Ptr Word64)) (value)
f
cStructSize = 32
cStructAlignment = 8
pokeZeroCStruct p f = do
poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO)
poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
poke ((p `plusPtr` 16 :: Ptr Semaphore)) (zero)
poke ((p `plusPtr` 24 :: Ptr Word64)) (zero)
f
instance FromCStruct SemaphoreSignalInfo where
peekCStruct p = do
semaphore <- peek @Semaphore ((p `plusPtr` 16 :: Ptr Semaphore))
value <- peek @Word64 ((p `plusPtr` 24 :: Ptr Word64))
pure $ SemaphoreSignalInfo
semaphore value
instance Storable SemaphoreSignalInfo where
sizeOf ~_ = 32
alignment ~_ = 8
peek = peekCStruct
poke ptr poked = pokeCStruct ptr poked (pure ())
instance Zero SemaphoreSignalInfo where
zero = SemaphoreSignalInfo
zero
zero