{-# 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 :: Device
-> SemaphoreGetZirconHandleInfoFUCHSIA
-> io ("zirconHandle" ::: Zx_handle_t)
getSemaphoreZirconHandleFUCHSIA Device
device SemaphoreGetZirconHandleInfoFUCHSIA
getZirconHandleInfo = IO ("zirconHandle" ::: Zx_handle_t)
-> io ("zirconHandle" ::: Zx_handle_t)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ("zirconHandle" ::: Zx_handle_t)
-> io ("zirconHandle" ::: Zx_handle_t))
-> (ContT
("zirconHandle" ::: Zx_handle_t)
IO
("zirconHandle" ::: Zx_handle_t)
-> IO ("zirconHandle" ::: Zx_handle_t))
-> ContT
("zirconHandle" ::: Zx_handle_t)
IO
("zirconHandle" ::: Zx_handle_t)
-> io ("zirconHandle" ::: Zx_handle_t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
("zirconHandle" ::: Zx_handle_t)
IO
("zirconHandle" ::: Zx_handle_t)
-> IO ("zirconHandle" ::: Zx_handle_t)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
("zirconHandle" ::: Zx_handle_t)
IO
("zirconHandle" ::: Zx_handle_t)
-> io ("zirconHandle" ::: Zx_handle_t))
-> ContT
("zirconHandle" ::: Zx_handle_t)
IO
("zirconHandle" ::: Zx_handle_t)
-> io ("zirconHandle" ::: Zx_handle_t)
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)
IO () -> ContT ("zirconHandle" ::: Zx_handle_t) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("zirconHandle" ::: Zx_handle_t) IO ())
-> IO () -> ContT ("zirconHandle" ::: Zx_handle_t) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> ("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO Result)
vkGetSemaphoreZirconHandleFUCHSIAPtr FunPtr
(Ptr Device_T
-> ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> ("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO Result)
-> FunPtr
(Ptr Device_T
-> ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> ("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> ("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO Result)
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 String
"" String
"The function pointer for vkGetSemaphoreZirconHandleFUCHSIA is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
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 <- ((("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> IO ("zirconHandle" ::: Zx_handle_t))
-> IO ("zirconHandle" ::: Zx_handle_t))
-> ContT
("zirconHandle" ::: Zx_handle_t)
IO
("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> IO ("zirconHandle" ::: Zx_handle_t))
-> IO ("zirconHandle" ::: Zx_handle_t))
-> ContT
("zirconHandle" ::: Zx_handle_t)
IO
("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA))
-> ((("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> IO ("zirconHandle" ::: Zx_handle_t))
-> IO ("zirconHandle" ::: Zx_handle_t))
-> ContT
("zirconHandle" ::: Zx_handle_t)
IO
("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
forall a b. (a -> b) -> a -> b
$ SemaphoreGetZirconHandleInfoFUCHSIA
-> (("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> IO ("zirconHandle" ::: Zx_handle_t))
-> IO ("zirconHandle" ::: Zx_handle_t)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (SemaphoreGetZirconHandleInfoFUCHSIA
getZirconHandleInfo)
"pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t)
pPZirconHandle <- ((("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO ("zirconHandle" ::: Zx_handle_t))
-> IO ("zirconHandle" ::: Zx_handle_t))
-> ContT
("zirconHandle" ::: Zx_handle_t)
IO
("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO ("zirconHandle" ::: Zx_handle_t))
-> IO ("zirconHandle" ::: Zx_handle_t))
-> ContT
("zirconHandle" ::: Zx_handle_t)
IO
("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t)))
-> ((("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO ("zirconHandle" ::: Zx_handle_t))
-> IO ("zirconHandle" ::: Zx_handle_t))
-> ContT
("zirconHandle" ::: Zx_handle_t)
IO
("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
forall a b. (a -> b) -> a -> b
$ IO ("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> (("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO ())
-> (("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO ("zirconHandle" ::: Zx_handle_t))
-> IO ("zirconHandle" ::: Zx_handle_t)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int
-> IO ("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
forall a. Int -> IO (Ptr a)
callocBytes @Zx_handle_t Int
4) ("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t)) -> IO ()
forall a. Ptr a -> IO ()
free
Result
r <- IO Result -> ContT ("zirconHandle" ::: Zx_handle_t) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT ("zirconHandle" ::: Zx_handle_t) IO Result)
-> IO Result -> ContT ("zirconHandle" ::: Zx_handle_t) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
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))
IO () -> ContT ("zirconHandle" ::: Zx_handle_t) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("zirconHandle" ::: Zx_handle_t) IO ())
-> IO () -> ContT ("zirconHandle" ::: Zx_handle_t) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
"zirconHandle" ::: Zx_handle_t
pZirconHandle <- IO ("zirconHandle" ::: Zx_handle_t)
-> ContT
("zirconHandle" ::: Zx_handle_t)
IO
("zirconHandle" ::: Zx_handle_t)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("zirconHandle" ::: Zx_handle_t)
-> ContT
("zirconHandle" ::: Zx_handle_t)
IO
("zirconHandle" ::: Zx_handle_t))
-> IO ("zirconHandle" ::: Zx_handle_t)
-> ContT
("zirconHandle" ::: Zx_handle_t)
IO
("zirconHandle" ::: Zx_handle_t)
forall a b. (a -> b) -> a -> b
$ ("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO ("zirconHandle" ::: Zx_handle_t)
forall a. Storable a => Ptr a -> IO a
peek @Zx_handle_t "pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t)
pPZirconHandle
("zirconHandle" ::: Zx_handle_t)
-> ContT
("zirconHandle" ::: Zx_handle_t)
IO
("zirconHandle" ::: Zx_handle_t)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("zirconHandle" ::: Zx_handle_t)
-> ContT
("zirconHandle" ::: Zx_handle_t)
IO
("zirconHandle" ::: Zx_handle_t))
-> ("zirconHandle" ::: Zx_handle_t)
-> ContT
("zirconHandle" ::: Zx_handle_t)
IO
("zirconHandle" ::: Zx_handle_t)
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 :: Device -> ImportSemaphoreZirconHandleInfoFUCHSIA -> io ()
importSemaphoreZirconHandleFUCHSIA Device
device ImportSemaphoreZirconHandleInfoFUCHSIA
importSemaphoreZirconHandleInfo = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
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)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO Result)
vkImportSemaphoreZirconHandleFUCHSIAPtr FunPtr
(Ptr Device_T
-> ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO Result)
-> FunPtr
(Ptr Device_T
-> ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO Result)
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 String
"" String
"The function pointer for vkImportSemaphoreZirconHandleFUCHSIA is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
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 <- ((("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO ())
-> IO ())
-> ContT
()
IO
("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO ())
-> IO ())
-> ContT
()
IO
("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA))
-> ((("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO ())
-> IO ())
-> ContT
()
IO
("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
forall a b. (a -> b) -> a -> b
$ ImportSemaphoreZirconHandleInfoFUCHSIA
-> (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (ImportSemaphoreZirconHandleInfoFUCHSIA
importSemaphoreZirconHandleInfo)
Result
r <- IO Result -> ContT () IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT () IO Result)
-> IO Result -> ContT () IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
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)
IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
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
(ImportSemaphoreZirconHandleInfoFUCHSIA
-> ImportSemaphoreZirconHandleInfoFUCHSIA -> Bool)
-> (ImportSemaphoreZirconHandleInfoFUCHSIA
-> ImportSemaphoreZirconHandleInfoFUCHSIA -> Bool)
-> Eq ImportSemaphoreZirconHandleInfoFUCHSIA
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 :: ImportSemaphoreZirconHandleInfoFUCHSIA
-> (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO b)
-> IO b
withCStruct ImportSemaphoreZirconHandleInfoFUCHSIA
x ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO b
f = Int
-> (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO b)
-> IO b)
-> (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \"pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p -> ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> ImportSemaphoreZirconHandleInfoFUCHSIA -> IO b -> IO b
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 :: ("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
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Semaphore -> Semaphore -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> Int -> Ptr Semaphore
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Semaphore)) (Semaphore
semaphore)
Ptr SemaphoreImportFlags -> SemaphoreImportFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> Int -> Ptr SemaphoreImportFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr SemaphoreImportFlags)) (SemaphoreImportFlags
flags)
Ptr ExternalSemaphoreHandleTypeFlagBits
-> ExternalSemaphoreHandleTypeFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> Int -> Ptr ExternalSemaphoreHandleTypeFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr ExternalSemaphoreHandleTypeFlagBits)) (ExternalSemaphoreHandleTypeFlagBits
handleType)
("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> ("zirconHandle" ::: Zx_handle_t) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> Int -> "pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t)
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 :: ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO b -> IO b
pokeZeroCStruct "pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Semaphore -> Semaphore -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> Int -> Ptr Semaphore
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Semaphore)) (Semaphore
forall a. Zero a => a
zero)
Ptr ExternalSemaphoreHandleTypeFlagBits
-> ExternalSemaphoreHandleTypeFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> Int -> Ptr ExternalSemaphoreHandleTypeFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr ExternalSemaphoreHandleTypeFlagBits)) (ExternalSemaphoreHandleTypeFlagBits
forall a. Zero a => a
zero)
("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> ("zirconHandle" ::: Zx_handle_t) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> Int -> "pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Zx_handle_t)) ("zirconHandle" ::: 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 <- Ptr Semaphore -> IO Semaphore
forall a. Storable a => Ptr a -> IO a
peek @Semaphore (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> Int -> Ptr Semaphore
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Semaphore))
SemaphoreImportFlags
flags <- Ptr SemaphoreImportFlags -> IO SemaphoreImportFlags
forall a. Storable a => Ptr a -> IO a
peek @SemaphoreImportFlags (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> Int -> Ptr SemaphoreImportFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr SemaphoreImportFlags))
ExternalSemaphoreHandleTypeFlagBits
handleType <- Ptr ExternalSemaphoreHandleTypeFlagBits
-> IO ExternalSemaphoreHandleTypeFlagBits
forall a. Storable a => Ptr a -> IO a
peek @ExternalSemaphoreHandleTypeFlagBits (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> Int -> Ptr ExternalSemaphoreHandleTypeFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr ExternalSemaphoreHandleTypeFlagBits))
"zirconHandle" ::: Zx_handle_t
zirconHandle <- ("pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t))
-> IO ("zirconHandle" ::: Zx_handle_t)
forall a. Storable a => Ptr a -> IO a
peek @Zx_handle_t (("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
p ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> Int -> "pZirconHandle" ::: Ptr ("zirconHandle" ::: Zx_handle_t)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Zx_handle_t))
ImportSemaphoreZirconHandleInfoFUCHSIA
-> IO ImportSemaphoreZirconHandleInfoFUCHSIA
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ImportSemaphoreZirconHandleInfoFUCHSIA
-> IO ImportSemaphoreZirconHandleInfoFUCHSIA)
-> ImportSemaphoreZirconHandleInfoFUCHSIA
-> IO ImportSemaphoreZirconHandleInfoFUCHSIA
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 = ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> IO ImportSemaphoreZirconHandleInfoFUCHSIA
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> ImportSemaphoreZirconHandleInfoFUCHSIA -> IO ()
poke "pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
ptr ImportSemaphoreZirconHandleInfoFUCHSIA
poked = ("pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA)
-> ImportSemaphoreZirconHandleInfoFUCHSIA -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pImportSemaphoreZirconHandleInfo"
::: Ptr ImportSemaphoreZirconHandleInfoFUCHSIA
ptr ImportSemaphoreZirconHandleInfoFUCHSIA
poked (() -> IO ()
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
Semaphore
forall a. Zero a => a
zero
SemaphoreImportFlags
forall a. Zero a => a
zero
ExternalSemaphoreHandleTypeFlagBits
forall a. Zero a => a
zero
"zirconHandle" ::: Zx_handle_t
forall a. Zero a => a
zero
data SemaphoreGetZirconHandleInfoFUCHSIA = SemaphoreGetZirconHandleInfoFUCHSIA
{
SemaphoreGetZirconHandleInfoFUCHSIA -> Semaphore
semaphore :: Semaphore
,
SemaphoreGetZirconHandleInfoFUCHSIA
-> ExternalSemaphoreHandleTypeFlagBits
handleType :: ExternalSemaphoreHandleTypeFlagBits
}
deriving (Typeable, SemaphoreGetZirconHandleInfoFUCHSIA
-> SemaphoreGetZirconHandleInfoFUCHSIA -> Bool
(SemaphoreGetZirconHandleInfoFUCHSIA
-> SemaphoreGetZirconHandleInfoFUCHSIA -> Bool)
-> (SemaphoreGetZirconHandleInfoFUCHSIA
-> SemaphoreGetZirconHandleInfoFUCHSIA -> Bool)
-> Eq SemaphoreGetZirconHandleInfoFUCHSIA
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 :: SemaphoreGetZirconHandleInfoFUCHSIA
-> (("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> IO b)
-> IO b
withCStruct SemaphoreGetZirconHandleInfoFUCHSIA
x ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> IO b
f = Int
-> (("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> IO b)
-> IO b)
-> (("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \"pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p -> ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> SemaphoreGetZirconHandleInfoFUCHSIA -> IO b -> IO b
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 :: ("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
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Semaphore -> Semaphore -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> Int -> Ptr Semaphore
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Semaphore)) (Semaphore
semaphore)
Ptr ExternalSemaphoreHandleTypeFlagBits
-> ExternalSemaphoreHandleTypeFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> Int -> Ptr ExternalSemaphoreHandleTypeFlagBits
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 :: ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> IO b -> IO b
pokeZeroCStruct "pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Semaphore -> Semaphore -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> Int -> Ptr Semaphore
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Semaphore)) (Semaphore
forall a. Zero a => a
zero)
Ptr ExternalSemaphoreHandleTypeFlagBits
-> ExternalSemaphoreHandleTypeFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> Int -> Ptr ExternalSemaphoreHandleTypeFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ExternalSemaphoreHandleTypeFlagBits)) (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 <- Ptr Semaphore -> IO Semaphore
forall a. Storable a => Ptr a -> IO a
peek @Semaphore (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> Int -> Ptr Semaphore
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Semaphore))
ExternalSemaphoreHandleTypeFlagBits
handleType <- Ptr ExternalSemaphoreHandleTypeFlagBits
-> IO ExternalSemaphoreHandleTypeFlagBits
forall a. Storable a => Ptr a -> IO a
peek @ExternalSemaphoreHandleTypeFlagBits (("pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
p ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> Int -> Ptr ExternalSemaphoreHandleTypeFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr ExternalSemaphoreHandleTypeFlagBits))
SemaphoreGetZirconHandleInfoFUCHSIA
-> IO SemaphoreGetZirconHandleInfoFUCHSIA
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SemaphoreGetZirconHandleInfoFUCHSIA
-> IO SemaphoreGetZirconHandleInfoFUCHSIA)
-> SemaphoreGetZirconHandleInfoFUCHSIA
-> IO SemaphoreGetZirconHandleInfoFUCHSIA
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 = ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> IO SemaphoreGetZirconHandleInfoFUCHSIA
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> SemaphoreGetZirconHandleInfoFUCHSIA -> IO ()
poke "pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
ptr SemaphoreGetZirconHandleInfoFUCHSIA
poked = ("pGetZirconHandleInfo"
::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA)
-> SemaphoreGetZirconHandleInfoFUCHSIA -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pGetZirconHandleInfo" ::: Ptr SemaphoreGetZirconHandleInfoFUCHSIA
ptr SemaphoreGetZirconHandleInfoFUCHSIA
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero SemaphoreGetZirconHandleInfoFUCHSIA where
zero :: SemaphoreGetZirconHandleInfoFUCHSIA
zero = Semaphore
-> ExternalSemaphoreHandleTypeFlagBits
-> SemaphoreGetZirconHandleInfoFUCHSIA
SemaphoreGetZirconHandleInfoFUCHSIA
Semaphore
forall a. Zero a => a
zero
ExternalSemaphoreHandleTypeFlagBits
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 :: a
$mFUCHSIA_EXTERNAL_SEMAPHORE_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> 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 :: a
$mFUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
FUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME = "VK_FUCHSIA_external_semaphore"