{-# language CPP #-}
module Vulkan.Extensions.VK_NV_external_memory_win32 ( getMemoryWin32HandleNV
, ImportMemoryWin32HandleInfoNV(..)
, ExportMemoryWin32HandleInfoNV(..)
, NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION
, pattern NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION
, NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME
, pattern NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME
, HANDLE
, DWORD
, SECURITY_ATTRIBUTES
, ExternalMemoryHandleTypeFlagBitsNV(..)
, ExternalMemoryHandleTypeFlagsNV
) 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.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkGetMemoryWin32HandleNV))
import Vulkan.Core10.Handles (DeviceMemory)
import Vulkan.Core10.Handles (DeviceMemory(..))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.Extensions.VK_NV_external_memory_capabilities (ExternalMemoryHandleTypeFlagBitsNV(..))
import Vulkan.Extensions.VK_NV_external_memory_capabilities (ExternalMemoryHandleTypeFlagsNV)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.VK_NV_external_memory_capabilities (ExternalMemoryHandleTypeFlagBitsNV(..))
import Vulkan.Extensions.VK_NV_external_memory_capabilities (ExternalMemoryHandleTypeFlagsNV)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetMemoryWin32HandleNV
:: FunPtr (Ptr Device_T -> DeviceMemory -> ExternalMemoryHandleTypeFlagsNV -> Ptr HANDLE -> IO Result) -> Ptr Device_T -> DeviceMemory -> ExternalMemoryHandleTypeFlagsNV -> Ptr HANDLE -> IO Result
getMemoryWin32HandleNV :: forall io
. (MonadIO io)
=>
Device
->
DeviceMemory
->
ExternalMemoryHandleTypeFlagsNV
-> io (HANDLE)
getMemoryWin32HandleNV :: forall (io :: * -> *).
MonadIO io =>
Device
-> DeviceMemory -> ExternalMemoryHandleTypeFlagsNV -> io HANDLE
getMemoryWin32HandleNV Device
device DeviceMemory
memory ExternalMemoryHandleTypeFlagsNV
handleType = 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 vkGetMemoryWin32HandleNVPtr :: FunPtr
(Ptr Device_T
-> DeviceMemory
-> ExternalMemoryHandleTypeFlagsNV
-> ("pHandle" ::: Ptr HANDLE)
-> IO Result)
vkGetMemoryWin32HandleNVPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> DeviceMemory
-> ExternalMemoryHandleTypeFlagsNV
-> ("pHandle" ::: Ptr HANDLE)
-> IO Result)
pVkGetMemoryWin32HandleNV (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
-> DeviceMemory
-> ExternalMemoryHandleTypeFlagsNV
-> ("pHandle" ::: Ptr HANDLE)
-> IO Result)
vkGetMemoryWin32HandleNVPtr 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 vkGetMemoryWin32HandleNV is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkGetMemoryWin32HandleNV' :: Ptr Device_T
-> DeviceMemory
-> ExternalMemoryHandleTypeFlagsNV
-> ("pHandle" ::: Ptr HANDLE)
-> IO Result
vkGetMemoryWin32HandleNV' = FunPtr
(Ptr Device_T
-> DeviceMemory
-> ExternalMemoryHandleTypeFlagsNV
-> ("pHandle" ::: Ptr HANDLE)
-> IO Result)
-> Ptr Device_T
-> DeviceMemory
-> ExternalMemoryHandleTypeFlagsNV
-> ("pHandle" ::: Ptr HANDLE)
-> IO Result
mkVkGetMemoryWin32HandleNV FunPtr
(Ptr Device_T
-> DeviceMemory
-> ExternalMemoryHandleTypeFlagsNV
-> ("pHandle" ::: Ptr HANDLE)
-> IO Result)
vkGetMemoryWin32HandleNVPtr
"pHandle" ::: Ptr HANDLE
pPHandle <- 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 @HANDLE Int
8) 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
"vkGetMemoryWin32HandleNV" (Ptr Device_T
-> DeviceMemory
-> ExternalMemoryHandleTypeFlagsNV
-> ("pHandle" ::: Ptr HANDLE)
-> IO Result
vkGetMemoryWin32HandleNV'
(Device -> Ptr Device_T
deviceHandle (Device
device))
(DeviceMemory
memory)
(ExternalMemoryHandleTypeFlagsNV
handleType)
("pHandle" ::: Ptr HANDLE
pPHandle))
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))
HANDLE
pHandle <- 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 @HANDLE "pHandle" ::: Ptr HANDLE
pPHandle
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (HANDLE
pHandle)
data ImportMemoryWin32HandleInfoNV = ImportMemoryWin32HandleInfoNV
{
ImportMemoryWin32HandleInfoNV -> ExternalMemoryHandleTypeFlagsNV
handleType :: ExternalMemoryHandleTypeFlagsNV
,
ImportMemoryWin32HandleInfoNV -> HANDLE
handle :: HANDLE
}
deriving (Typeable, ImportMemoryWin32HandleInfoNV
-> ImportMemoryWin32HandleInfoNV -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportMemoryWin32HandleInfoNV
-> ImportMemoryWin32HandleInfoNV -> Bool
$c/= :: ImportMemoryWin32HandleInfoNV
-> ImportMemoryWin32HandleInfoNV -> Bool
== :: ImportMemoryWin32HandleInfoNV
-> ImportMemoryWin32HandleInfoNV -> Bool
$c== :: ImportMemoryWin32HandleInfoNV
-> ImportMemoryWin32HandleInfoNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImportMemoryWin32HandleInfoNV)
#endif
deriving instance Show ImportMemoryWin32HandleInfoNV
instance ToCStruct ImportMemoryWin32HandleInfoNV where
withCStruct :: forall b.
ImportMemoryWin32HandleInfoNV
-> (Ptr ImportMemoryWin32HandleInfoNV -> IO b) -> IO b
withCStruct ImportMemoryWin32HandleInfoNV
x Ptr ImportMemoryWin32HandleInfoNV -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr ImportMemoryWin32HandleInfoNV
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImportMemoryWin32HandleInfoNV
p ImportMemoryWin32HandleInfoNV
x (Ptr ImportMemoryWin32HandleInfoNV -> IO b
f Ptr ImportMemoryWin32HandleInfoNV
p)
pokeCStruct :: forall b.
Ptr ImportMemoryWin32HandleInfoNV
-> ImportMemoryWin32HandleInfoNV -> IO b -> IO b
pokeCStruct Ptr ImportMemoryWin32HandleInfoNV
p ImportMemoryWin32HandleInfoNV{HANDLE
ExternalMemoryHandleTypeFlagsNV
handle :: HANDLE
handleType :: ExternalMemoryHandleTypeFlagsNV
$sel:handle:ImportMemoryWin32HandleInfoNV :: ImportMemoryWin32HandleInfoNV -> HANDLE
$sel:handleType:ImportMemoryWin32HandleInfoNV :: ImportMemoryWin32HandleInfoNV -> ExternalMemoryHandleTypeFlagsNV
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryWin32HandleInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryWin32HandleInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryWin32HandleInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ExternalMemoryHandleTypeFlagsNV)) (ExternalMemoryHandleTypeFlagsNV
handleType)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryWin32HandleInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr HANDLE)) (HANDLE
handle)
IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr ImportMemoryWin32HandleInfoNV -> IO b -> IO b
pokeZeroCStruct Ptr ImportMemoryWin32HandleInfoNV
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryWin32HandleInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryWin32HandleInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct ImportMemoryWin32HandleInfoNV where
peekCStruct :: Ptr ImportMemoryWin32HandleInfoNV
-> IO ImportMemoryWin32HandleInfoNV
peekCStruct Ptr ImportMemoryWin32HandleInfoNV
p = do
ExternalMemoryHandleTypeFlagsNV
handleType <- forall a. Storable a => Ptr a -> IO a
peek @ExternalMemoryHandleTypeFlagsNV ((Ptr ImportMemoryWin32HandleInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ExternalMemoryHandleTypeFlagsNV))
HANDLE
handle <- forall a. Storable a => Ptr a -> IO a
peek @HANDLE ((Ptr ImportMemoryWin32HandleInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr HANDLE))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ExternalMemoryHandleTypeFlagsNV
-> HANDLE -> ImportMemoryWin32HandleInfoNV
ImportMemoryWin32HandleInfoNV
ExternalMemoryHandleTypeFlagsNV
handleType HANDLE
handle
instance Storable ImportMemoryWin32HandleInfoNV where
sizeOf :: ImportMemoryWin32HandleInfoNV -> Int
sizeOf ~ImportMemoryWin32HandleInfoNV
_ = Int
32
alignment :: ImportMemoryWin32HandleInfoNV -> Int
alignment ~ImportMemoryWin32HandleInfoNV
_ = Int
8
peek :: Ptr ImportMemoryWin32HandleInfoNV
-> IO ImportMemoryWin32HandleInfoNV
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ImportMemoryWin32HandleInfoNV
-> ImportMemoryWin32HandleInfoNV -> IO ()
poke Ptr ImportMemoryWin32HandleInfoNV
ptr ImportMemoryWin32HandleInfoNV
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImportMemoryWin32HandleInfoNV
ptr ImportMemoryWin32HandleInfoNV
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ImportMemoryWin32HandleInfoNV where
zero :: ImportMemoryWin32HandleInfoNV
zero = ExternalMemoryHandleTypeFlagsNV
-> HANDLE -> ImportMemoryWin32HandleInfoNV
ImportMemoryWin32HandleInfoNV
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data ExportMemoryWin32HandleInfoNV = ExportMemoryWin32HandleInfoNV
{
ExportMemoryWin32HandleInfoNV -> Ptr SECURITY_ATTRIBUTES
attributes :: Ptr SECURITY_ATTRIBUTES
,
ExportMemoryWin32HandleInfoNV -> DWORD
dwAccess :: DWORD
}
deriving (Typeable, ExportMemoryWin32HandleInfoNV
-> ExportMemoryWin32HandleInfoNV -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportMemoryWin32HandleInfoNV
-> ExportMemoryWin32HandleInfoNV -> Bool
$c/= :: ExportMemoryWin32HandleInfoNV
-> ExportMemoryWin32HandleInfoNV -> Bool
== :: ExportMemoryWin32HandleInfoNV
-> ExportMemoryWin32HandleInfoNV -> Bool
$c== :: ExportMemoryWin32HandleInfoNV
-> ExportMemoryWin32HandleInfoNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ExportMemoryWin32HandleInfoNV)
#endif
deriving instance Show ExportMemoryWin32HandleInfoNV
instance ToCStruct ExportMemoryWin32HandleInfoNV where
withCStruct :: forall b.
ExportMemoryWin32HandleInfoNV
-> (Ptr ExportMemoryWin32HandleInfoNV -> IO b) -> IO b
withCStruct ExportMemoryWin32HandleInfoNV
x Ptr ExportMemoryWin32HandleInfoNV -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr ExportMemoryWin32HandleInfoNV
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExportMemoryWin32HandleInfoNV
p ExportMemoryWin32HandleInfoNV
x (Ptr ExportMemoryWin32HandleInfoNV -> IO b
f Ptr ExportMemoryWin32HandleInfoNV
p)
pokeCStruct :: forall b.
Ptr ExportMemoryWin32HandleInfoNV
-> ExportMemoryWin32HandleInfoNV -> IO b -> IO b
pokeCStruct Ptr ExportMemoryWin32HandleInfoNV
p ExportMemoryWin32HandleInfoNV{DWORD
Ptr SECURITY_ATTRIBUTES
dwAccess :: DWORD
attributes :: Ptr SECURITY_ATTRIBUTES
$sel:dwAccess:ExportMemoryWin32HandleInfoNV :: ExportMemoryWin32HandleInfoNV -> DWORD
$sel:attributes:ExportMemoryWin32HandleInfoNV :: ExportMemoryWin32HandleInfoNV -> Ptr SECURITY_ATTRIBUTES
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMemoryWin32HandleInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMemoryWin32HandleInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMemoryWin32HandleInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr SECURITY_ATTRIBUTES))) (Ptr SECURITY_ATTRIBUTES
attributes)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMemoryWin32HandleInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DWORD)) (DWORD
dwAccess)
IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr ExportMemoryWin32HandleInfoNV -> IO b -> IO b
pokeZeroCStruct Ptr ExportMemoryWin32HandleInfoNV
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMemoryWin32HandleInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExportMemoryWin32HandleInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct ExportMemoryWin32HandleInfoNV where
peekCStruct :: Ptr ExportMemoryWin32HandleInfoNV
-> IO ExportMemoryWin32HandleInfoNV
peekCStruct Ptr ExportMemoryWin32HandleInfoNV
p = do
Ptr SECURITY_ATTRIBUTES
pAttributes <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr SECURITY_ATTRIBUTES) ((Ptr ExportMemoryWin32HandleInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr SECURITY_ATTRIBUTES)))
DWORD
dwAccess <- forall a. Storable a => Ptr a -> IO a
peek @DWORD ((Ptr ExportMemoryWin32HandleInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DWORD))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr SECURITY_ATTRIBUTES -> DWORD -> ExportMemoryWin32HandleInfoNV
ExportMemoryWin32HandleInfoNV
Ptr SECURITY_ATTRIBUTES
pAttributes DWORD
dwAccess
instance Storable ExportMemoryWin32HandleInfoNV where
sizeOf :: ExportMemoryWin32HandleInfoNV -> Int
sizeOf ~ExportMemoryWin32HandleInfoNV
_ = Int
32
alignment :: ExportMemoryWin32HandleInfoNV -> Int
alignment ~ExportMemoryWin32HandleInfoNV
_ = Int
8
peek :: Ptr ExportMemoryWin32HandleInfoNV
-> IO ExportMemoryWin32HandleInfoNV
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ExportMemoryWin32HandleInfoNV
-> ExportMemoryWin32HandleInfoNV -> IO ()
poke Ptr ExportMemoryWin32HandleInfoNV
ptr ExportMemoryWin32HandleInfoNV
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExportMemoryWin32HandleInfoNV
ptr ExportMemoryWin32HandleInfoNV
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ExportMemoryWin32HandleInfoNV where
zero :: ExportMemoryWin32HandleInfoNV
zero = Ptr SECURITY_ATTRIBUTES -> DWORD -> ExportMemoryWin32HandleInfoNV
ExportMemoryWin32HandleInfoNV
forall a. Zero a => a
zero
forall a. Zero a => a
zero
type NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION = 1
pattern NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION :: forall a . Integral a => a
pattern $bNV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION :: forall a. Integral a => a
$mNV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION = 1
type NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME = "VK_NV_external_memory_win32"
pattern NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bNV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mNV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME = "VK_NV_external_memory_win32"
type HANDLE = Ptr ()
type DWORD = Word32
data SECURITY_ATTRIBUTES