{-# language CPP #-}
module Vulkan.Extensions.VK_FUCHSIA_external_semaphore ( getSemaphoreZirconHandleFUCHSIA
, importSemaphoreZirconHandleFUCHSIA
, ImportSemaphoreZirconHandleInfoFUCHSIA(..)
, SemaphoreGetZirconHandleInfoFUCHSIA(..)
, FUCHSIA_EXTERNAL_SEMAPHORE_SPEC_VERSION
, pattern FUCHSIA_EXTERNAL_SEMAPHORE_SPEC_VERSION
, FUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME
, pattern FUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME
, Zx_handle_t
) 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.Base (when)
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.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.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.NamedType ((:::))
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkGetSemaphoreZirconHandleFUCHSIA))
import Vulkan.Dynamic (DeviceCmds(pVkImportSemaphoreZirconHandleFUCHSIA))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.Core11.Enums.ExternalSemaphoreHandleTypeFlagBits (ExternalSemaphoreHandleTypeFlagBits)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Handles (Semaphore)
import Vulkan.Core11.Enums.SemaphoreImportFlagBits (SemaphoreImportFlags)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Extensions.VK_FUCHSIA_imagepipe_surface (Zx_handle_t)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.VK_FUCHSIA_imagepipe_surface (Zx_handle_t)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetSemaphoreZirconHandleFUCHSIA
:: FunPtr (Ptr Device_T -> Ptr SemaphoreGetZirconHandleInfoFUCHSIA -> Ptr Zx_handle_t -> IO Result) -> Ptr Device_T -> Ptr SemaphoreGetZirconHandleInfoFUCHSIA -> Ptr Zx_handle_t -> IO Result
getSemaphoreZirconHandleFUCHSIA :: forall io
. (MonadIO io)
=>
Device
->
SemaphoreGetZirconHandleInfoFUCHSIA
-> io (("zirconHandle" ::: Zx_handle_t))
getSemaphoreZirconHandleFUCHSIA :: forall (io :: * -> *).
MonadIO io =>
Device
-> SemaphoreGetZirconHandleInfoFUCHSIA
-> io ("zirconHandle" ::: Zx_handle_t)
getSemaphoreZirconHandleFUCHSIA Device
device
SemaphoreGetZirconHandleInfoFUCHSIA
getZirconHandleInfo = 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 vkGetSemaphoreZirconHandleFUCHSIAPtr :: FunPtr
(Ptr Device_T
-> ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> ("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO Result)
vkGetSemaphoreZirconHandleFUCHSIAPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> ("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO Result)
pVkGetSemaphoreZirconHandleFUCHSIA (case Device
device of Device{DeviceCmds
$sel:deviceCmds:Device :: Device -> 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 Device_T
-> ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> ("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO Result)
vkGetSemaphoreZirconHandleFUCHSIAPtr 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 vkGetSemaphoreZirconHandleFUCHSIA is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkGetSemaphoreZirconHandleFUCHSIA' :: Ptr Device_T
-> ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> ("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO Result
vkGetSemaphoreZirconHandleFUCHSIA' = FunPtr
(Ptr Device_T
-> ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> ("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO Result)
-> Ptr Device_T
-> ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> ("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO Result
mkVkGetSemaphoreZirconHandleFUCHSIA FunPtr
(Ptr Device_T
-> ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> ("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO Result)
vkGetSemaphoreZirconHandleFUCHSIAPtr
"pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
pGetZirconHandleInfo <- 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 (SemaphoreGetZirconHandleInfoFUCHSIA
getZirconHandleInfo)
"pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t)
pPZirconHandle <- 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 @Zx_handle_t Int
4) forall a. Ptr a -> IO ()
free
Result
r <- 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
"vkGetSemaphoreZirconHandleFUCHSIA" (Ptr Device_T
-> ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> ("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO Result
vkGetSemaphoreZirconHandleFUCHSIA'
(Device -> Ptr Device_T
deviceHandle (Device
device))
"pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
pGetZirconHandleInfo
("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t)
pPZirconHandle))
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 ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
"zirconHandle" ::: Zx_handle_t
pZirconHandle <- 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 @Zx_handle_t "pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t)
pPZirconHandle
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("zirconHandle" ::: Zx_handle_t
pZirconHandle)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkImportSemaphoreZirconHandleFUCHSIA
:: FunPtr (Ptr Device_T -> Ptr ImportSemaphoreZirconHandleInfoFUCHSIA -> IO Result) -> Ptr Device_T -> Ptr ImportSemaphoreZirconHandleInfoFUCHSIA -> IO Result
importSemaphoreZirconHandleFUCHSIA :: forall io
. (MonadIO io)
=>
Device
->
ImportSemaphoreZirconHandleInfoFUCHSIA
-> io ()
importSemaphoreZirconHandleFUCHSIA :: forall (io :: * -> *).
MonadIO io =>
Device -> ImportSemaphoreZirconHandleInfoFUCHSIA -> io ()
importSemaphoreZirconHandleFUCHSIA Device
device
ImportSemaphoreZirconHandleInfoFUCHSIA
importSemaphoreZirconHandleInfo = 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 vkImportSemaphoreZirconHandleFUCHSIAPtr :: FunPtr
(Ptr Device_T
-> ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO Result)
vkImportSemaphoreZirconHandleFUCHSIAPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO Result)
pVkImportSemaphoreZirconHandleFUCHSIA (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> 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 Device_T
-> ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO Result)
vkImportSemaphoreZirconHandleFUCHSIAPtr 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 vkImportSemaphoreZirconHandleFUCHSIA is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkImportSemaphoreZirconHandleFUCHSIA' :: Ptr Device_T
-> ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO Result
vkImportSemaphoreZirconHandleFUCHSIA' = FunPtr
(Ptr Device_T
-> ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO Result)
-> Ptr Device_T
-> ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO Result
mkVkImportSemaphoreZirconHandleFUCHSIA FunPtr
(Ptr Device_T
-> ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO Result)
vkImportSemaphoreZirconHandleFUCHSIAPtr
"pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
pImportSemaphoreZirconHandleInfo <- 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 (ImportSemaphoreZirconHandleInfoFUCHSIA
importSemaphoreZirconHandleInfo)
Result
r <- 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
"vkImportSemaphoreZirconHandleFUCHSIA" (Ptr Device_T
-> ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO Result
vkImportSemaphoreZirconHandleFUCHSIA'
(Device -> Ptr Device_T
deviceHandle (Device
device))
"pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
pImportSemaphoreZirconHandleInfo)
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 ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
data ImportSemaphoreZirconHandleInfoFUCHSIA = ImportSemaphoreZirconHandleInfoFUCHSIA
{
ImportSemaphoreZirconHandleInfoFUCHSIA -> Semaphore
semaphore :: Semaphore
,
ImportSemaphoreZirconHandleInfoFUCHSIA -> SemaphoreImportFlags
flags :: SemaphoreImportFlags
,
ImportSemaphoreZirconHandleInfoFUCHSIA
-> ExternalSemaphoreHandleTypeFlagBits
handleType :: ExternalSemaphoreHandleTypeFlagBits
,
ImportSemaphoreZirconHandleInfoFUCHSIA
-> "zirconHandle" ::: Zx_handle_t
zirconHandle :: Zx_handle_t
}
deriving (Typeable, ImportSemaphoreZirconHandleInfoFUCHSIA
-> ImportSemaphoreZirconHandleInfoFUCHSIA -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportSemaphoreZirconHandleInfoFUCHSIA
-> ImportSemaphoreZirconHandleInfoFUCHSIA -> Bool
$c/= :: ImportSemaphoreZirconHandleInfoFUCHSIA
-> ImportSemaphoreZirconHandleInfoFUCHSIA -> Bool
== :: ImportSemaphoreZirconHandleInfoFUCHSIA
-> ImportSemaphoreZirconHandleInfoFUCHSIA -> Bool
$c== :: ImportSemaphoreZirconHandleInfoFUCHSIA
-> ImportSemaphoreZirconHandleInfoFUCHSIA -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImportSemaphoreZirconHandleInfoFUCHSIA)
#endif
deriving instance Show ImportSemaphoreZirconHandleInfoFUCHSIA
instance ToCStruct ImportSemaphoreZirconHandleInfoFUCHSIA where
withCStruct :: forall b.
ImportSemaphoreZirconHandleInfoFUCHSIA
-> (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO b)
-> IO b
withCStruct ImportSemaphoreZirconHandleInfoFUCHSIA
x ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 forall a b. (a -> b) -> a -> b
$ \"pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p ImportSemaphoreZirconHandleInfoFUCHSIA
x (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO b
f "pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p)
pokeCStruct :: forall b.
("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> ImportSemaphoreZirconHandleInfoFUCHSIA -> IO b -> IO b
pokeCStruct "pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p ImportSemaphoreZirconHandleInfoFUCHSIA{"zirconHandle" ::: Zx_handle_t
Semaphore
SemaphoreImportFlags
ExternalSemaphoreHandleTypeFlagBits
zirconHandle :: "zirconHandle" ::: Zx_handle_t
handleType :: ExternalSemaphoreHandleTypeFlagBits
flags :: SemaphoreImportFlags
semaphore :: Semaphore
$sel:zirconHandle:ImportSemaphoreZirconHandleInfoFUCHSIA :: ImportSemaphoreZirconHandleInfoFUCHSIA
-> "zirconHandle" ::: Zx_handle_t
$sel:handleType:ImportSemaphoreZirconHandleInfoFUCHSIA :: ImportSemaphoreZirconHandleInfoFUCHSIA
-> ExternalSemaphoreHandleTypeFlagBits
$sel:flags:ImportSemaphoreZirconHandleInfoFUCHSIA :: ImportSemaphoreZirconHandleInfoFUCHSIA -> SemaphoreImportFlags
$sel:semaphore:ImportSemaphoreZirconHandleInfoFUCHSIA :: ImportSemaphoreZirconHandleInfoFUCHSIA -> Semaphore
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
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 (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Semaphore)) (Semaphore
semaphore)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr SemaphoreImportFlags)) (SemaphoreImportFlags
flags)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr ExternalSemaphoreHandleTypeFlagBits)) (ExternalSemaphoreHandleTypeFlagBits
handleType)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Zx_handle_t)) ("zirconHandle" ::: Zx_handle_t
zirconHandle)
IO b
f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO b -> IO b
pokeZeroCStruct "pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
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 (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Semaphore)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr ExternalSemaphoreHandleTypeFlagBits)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Zx_handle_t)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ImportSemaphoreZirconHandleInfoFUCHSIA where
peekCStruct :: ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO ImportSemaphoreZirconHandleInfoFUCHSIA
peekCStruct "pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p = do
Semaphore
semaphore <- forall a. Storable a => Ptr a -> IO a
peek @Semaphore (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Semaphore))
SemaphoreImportFlags
flags <- forall a. Storable a => Ptr a -> IO a
peek @SemaphoreImportFlags (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr SemaphoreImportFlags))
ExternalSemaphoreHandleTypeFlagBits
handleType <- forall a. Storable a => Ptr a -> IO a
peek @ExternalSemaphoreHandleTypeFlagBits (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr ExternalSemaphoreHandleTypeFlagBits))
"zirconHandle" ::: Zx_handle_t
zirconHandle <- forall a. Storable a => Ptr a -> IO a
peek @Zx_handle_t (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Zx_handle_t))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Semaphore
-> SemaphoreImportFlags
-> ExternalSemaphoreHandleTypeFlagBits
-> ("zirconHandle" ::: Zx_handle_t)
-> ImportSemaphoreZirconHandleInfoFUCHSIA
ImportSemaphoreZirconHandleInfoFUCHSIA
Semaphore
semaphore SemaphoreImportFlags
flags ExternalSemaphoreHandleTypeFlagBits
handleType "zirconHandle" ::: Zx_handle_t
zirconHandle
instance Storable ImportSemaphoreZirconHandleInfoFUCHSIA where
sizeOf :: ImportSemaphoreZirconHandleInfoFUCHSIA -> Int
sizeOf ~ImportSemaphoreZirconHandleInfoFUCHSIA
_ = Int
40
alignment :: ImportSemaphoreZirconHandleInfoFUCHSIA -> Int
alignment ~ImportSemaphoreZirconHandleInfoFUCHSIA
_ = Int
8
peek :: ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO ImportSemaphoreZirconHandleInfoFUCHSIA
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> ImportSemaphoreZirconHandleInfoFUCHSIA -> IO ()
poke "pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
ptr ImportSemaphoreZirconHandleInfoFUCHSIA
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
ptr ImportSemaphoreZirconHandleInfoFUCHSIA
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ImportSemaphoreZirconHandleInfoFUCHSIA where
zero :: ImportSemaphoreZirconHandleInfoFUCHSIA
zero = Semaphore
-> SemaphoreImportFlags
-> ExternalSemaphoreHandleTypeFlagBits
-> ("zirconHandle" ::: Zx_handle_t)
-> ImportSemaphoreZirconHandleInfoFUCHSIA
ImportSemaphoreZirconHandleInfoFUCHSIA
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data SemaphoreGetZirconHandleInfoFUCHSIA = SemaphoreGetZirconHandleInfoFUCHSIA
{
SemaphoreGetZirconHandleInfoFUCHSIA -> Semaphore
semaphore :: Semaphore
,
SemaphoreGetZirconHandleInfoFUCHSIA
-> ExternalSemaphoreHandleTypeFlagBits
handleType :: ExternalSemaphoreHandleTypeFlagBits
}
deriving (Typeable, SemaphoreGetZirconHandleInfoFUCHSIA
-> SemaphoreGetZirconHandleInfoFUCHSIA -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SemaphoreGetZirconHandleInfoFUCHSIA
-> SemaphoreGetZirconHandleInfoFUCHSIA -> Bool
$c/= :: SemaphoreGetZirconHandleInfoFUCHSIA
-> SemaphoreGetZirconHandleInfoFUCHSIA -> Bool
== :: SemaphoreGetZirconHandleInfoFUCHSIA
-> SemaphoreGetZirconHandleInfoFUCHSIA -> Bool
$c== :: SemaphoreGetZirconHandleInfoFUCHSIA
-> SemaphoreGetZirconHandleInfoFUCHSIA -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SemaphoreGetZirconHandleInfoFUCHSIA)
#endif
deriving instance Show SemaphoreGetZirconHandleInfoFUCHSIA
instance ToCStruct SemaphoreGetZirconHandleInfoFUCHSIA where
withCStruct :: forall b.
SemaphoreGetZirconHandleInfoFUCHSIA
-> (("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> IO b)
-> IO b
withCStruct SemaphoreGetZirconHandleInfoFUCHSIA
x ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \"pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p SemaphoreGetZirconHandleInfoFUCHSIA
x (("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> IO b
f "pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p)
pokeCStruct :: forall b.
("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> SemaphoreGetZirconHandleInfoFUCHSIA -> IO b -> IO b
pokeCStruct "pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p SemaphoreGetZirconHandleInfoFUCHSIA{Semaphore
ExternalSemaphoreHandleTypeFlagBits
handleType :: ExternalSemaphoreHandleTypeFlagBits
semaphore :: Semaphore
$sel:handleType:SemaphoreGetZirconHandleInfoFUCHSIA :: SemaphoreGetZirconHandleInfoFUCHSIA
-> ExternalSemaphoreHandleTypeFlagBits
$sel:semaphore:SemaphoreGetZirconHandleInfoFUCHSIA :: SemaphoreGetZirconHandleInfoFUCHSIA -> Semaphore
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
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 (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Semaphore)) (Semaphore
semaphore)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ExternalSemaphoreHandleTypeFlagBits)) (ExternalSemaphoreHandleTypeFlagBits
handleType)
IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> IO b -> IO b
pokeZeroCStruct "pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
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 (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Semaphore)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ExternalSemaphoreHandleTypeFlagBits)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct SemaphoreGetZirconHandleInfoFUCHSIA where
peekCStruct :: ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> IO SemaphoreGetZirconHandleInfoFUCHSIA
peekCStruct "pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p = do
Semaphore
semaphore <- forall a. Storable a => Ptr a -> IO a
peek @Semaphore (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Semaphore))
ExternalSemaphoreHandleTypeFlagBits
handleType <- forall a. Storable a => Ptr a -> IO a
peek @ExternalSemaphoreHandleTypeFlagBits (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ExternalSemaphoreHandleTypeFlagBits))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Semaphore
-> ExternalSemaphoreHandleTypeFlagBits
-> SemaphoreGetZirconHandleInfoFUCHSIA
SemaphoreGetZirconHandleInfoFUCHSIA
Semaphore
semaphore ExternalSemaphoreHandleTypeFlagBits
handleType
instance Storable SemaphoreGetZirconHandleInfoFUCHSIA where
sizeOf :: SemaphoreGetZirconHandleInfoFUCHSIA -> Int
sizeOf ~SemaphoreGetZirconHandleInfoFUCHSIA
_ = Int
32
alignment :: SemaphoreGetZirconHandleInfoFUCHSIA -> Int
alignment ~SemaphoreGetZirconHandleInfoFUCHSIA
_ = Int
8
peek :: ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> IO SemaphoreGetZirconHandleInfoFUCHSIA
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> SemaphoreGetZirconHandleInfoFUCHSIA -> IO ()
poke "pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
ptr SemaphoreGetZirconHandleInfoFUCHSIA
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
ptr SemaphoreGetZirconHandleInfoFUCHSIA
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero SemaphoreGetZirconHandleInfoFUCHSIA where
zero :: SemaphoreGetZirconHandleInfoFUCHSIA
zero = Semaphore
-> ExternalSemaphoreHandleTypeFlagBits
-> SemaphoreGetZirconHandleInfoFUCHSIA
SemaphoreGetZirconHandleInfoFUCHSIA
forall a. Zero a => a
zero
forall a. Zero a => a
zero
type FUCHSIA_EXTERNAL_SEMAPHORE_SPEC_VERSION = 1
pattern FUCHSIA_EXTERNAL_SEMAPHORE_SPEC_VERSION :: forall a . Integral a => a
pattern $bFUCHSIA_EXTERNAL_SEMAPHORE_SPEC_VERSION :: forall a. Integral a => a
$mFUCHSIA_EXTERNAL_SEMAPHORE_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
FUCHSIA_EXTERNAL_SEMAPHORE_SPEC_VERSION = 1
type FUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME = "VK_FUCHSIA_external_semaphore"
pattern FUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bFUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mFUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
FUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME = "VK_FUCHSIA_external_semaphore"