{-# language CPP #-}
module Vulkan.Extensions.VK_EXT_external_memory_host ( getMemoryHostPointerPropertiesEXT
, ImportMemoryHostPointerInfoEXT(..)
, MemoryHostPointerPropertiesEXT(..)
, PhysicalDeviceExternalMemoryHostPropertiesEXT(..)
, EXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION
, pattern EXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION
, EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME
, pattern EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME
) where
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytes)
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.NamedType ((:::))
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkGetMemoryHostPointerPropertiesEXT))
import Vulkan.Core10.FundamentalTypes (DeviceSize)
import Vulkan.Core10.Handles (Device_T)
import Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits (ExternalMemoryHandleTypeFlagBits)
import Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits (ExternalMemoryHandleTypeFlagBits(..))
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_IMPORT_MEMORY_HOST_POINTER_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetMemoryHostPointerPropertiesEXT
:: FunPtr (Ptr Device_T -> ExternalMemoryHandleTypeFlagBits -> Ptr () -> Ptr MemoryHostPointerPropertiesEXT -> IO Result) -> Ptr Device_T -> ExternalMemoryHandleTypeFlagBits -> Ptr () -> Ptr MemoryHostPointerPropertiesEXT -> IO Result
getMemoryHostPointerPropertiesEXT :: forall io
. (MonadIO io)
=>
Device
->
ExternalMemoryHandleTypeFlagBits
->
("hostPointer" ::: Ptr ())
-> io (MemoryHostPointerPropertiesEXT)
getMemoryHostPointerPropertiesEXT :: forall (io :: * -> *).
MonadIO io =>
Device
-> ExternalMemoryHandleTypeFlagBits
-> ("hostPointer" ::: Ptr ())
-> io MemoryHostPointerPropertiesEXT
getMemoryHostPointerPropertiesEXT Device
device
ExternalMemoryHandleTypeFlagBits
handleType
"hostPointer" ::: Ptr ()
hostPointer = 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 vkGetMemoryHostPointerPropertiesEXTPtr :: FunPtr
(Ptr Device_T
-> ExternalMemoryHandleTypeFlagBits
-> ("hostPointer" ::: Ptr ())
-> ("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT)
-> IO Result)
vkGetMemoryHostPointerPropertiesEXTPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ExternalMemoryHandleTypeFlagBits
-> ("hostPointer" ::: Ptr ())
-> ("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT)
-> IO Result)
pVkGetMemoryHostPointerPropertiesEXT (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
-> ExternalMemoryHandleTypeFlagBits
-> ("hostPointer" ::: Ptr ())
-> ("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT)
-> IO Result)
vkGetMemoryHostPointerPropertiesEXTPtr 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 vkGetMemoryHostPointerPropertiesEXT is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkGetMemoryHostPointerPropertiesEXT' :: Ptr Device_T
-> ExternalMemoryHandleTypeFlagBits
-> ("hostPointer" ::: Ptr ())
-> ("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT)
-> IO Result
vkGetMemoryHostPointerPropertiesEXT' = FunPtr
(Ptr Device_T
-> ExternalMemoryHandleTypeFlagBits
-> ("hostPointer" ::: Ptr ())
-> ("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT)
-> IO Result)
-> Ptr Device_T
-> ExternalMemoryHandleTypeFlagBits
-> ("hostPointer" ::: Ptr ())
-> ("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT)
-> IO Result
mkVkGetMemoryHostPointerPropertiesEXT FunPtr
(Ptr Device_T
-> ExternalMemoryHandleTypeFlagBits
-> ("hostPointer" ::: Ptr ())
-> ("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT)
-> IO Result)
vkGetMemoryHostPointerPropertiesEXTPtr
"pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
pPMemoryHostPointerProperties <- 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 @MemoryHostPointerPropertiesEXT)
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
"vkGetMemoryHostPointerPropertiesEXT" (Ptr Device_T
-> ExternalMemoryHandleTypeFlagBits
-> ("hostPointer" ::: Ptr ())
-> ("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT)
-> IO Result
vkGetMemoryHostPointerPropertiesEXT'
(Device -> Ptr Device_T
deviceHandle (Device
device))
(ExternalMemoryHandleTypeFlagBits
handleType)
("hostPointer" ::: Ptr ()
hostPointer)
("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
pPMemoryHostPointerProperties))
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))
MemoryHostPointerPropertiesEXT
pMemoryHostPointerProperties <- 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 @MemoryHostPointerPropertiesEXT "pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
pPMemoryHostPointerProperties
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (MemoryHostPointerPropertiesEXT
pMemoryHostPointerProperties)
data ImportMemoryHostPointerInfoEXT = ImportMemoryHostPointerInfoEXT
{
ImportMemoryHostPointerInfoEXT -> ExternalMemoryHandleTypeFlagBits
handleType :: ExternalMemoryHandleTypeFlagBits
,
ImportMemoryHostPointerInfoEXT -> "hostPointer" ::: Ptr ()
hostPointer :: Ptr ()
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImportMemoryHostPointerInfoEXT)
#endif
deriving instance Show ImportMemoryHostPointerInfoEXT
instance ToCStruct ImportMemoryHostPointerInfoEXT where
withCStruct :: forall b.
ImportMemoryHostPointerInfoEXT
-> (Ptr ImportMemoryHostPointerInfoEXT -> IO b) -> IO b
withCStruct ImportMemoryHostPointerInfoEXT
x Ptr ImportMemoryHostPointerInfoEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr ImportMemoryHostPointerInfoEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImportMemoryHostPointerInfoEXT
p ImportMemoryHostPointerInfoEXT
x (Ptr ImportMemoryHostPointerInfoEXT -> IO b
f Ptr ImportMemoryHostPointerInfoEXT
p)
pokeCStruct :: forall b.
Ptr ImportMemoryHostPointerInfoEXT
-> ImportMemoryHostPointerInfoEXT -> IO b -> IO b
pokeCStruct Ptr ImportMemoryHostPointerInfoEXT
p ImportMemoryHostPointerInfoEXT{"hostPointer" ::: Ptr ()
ExternalMemoryHandleTypeFlagBits
hostPointer :: "hostPointer" ::: Ptr ()
handleType :: ExternalMemoryHandleTypeFlagBits
$sel:hostPointer:ImportMemoryHostPointerInfoEXT :: ImportMemoryHostPointerInfoEXT -> "hostPointer" ::: Ptr ()
$sel:handleType:ImportMemoryHostPointerInfoEXT :: ImportMemoryHostPointerInfoEXT -> ExternalMemoryHandleTypeFlagBits
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryHostPointerInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryHostPointerInfoEXT
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 ImportMemoryHostPointerInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ExternalMemoryHandleTypeFlagBits)) (ExternalMemoryHandleTypeFlagBits
handleType)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryHostPointerInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr ()))) ("hostPointer" ::: Ptr ()
hostPointer)
IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr ImportMemoryHostPointerInfoEXT -> IO b -> IO b
pokeZeroCStruct Ptr ImportMemoryHostPointerInfoEXT
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryHostPointerInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryHostPointerInfoEXT
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 ImportMemoryHostPointerInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ExternalMemoryHandleTypeFlagBits)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryHostPointerInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr ()))) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ImportMemoryHostPointerInfoEXT where
peekCStruct :: Ptr ImportMemoryHostPointerInfoEXT
-> IO ImportMemoryHostPointerInfoEXT
peekCStruct Ptr ImportMemoryHostPointerInfoEXT
p = do
ExternalMemoryHandleTypeFlagBits
handleType <- forall a. Storable a => Ptr a -> IO a
peek @ExternalMemoryHandleTypeFlagBits ((Ptr ImportMemoryHostPointerInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ExternalMemoryHandleTypeFlagBits))
"hostPointer" ::: Ptr ()
pHostPointer <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr ImportMemoryHostPointerInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr ())))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ExternalMemoryHandleTypeFlagBits
-> ("hostPointer" ::: Ptr ()) -> ImportMemoryHostPointerInfoEXT
ImportMemoryHostPointerInfoEXT
ExternalMemoryHandleTypeFlagBits
handleType "hostPointer" ::: Ptr ()
pHostPointer
instance Storable ImportMemoryHostPointerInfoEXT where
sizeOf :: ImportMemoryHostPointerInfoEXT -> Int
sizeOf ~ImportMemoryHostPointerInfoEXT
_ = Int
32
alignment :: ImportMemoryHostPointerInfoEXT -> Int
alignment ~ImportMemoryHostPointerInfoEXT
_ = Int
8
peek :: Ptr ImportMemoryHostPointerInfoEXT
-> IO ImportMemoryHostPointerInfoEXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ImportMemoryHostPointerInfoEXT
-> ImportMemoryHostPointerInfoEXT -> IO ()
poke Ptr ImportMemoryHostPointerInfoEXT
ptr ImportMemoryHostPointerInfoEXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImportMemoryHostPointerInfoEXT
ptr ImportMemoryHostPointerInfoEXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ImportMemoryHostPointerInfoEXT where
zero :: ImportMemoryHostPointerInfoEXT
zero = ExternalMemoryHandleTypeFlagBits
-> ("hostPointer" ::: Ptr ()) -> ImportMemoryHostPointerInfoEXT
ImportMemoryHostPointerInfoEXT
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data MemoryHostPointerPropertiesEXT = MemoryHostPointerPropertiesEXT
{
MemoryHostPointerPropertiesEXT -> Word32
memoryTypeBits :: Word32 }
deriving (Typeable, MemoryHostPointerPropertiesEXT
-> MemoryHostPointerPropertiesEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MemoryHostPointerPropertiesEXT
-> MemoryHostPointerPropertiesEXT -> Bool
$c/= :: MemoryHostPointerPropertiesEXT
-> MemoryHostPointerPropertiesEXT -> Bool
== :: MemoryHostPointerPropertiesEXT
-> MemoryHostPointerPropertiesEXT -> Bool
$c== :: MemoryHostPointerPropertiesEXT
-> MemoryHostPointerPropertiesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (MemoryHostPointerPropertiesEXT)
#endif
deriving instance Show MemoryHostPointerPropertiesEXT
instance ToCStruct MemoryHostPointerPropertiesEXT where
withCStruct :: forall b.
MemoryHostPointerPropertiesEXT
-> (("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT)
-> IO b)
-> IO b
withCStruct MemoryHostPointerPropertiesEXT
x ("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT)
-> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \"pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
p MemoryHostPointerPropertiesEXT
x (("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT)
-> IO b
f "pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
p)
pokeCStruct :: forall b.
("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT)
-> MemoryHostPointerPropertiesEXT -> IO b -> IO b
pokeCStruct "pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
p MemoryHostPointerPropertiesEXT{Word32
memoryTypeBits :: Word32
$sel:memoryTypeBits:MemoryHostPointerPropertiesEXT :: MemoryHostPointerPropertiesEXT -> Word32
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
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 (("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
memoryTypeBits)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT)
-> IO b -> IO b
pokeZeroCStruct "pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
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 (("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct MemoryHostPointerPropertiesEXT where
peekCStruct :: ("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT)
-> IO MemoryHostPointerPropertiesEXT
peekCStruct "pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
p = do
Word32
memoryTypeBits <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Word32 -> MemoryHostPointerPropertiesEXT
MemoryHostPointerPropertiesEXT
Word32
memoryTypeBits
instance Storable MemoryHostPointerPropertiesEXT where
sizeOf :: MemoryHostPointerPropertiesEXT -> Int
sizeOf ~MemoryHostPointerPropertiesEXT
_ = Int
24
alignment :: MemoryHostPointerPropertiesEXT -> Int
alignment ~MemoryHostPointerPropertiesEXT
_ = Int
8
peek :: ("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT)
-> IO MemoryHostPointerPropertiesEXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT)
-> MemoryHostPointerPropertiesEXT -> IO ()
poke "pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
ptr MemoryHostPointerPropertiesEXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pMemoryHostPointerProperties"
::: Ptr MemoryHostPointerPropertiesEXT
ptr MemoryHostPointerPropertiesEXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero MemoryHostPointerPropertiesEXT where
zero :: MemoryHostPointerPropertiesEXT
zero = Word32 -> MemoryHostPointerPropertiesEXT
MemoryHostPointerPropertiesEXT
forall a. Zero a => a
zero
data PhysicalDeviceExternalMemoryHostPropertiesEXT = PhysicalDeviceExternalMemoryHostPropertiesEXT
{
PhysicalDeviceExternalMemoryHostPropertiesEXT -> DeviceSize
minImportedHostPointerAlignment :: DeviceSize }
deriving (Typeable, PhysicalDeviceExternalMemoryHostPropertiesEXT
-> PhysicalDeviceExternalMemoryHostPropertiesEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceExternalMemoryHostPropertiesEXT
-> PhysicalDeviceExternalMemoryHostPropertiesEXT -> Bool
$c/= :: PhysicalDeviceExternalMemoryHostPropertiesEXT
-> PhysicalDeviceExternalMemoryHostPropertiesEXT -> Bool
== :: PhysicalDeviceExternalMemoryHostPropertiesEXT
-> PhysicalDeviceExternalMemoryHostPropertiesEXT -> Bool
$c== :: PhysicalDeviceExternalMemoryHostPropertiesEXT
-> PhysicalDeviceExternalMemoryHostPropertiesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceExternalMemoryHostPropertiesEXT)
#endif
deriving instance Show PhysicalDeviceExternalMemoryHostPropertiesEXT
instance ToCStruct PhysicalDeviceExternalMemoryHostPropertiesEXT where
withCStruct :: forall b.
PhysicalDeviceExternalMemoryHostPropertiesEXT
-> (Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT -> IO b)
-> IO b
withCStruct PhysicalDeviceExternalMemoryHostPropertiesEXT
x Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
p PhysicalDeviceExternalMemoryHostPropertiesEXT
x (Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT -> IO b
f Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
-> PhysicalDeviceExternalMemoryHostPropertiesEXT -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
p PhysicalDeviceExternalMemoryHostPropertiesEXT{DeviceSize
minImportedHostPointerAlignment :: DeviceSize
$sel:minImportedHostPointerAlignment:PhysicalDeviceExternalMemoryHostPropertiesEXT :: PhysicalDeviceExternalMemoryHostPropertiesEXT -> DeviceSize
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
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 PhysicalDeviceExternalMemoryHostPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (DeviceSize
minImportedHostPointerAlignment)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
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 PhysicalDeviceExternalMemoryHostPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct PhysicalDeviceExternalMemoryHostPropertiesEXT where
peekCStruct :: Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
-> IO PhysicalDeviceExternalMemoryHostPropertiesEXT
peekCStruct Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
p = do
DeviceSize
minImportedHostPointerAlignment <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ DeviceSize -> PhysicalDeviceExternalMemoryHostPropertiesEXT
PhysicalDeviceExternalMemoryHostPropertiesEXT
DeviceSize
minImportedHostPointerAlignment
instance Storable PhysicalDeviceExternalMemoryHostPropertiesEXT where
sizeOf :: PhysicalDeviceExternalMemoryHostPropertiesEXT -> Int
sizeOf ~PhysicalDeviceExternalMemoryHostPropertiesEXT
_ = Int
24
alignment :: PhysicalDeviceExternalMemoryHostPropertiesEXT -> Int
alignment ~PhysicalDeviceExternalMemoryHostPropertiesEXT
_ = Int
8
peek :: Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
-> IO PhysicalDeviceExternalMemoryHostPropertiesEXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
-> PhysicalDeviceExternalMemoryHostPropertiesEXT -> IO ()
poke Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
ptr PhysicalDeviceExternalMemoryHostPropertiesEXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceExternalMemoryHostPropertiesEXT where
zero :: PhysicalDeviceExternalMemoryHostPropertiesEXT
zero = DeviceSize -> PhysicalDeviceExternalMemoryHostPropertiesEXT
PhysicalDeviceExternalMemoryHostPropertiesEXT
forall a. Zero a => a
zero
type EXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION = 1
pattern EXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION :: forall a. Integral a => a
$mEXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION = 1
type EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME = "VK_EXT_external_memory_host"
pattern EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mEXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME = "VK_EXT_external_memory_host"