{-# language CPP #-}
module Vulkan.Core11.Promoted_From_VK_KHR_external_fence_capabilities ( getPhysicalDeviceExternalFenceProperties
, PhysicalDeviceExternalFenceInfo(..)
, ExternalFenceProperties(..)
, StructureType(..)
, ExternalFenceHandleTypeFlagBits(..)
, ExternalFenceHandleTypeFlags
, ExternalFenceFeatureFlagBits(..)
, ExternalFenceFeatureFlags
) where
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytes)
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 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.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.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.Core11.Enums.ExternalFenceFeatureFlagBits (ExternalFenceFeatureFlags)
import Vulkan.Core11.Enums.ExternalFenceHandleTypeFlagBits (ExternalFenceHandleTypeFlagBits)
import Vulkan.Core11.Enums.ExternalFenceHandleTypeFlagBits (ExternalFenceHandleTypeFlags)
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceExternalFenceProperties))
import Vulkan.Core10.Handles (PhysicalDevice)
import Vulkan.Core10.Handles (PhysicalDevice(..))
import Vulkan.Core10.Handles (PhysicalDevice(PhysicalDevice))
import Vulkan.Core10.Handles (PhysicalDevice_T)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO))
import Vulkan.Core11.Enums.ExternalFenceFeatureFlagBits (ExternalFenceFeatureFlagBits(..))
import Vulkan.Core11.Enums.ExternalFenceFeatureFlagBits (ExternalFenceFeatureFlags)
import Vulkan.Core11.Enums.ExternalFenceHandleTypeFlagBits (ExternalFenceHandleTypeFlagBits(..))
import Vulkan.Core11.Enums.ExternalFenceHandleTypeFlagBits (ExternalFenceHandleTypeFlags)
import Vulkan.Core10.Enums.StructureType (StructureType(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetPhysicalDeviceExternalFenceProperties
:: FunPtr (Ptr PhysicalDevice_T -> Ptr PhysicalDeviceExternalFenceInfo -> Ptr ExternalFenceProperties -> IO ()) -> Ptr PhysicalDevice_T -> Ptr PhysicalDeviceExternalFenceInfo -> Ptr ExternalFenceProperties -> IO ()
getPhysicalDeviceExternalFenceProperties :: forall io
. (MonadIO io)
=>
PhysicalDevice
->
PhysicalDeviceExternalFenceInfo
-> io (ExternalFenceProperties)
getPhysicalDeviceExternalFenceProperties :: forall (io :: * -> *).
MonadIO io =>
PhysicalDevice
-> PhysicalDeviceExternalFenceInfo -> io ExternalFenceProperties
getPhysicalDeviceExternalFenceProperties PhysicalDevice
physicalDevice
PhysicalDeviceExternalFenceInfo
externalFenceInfo = 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 vkGetPhysicalDeviceExternalFencePropertiesPtr :: FunPtr
(Ptr PhysicalDevice_T
-> ("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo)
-> ("pExternalFenceProperties" ::: Ptr ExternalFenceProperties)
-> IO ())
vkGetPhysicalDeviceExternalFencePropertiesPtr = InstanceCmds
-> FunPtr
(Ptr PhysicalDevice_T
-> ("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo)
-> ("pExternalFenceProperties" ::: Ptr ExternalFenceProperties)
-> IO ())
pVkGetPhysicalDeviceExternalFenceProperties (case PhysicalDevice
physicalDevice of PhysicalDevice{InstanceCmds
$sel:instanceCmds:PhysicalDevice :: PhysicalDevice -> InstanceCmds
instanceCmds :: InstanceCmds
instanceCmds} -> InstanceCmds
instanceCmds)
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 PhysicalDevice_T
-> ("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo)
-> ("pExternalFenceProperties" ::: Ptr ExternalFenceProperties)
-> IO ())
vkGetPhysicalDeviceExternalFencePropertiesPtr 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 vkGetPhysicalDeviceExternalFenceProperties is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkGetPhysicalDeviceExternalFenceProperties' :: Ptr PhysicalDevice_T
-> ("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo)
-> ("pExternalFenceProperties" ::: Ptr ExternalFenceProperties)
-> IO ()
vkGetPhysicalDeviceExternalFenceProperties' = FunPtr
(Ptr PhysicalDevice_T
-> ("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo)
-> ("pExternalFenceProperties" ::: Ptr ExternalFenceProperties)
-> IO ())
-> Ptr PhysicalDevice_T
-> ("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo)
-> ("pExternalFenceProperties" ::: Ptr ExternalFenceProperties)
-> IO ()
mkVkGetPhysicalDeviceExternalFenceProperties FunPtr
(Ptr PhysicalDevice_T
-> ("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo)
-> ("pExternalFenceProperties" ::: Ptr ExternalFenceProperties)
-> IO ())
vkGetPhysicalDeviceExternalFencePropertiesPtr
"pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo
pExternalFenceInfo <- 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 => a -> (Ptr a -> IO b) -> IO b
withCStruct (PhysicalDeviceExternalFenceInfo
externalFenceInfo)
"pExternalFenceProperties" ::: Ptr ExternalFenceProperties
pPExternalFenceProperties <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @ExternalFenceProperties)
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
"vkGetPhysicalDeviceExternalFenceProperties" (Ptr PhysicalDevice_T
-> ("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo)
-> ("pExternalFenceProperties" ::: Ptr ExternalFenceProperties)
-> IO ()
vkGetPhysicalDeviceExternalFenceProperties'
(PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice))
"pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo
pExternalFenceInfo
("pExternalFenceProperties" ::: Ptr ExternalFenceProperties
pPExternalFenceProperties))
ExternalFenceProperties
pExternalFenceProperties <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ExternalFenceProperties "pExternalFenceProperties" ::: Ptr ExternalFenceProperties
pPExternalFenceProperties
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (ExternalFenceProperties
pExternalFenceProperties)
data PhysicalDeviceExternalFenceInfo = PhysicalDeviceExternalFenceInfo
{
PhysicalDeviceExternalFenceInfo -> ExternalFenceHandleTypeFlagBits
handleType :: ExternalFenceHandleTypeFlagBits }
deriving (Typeable, PhysicalDeviceExternalFenceInfo
-> PhysicalDeviceExternalFenceInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceExternalFenceInfo
-> PhysicalDeviceExternalFenceInfo -> Bool
$c/= :: PhysicalDeviceExternalFenceInfo
-> PhysicalDeviceExternalFenceInfo -> Bool
== :: PhysicalDeviceExternalFenceInfo
-> PhysicalDeviceExternalFenceInfo -> Bool
$c== :: PhysicalDeviceExternalFenceInfo
-> PhysicalDeviceExternalFenceInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceExternalFenceInfo)
#endif
deriving instance Show PhysicalDeviceExternalFenceInfo
instance ToCStruct PhysicalDeviceExternalFenceInfo where
withCStruct :: forall b.
PhysicalDeviceExternalFenceInfo
-> (("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo)
-> IO b)
-> IO b
withCStruct PhysicalDeviceExternalFenceInfo
x ("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo)
-> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \"pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo
p PhysicalDeviceExternalFenceInfo
x (("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo)
-> IO b
f "pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo
p)
pokeCStruct :: forall b.
("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo)
-> PhysicalDeviceExternalFenceInfo -> IO b -> IO b
pokeCStruct "pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo
p PhysicalDeviceExternalFenceInfo{ExternalFenceHandleTypeFlagBits
handleType :: ExternalFenceHandleTypeFlagBits
$sel:handleType:PhysicalDeviceExternalFenceInfo :: PhysicalDeviceExternalFenceInfo -> ExternalFenceHandleTypeFlagBits
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo
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 (("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ExternalFenceHandleTypeFlagBits)) (ExternalFenceHandleTypeFlagBits
handleType)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo)
-> IO b -> IO b
pokeZeroCStruct "pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo
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 (("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ExternalFenceHandleTypeFlagBits)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct PhysicalDeviceExternalFenceInfo where
peekCStruct :: ("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo)
-> IO PhysicalDeviceExternalFenceInfo
peekCStruct "pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo
p = do
ExternalFenceHandleTypeFlagBits
handleType <- forall a. Storable a => Ptr a -> IO a
peek @ExternalFenceHandleTypeFlagBits (("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ExternalFenceHandleTypeFlagBits))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ExternalFenceHandleTypeFlagBits -> PhysicalDeviceExternalFenceInfo
PhysicalDeviceExternalFenceInfo
ExternalFenceHandleTypeFlagBits
handleType
instance Storable PhysicalDeviceExternalFenceInfo where
sizeOf :: PhysicalDeviceExternalFenceInfo -> Int
sizeOf ~PhysicalDeviceExternalFenceInfo
_ = Int
24
alignment :: PhysicalDeviceExternalFenceInfo -> Int
alignment ~PhysicalDeviceExternalFenceInfo
_ = Int
8
peek :: ("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo)
-> IO PhysicalDeviceExternalFenceInfo
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo)
-> PhysicalDeviceExternalFenceInfo -> IO ()
poke "pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo
ptr PhysicalDeviceExternalFenceInfo
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pExternalFenceInfo" ::: Ptr PhysicalDeviceExternalFenceInfo
ptr PhysicalDeviceExternalFenceInfo
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceExternalFenceInfo where
zero :: PhysicalDeviceExternalFenceInfo
zero = ExternalFenceHandleTypeFlagBits -> PhysicalDeviceExternalFenceInfo
PhysicalDeviceExternalFenceInfo
forall a. Zero a => a
zero
data ExternalFenceProperties = ExternalFenceProperties
{
ExternalFenceProperties -> ExternalFenceHandleTypeFlagBits
exportFromImportedHandleTypes :: ExternalFenceHandleTypeFlags
,
ExternalFenceProperties -> ExternalFenceHandleTypeFlagBits
compatibleHandleTypes :: ExternalFenceHandleTypeFlags
,
ExternalFenceProperties -> ExternalFenceFeatureFlags
externalFenceFeatures :: ExternalFenceFeatureFlags
}
deriving (Typeable, ExternalFenceProperties -> ExternalFenceProperties -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExternalFenceProperties -> ExternalFenceProperties -> Bool
$c/= :: ExternalFenceProperties -> ExternalFenceProperties -> Bool
== :: ExternalFenceProperties -> ExternalFenceProperties -> Bool
$c== :: ExternalFenceProperties -> ExternalFenceProperties -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ExternalFenceProperties)
#endif
deriving instance Show ExternalFenceProperties
instance ToCStruct ExternalFenceProperties where
withCStruct :: forall b.
ExternalFenceProperties
-> (("pExternalFenceProperties" ::: Ptr ExternalFenceProperties)
-> IO b)
-> IO b
withCStruct ExternalFenceProperties
x ("pExternalFenceProperties" ::: Ptr ExternalFenceProperties)
-> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \"pExternalFenceProperties" ::: Ptr ExternalFenceProperties
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pExternalFenceProperties" ::: Ptr ExternalFenceProperties
p ExternalFenceProperties
x (("pExternalFenceProperties" ::: Ptr ExternalFenceProperties)
-> IO b
f "pExternalFenceProperties" ::: Ptr ExternalFenceProperties
p)
pokeCStruct :: forall b.
("pExternalFenceProperties" ::: Ptr ExternalFenceProperties)
-> ExternalFenceProperties -> IO b -> IO b
pokeCStruct "pExternalFenceProperties" ::: Ptr ExternalFenceProperties
p ExternalFenceProperties{ExternalFenceHandleTypeFlagBits
ExternalFenceFeatureFlags
externalFenceFeatures :: ExternalFenceFeatureFlags
compatibleHandleTypes :: ExternalFenceHandleTypeFlagBits
exportFromImportedHandleTypes :: ExternalFenceHandleTypeFlagBits
$sel:externalFenceFeatures:ExternalFenceProperties :: ExternalFenceProperties -> ExternalFenceFeatureFlags
$sel:compatibleHandleTypes:ExternalFenceProperties :: ExternalFenceProperties -> ExternalFenceHandleTypeFlagBits
$sel:exportFromImportedHandleTypes:ExternalFenceProperties :: ExternalFenceProperties -> ExternalFenceHandleTypeFlagBits
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalFenceProperties" ::: Ptr ExternalFenceProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalFenceProperties" ::: Ptr ExternalFenceProperties
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 (("pExternalFenceProperties" ::: Ptr ExternalFenceProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ExternalFenceHandleTypeFlags)) (ExternalFenceHandleTypeFlagBits
exportFromImportedHandleTypes)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalFenceProperties" ::: Ptr ExternalFenceProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr ExternalFenceHandleTypeFlags)) (ExternalFenceHandleTypeFlagBits
compatibleHandleTypes)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalFenceProperties" ::: Ptr ExternalFenceProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ExternalFenceFeatureFlags)) (ExternalFenceFeatureFlags
externalFenceFeatures)
IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
("pExternalFenceProperties" ::: Ptr ExternalFenceProperties)
-> IO b -> IO b
pokeZeroCStruct "pExternalFenceProperties" ::: Ptr ExternalFenceProperties
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalFenceProperties" ::: Ptr ExternalFenceProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalFenceProperties" ::: Ptr ExternalFenceProperties
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 (("pExternalFenceProperties" ::: Ptr ExternalFenceProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ExternalFenceHandleTypeFlags)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalFenceProperties" ::: Ptr ExternalFenceProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr ExternalFenceHandleTypeFlags)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ExternalFenceProperties where
peekCStruct :: ("pExternalFenceProperties" ::: Ptr ExternalFenceProperties)
-> IO ExternalFenceProperties
peekCStruct "pExternalFenceProperties" ::: Ptr ExternalFenceProperties
p = do
ExternalFenceHandleTypeFlagBits
exportFromImportedHandleTypes <- forall a. Storable a => Ptr a -> IO a
peek @ExternalFenceHandleTypeFlags (("pExternalFenceProperties" ::: Ptr ExternalFenceProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ExternalFenceHandleTypeFlags))
ExternalFenceHandleTypeFlagBits
compatibleHandleTypes <- forall a. Storable a => Ptr a -> IO a
peek @ExternalFenceHandleTypeFlags (("pExternalFenceProperties" ::: Ptr ExternalFenceProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr ExternalFenceHandleTypeFlags))
ExternalFenceFeatureFlags
externalFenceFeatures <- forall a. Storable a => Ptr a -> IO a
peek @ExternalFenceFeatureFlags (("pExternalFenceProperties" ::: Ptr ExternalFenceProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ExternalFenceFeatureFlags))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ExternalFenceHandleTypeFlagBits
-> ExternalFenceHandleTypeFlagBits
-> ExternalFenceFeatureFlags
-> ExternalFenceProperties
ExternalFenceProperties
ExternalFenceHandleTypeFlagBits
exportFromImportedHandleTypes
ExternalFenceHandleTypeFlagBits
compatibleHandleTypes
ExternalFenceFeatureFlags
externalFenceFeatures
instance Storable ExternalFenceProperties where
sizeOf :: ExternalFenceProperties -> Int
sizeOf ~ExternalFenceProperties
_ = Int
32
alignment :: ExternalFenceProperties -> Int
alignment ~ExternalFenceProperties
_ = Int
8
peek :: ("pExternalFenceProperties" ::: Ptr ExternalFenceProperties)
-> IO ExternalFenceProperties
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pExternalFenceProperties" ::: Ptr ExternalFenceProperties)
-> ExternalFenceProperties -> IO ()
poke "pExternalFenceProperties" ::: Ptr ExternalFenceProperties
ptr ExternalFenceProperties
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pExternalFenceProperties" ::: Ptr ExternalFenceProperties
ptr ExternalFenceProperties
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ExternalFenceProperties where
zero :: ExternalFenceProperties
zero = ExternalFenceHandleTypeFlagBits
-> ExternalFenceHandleTypeFlagBits
-> ExternalFenceFeatureFlags
-> ExternalFenceProperties
ExternalFenceProperties
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero