{-# language CPP #-}
module Vulkan.Core11.Promoted_From_VK_KHR_external_memory_capabilities ( getPhysicalDeviceExternalBufferProperties
, ExternalMemoryProperties(..)
, PhysicalDeviceExternalImageFormatInfo(..)
, ExternalImageFormatProperties(..)
, PhysicalDeviceExternalBufferInfo(..)
, ExternalBufferProperties(..)
, PhysicalDeviceIDProperties(..)
, StructureType(..)
, ExternalMemoryHandleTypeFlagBits(..)
, ExternalMemoryHandleTypeFlags
, ExternalMemoryFeatureFlagBits(..)
, ExternalMemoryFeatureFlags
, LUID_SIZE
, pattern LUID_SIZE
) where
import Vulkan.CStruct.Utils (FixedArray)
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytesAligned)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Word (Word8)
import Data.ByteString (ByteString)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Utils (peekByteStringFromSizedVectorPtr)
import Vulkan.CStruct.Utils (pokeFixedLengthByteString)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Enums.BufferCreateFlagBits (BufferCreateFlags)
import Vulkan.Core10.Enums.BufferUsageFlagBits (BufferUsageFlags)
import Vulkan.Core11.Enums.ExternalMemoryFeatureFlagBits (ExternalMemoryFeatureFlags)
import Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits (ExternalMemoryHandleTypeFlagBits)
import Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits (ExternalMemoryHandleTypeFlags)
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceExternalBufferProperties))
import Vulkan.Core10.APIConstants (LUID_SIZE)
import Vulkan.Core10.Handles (PhysicalDevice)
import Vulkan.Core10.Handles (PhysicalDevice(..))
import Vulkan.Core10.Handles (PhysicalDevice_T)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.APIConstants (UUID_SIZE)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES))
import Vulkan.Core11.Enums.ExternalMemoryFeatureFlagBits (ExternalMemoryFeatureFlagBits(..))
import Vulkan.Core11.Enums.ExternalMemoryFeatureFlagBits (ExternalMemoryFeatureFlags)
import Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits (ExternalMemoryHandleTypeFlagBits(..))
import Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits (ExternalMemoryHandleTypeFlags)
import Vulkan.Core10.APIConstants (LUID_SIZE)
import Vulkan.Core10.Enums.StructureType (StructureType(..))
import Vulkan.Core10.APIConstants (pattern LUID_SIZE)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetPhysicalDeviceExternalBufferProperties
:: FunPtr (Ptr PhysicalDevice_T -> Ptr PhysicalDeviceExternalBufferInfo -> Ptr ExternalBufferProperties -> IO ()) -> Ptr PhysicalDevice_T -> Ptr PhysicalDeviceExternalBufferInfo -> Ptr ExternalBufferProperties -> IO ()
getPhysicalDeviceExternalBufferProperties :: forall io
. (MonadIO io)
=>
PhysicalDevice
->
PhysicalDeviceExternalBufferInfo
-> io (ExternalBufferProperties)
getPhysicalDeviceExternalBufferProperties :: PhysicalDevice
-> PhysicalDeviceExternalBufferInfo -> io ExternalBufferProperties
getPhysicalDeviceExternalBufferProperties physicalDevice :: PhysicalDevice
physicalDevice externalBufferInfo :: PhysicalDeviceExternalBufferInfo
externalBufferInfo = IO ExternalBufferProperties -> io ExternalBufferProperties
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ExternalBufferProperties -> io ExternalBufferProperties)
-> (ContT ExternalBufferProperties IO ExternalBufferProperties
-> IO ExternalBufferProperties)
-> ContT ExternalBufferProperties IO ExternalBufferProperties
-> io ExternalBufferProperties
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT ExternalBufferProperties IO ExternalBufferProperties
-> IO ExternalBufferProperties
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT ExternalBufferProperties IO ExternalBufferProperties
-> io ExternalBufferProperties)
-> ContT ExternalBufferProperties IO ExternalBufferProperties
-> io ExternalBufferProperties
forall a b. (a -> b) -> a -> b
$ do
let vkGetPhysicalDeviceExternalBufferPropertiesPtr :: FunPtr
(Ptr PhysicalDevice_T
-> ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO ())
vkGetPhysicalDeviceExternalBufferPropertiesPtr = InstanceCmds
-> FunPtr
(Ptr PhysicalDevice_T
-> ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO ())
pVkGetPhysicalDeviceExternalBufferProperties (PhysicalDevice -> InstanceCmds
instanceCmds (PhysicalDevice
physicalDevice :: PhysicalDevice))
IO () -> ContT ExternalBufferProperties IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ExternalBufferProperties IO ())
-> IO () -> ContT ExternalBufferProperties IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr PhysicalDevice_T
-> ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO ())
vkGetPhysicalDeviceExternalBufferPropertiesPtr FunPtr
(Ptr PhysicalDevice_T
-> ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO ())
-> FunPtr
(Ptr PhysicalDevice_T
-> ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr PhysicalDevice_T
-> ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO ())
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 "" "The function pointer for vkGetPhysicalDeviceExternalBufferProperties is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkGetPhysicalDeviceExternalBufferProperties' :: Ptr PhysicalDevice_T
-> ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO ()
vkGetPhysicalDeviceExternalBufferProperties' = FunPtr
(Ptr PhysicalDevice_T
-> ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO ())
-> Ptr PhysicalDevice_T
-> ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO ()
mkVkGetPhysicalDeviceExternalBufferProperties FunPtr
(Ptr PhysicalDevice_T
-> ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO ())
vkGetPhysicalDeviceExternalBufferPropertiesPtr
"pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
pExternalBufferInfo <- ((("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> IO ExternalBufferProperties)
-> IO ExternalBufferProperties)
-> ContT
ExternalBufferProperties
IO
("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> IO ExternalBufferProperties)
-> IO ExternalBufferProperties)
-> ContT
ExternalBufferProperties
IO
("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo))
-> ((("pExternalBufferInfo"
::: Ptr PhysicalDeviceExternalBufferInfo)
-> IO ExternalBufferProperties)
-> IO ExternalBufferProperties)
-> ContT
ExternalBufferProperties
IO
("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
forall a b. (a -> b) -> a -> b
$ PhysicalDeviceExternalBufferInfo
-> (("pExternalBufferInfo"
::: Ptr PhysicalDeviceExternalBufferInfo)
-> IO ExternalBufferProperties)
-> IO ExternalBufferProperties
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (PhysicalDeviceExternalBufferInfo
externalBufferInfo)
"pExternalBufferProperties" ::: Ptr ExternalBufferProperties
pPExternalBufferProperties <- ((("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO ExternalBufferProperties)
-> IO ExternalBufferProperties)
-> ContT
ExternalBufferProperties
IO
("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall b.
ToCStruct ExternalBufferProperties =>
(("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO b)
-> IO b
forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @ExternalBufferProperties)
IO () -> ContT ExternalBufferProperties IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ExternalBufferProperties IO ())
-> IO () -> ContT ExternalBufferProperties IO ()
forall a b. (a -> b) -> a -> b
$ String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent "vkGetPhysicalDeviceExternalBufferProperties" (Ptr PhysicalDevice_T
-> ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO ()
vkGetPhysicalDeviceExternalBufferProperties' (PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice)) "pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
pExternalBufferInfo ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties
pPExternalBufferProperties))
ExternalBufferProperties
pExternalBufferProperties <- IO ExternalBufferProperties
-> ContT ExternalBufferProperties IO ExternalBufferProperties
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ExternalBufferProperties
-> ContT ExternalBufferProperties IO ExternalBufferProperties)
-> IO ExternalBufferProperties
-> ContT ExternalBufferProperties IO ExternalBufferProperties
forall a b. (a -> b) -> a -> b
$ ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO ExternalBufferProperties
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ExternalBufferProperties "pExternalBufferProperties" ::: Ptr ExternalBufferProperties
pPExternalBufferProperties
ExternalBufferProperties
-> ContT ExternalBufferProperties IO ExternalBufferProperties
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ExternalBufferProperties
-> ContT ExternalBufferProperties IO ExternalBufferProperties)
-> ExternalBufferProperties
-> ContT ExternalBufferProperties IO ExternalBufferProperties
forall a b. (a -> b) -> a -> b
$ (ExternalBufferProperties
pExternalBufferProperties)
data ExternalMemoryProperties = ExternalMemoryProperties
{
ExternalMemoryProperties -> ExternalMemoryFeatureFlags
externalMemoryFeatures :: ExternalMemoryFeatureFlags
,
ExternalMemoryProperties -> ExternalMemoryHandleTypeFlags
exportFromImportedHandleTypes :: ExternalMemoryHandleTypeFlags
,
ExternalMemoryProperties -> ExternalMemoryHandleTypeFlags
compatibleHandleTypes :: ExternalMemoryHandleTypeFlags
}
deriving (Typeable, ExternalMemoryProperties -> ExternalMemoryProperties -> Bool
(ExternalMemoryProperties -> ExternalMemoryProperties -> Bool)
-> (ExternalMemoryProperties -> ExternalMemoryProperties -> Bool)
-> Eq ExternalMemoryProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExternalMemoryProperties -> ExternalMemoryProperties -> Bool
$c/= :: ExternalMemoryProperties -> ExternalMemoryProperties -> Bool
== :: ExternalMemoryProperties -> ExternalMemoryProperties -> Bool
$c== :: ExternalMemoryProperties -> ExternalMemoryProperties -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ExternalMemoryProperties)
#endif
deriving instance Show ExternalMemoryProperties
instance ToCStruct ExternalMemoryProperties where
withCStruct :: ExternalMemoryProperties
-> (Ptr ExternalMemoryProperties -> IO b) -> IO b
withCStruct x :: ExternalMemoryProperties
x f :: Ptr ExternalMemoryProperties -> IO b
f = Int -> Int -> (Ptr ExternalMemoryProperties -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 12 4 ((Ptr ExternalMemoryProperties -> IO b) -> IO b)
-> (Ptr ExternalMemoryProperties -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr ExternalMemoryProperties
p -> Ptr ExternalMemoryProperties
-> ExternalMemoryProperties -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExternalMemoryProperties
p ExternalMemoryProperties
x (Ptr ExternalMemoryProperties -> IO b
f Ptr ExternalMemoryProperties
p)
pokeCStruct :: Ptr ExternalMemoryProperties
-> ExternalMemoryProperties -> IO b -> IO b
pokeCStruct p :: Ptr ExternalMemoryProperties
p ExternalMemoryProperties{..} f :: IO b
f = do
Ptr ExternalMemoryFeatureFlags
-> ExternalMemoryFeatureFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalMemoryProperties
p Ptr ExternalMemoryProperties
-> Int -> Ptr ExternalMemoryFeatureFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr ExternalMemoryFeatureFlags)) (ExternalMemoryFeatureFlags
externalMemoryFeatures)
Ptr ExternalMemoryHandleTypeFlags
-> ExternalMemoryHandleTypeFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalMemoryProperties
p Ptr ExternalMemoryProperties
-> Int -> Ptr ExternalMemoryHandleTypeFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr ExternalMemoryHandleTypeFlags)) (ExternalMemoryHandleTypeFlags
exportFromImportedHandleTypes)
Ptr ExternalMemoryHandleTypeFlags
-> ExternalMemoryHandleTypeFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalMemoryProperties
p Ptr ExternalMemoryProperties
-> Int -> Ptr ExternalMemoryHandleTypeFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr ExternalMemoryHandleTypeFlags)) (ExternalMemoryHandleTypeFlags
compatibleHandleTypes)
IO b
f
cStructSize :: Int
cStructSize = 12
cStructAlignment :: Int
cStructAlignment = 4
pokeZeroCStruct :: Ptr ExternalMemoryProperties -> IO b -> IO b
pokeZeroCStruct p :: Ptr ExternalMemoryProperties
p f :: IO b
f = do
Ptr ExternalMemoryFeatureFlags
-> ExternalMemoryFeatureFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalMemoryProperties
p Ptr ExternalMemoryProperties
-> Int -> Ptr ExternalMemoryFeatureFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr ExternalMemoryFeatureFlags)) (ExternalMemoryFeatureFlags
forall a. Zero a => a
zero)
Ptr ExternalMemoryHandleTypeFlags
-> ExternalMemoryHandleTypeFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalMemoryProperties
p Ptr ExternalMemoryProperties
-> Int -> Ptr ExternalMemoryHandleTypeFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr ExternalMemoryHandleTypeFlags)) (ExternalMemoryHandleTypeFlags
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ExternalMemoryProperties where
peekCStruct :: Ptr ExternalMemoryProperties -> IO ExternalMemoryProperties
peekCStruct p :: Ptr ExternalMemoryProperties
p = do
ExternalMemoryFeatureFlags
externalMemoryFeatures <- Ptr ExternalMemoryFeatureFlags -> IO ExternalMemoryFeatureFlags
forall a. Storable a => Ptr a -> IO a
peek @ExternalMemoryFeatureFlags ((Ptr ExternalMemoryProperties
p Ptr ExternalMemoryProperties
-> Int -> Ptr ExternalMemoryFeatureFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr ExternalMemoryFeatureFlags))
ExternalMemoryHandleTypeFlags
exportFromImportedHandleTypes <- Ptr ExternalMemoryHandleTypeFlags
-> IO ExternalMemoryHandleTypeFlags
forall a. Storable a => Ptr a -> IO a
peek @ExternalMemoryHandleTypeFlags ((Ptr ExternalMemoryProperties
p Ptr ExternalMemoryProperties
-> Int -> Ptr ExternalMemoryHandleTypeFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr ExternalMemoryHandleTypeFlags))
ExternalMemoryHandleTypeFlags
compatibleHandleTypes <- Ptr ExternalMemoryHandleTypeFlags
-> IO ExternalMemoryHandleTypeFlags
forall a. Storable a => Ptr a -> IO a
peek @ExternalMemoryHandleTypeFlags ((Ptr ExternalMemoryProperties
p Ptr ExternalMemoryProperties
-> Int -> Ptr ExternalMemoryHandleTypeFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr ExternalMemoryHandleTypeFlags))
ExternalMemoryProperties -> IO ExternalMemoryProperties
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ExternalMemoryProperties -> IO ExternalMemoryProperties)
-> ExternalMemoryProperties -> IO ExternalMemoryProperties
forall a b. (a -> b) -> a -> b
$ ExternalMemoryFeatureFlags
-> ExternalMemoryHandleTypeFlags
-> ExternalMemoryHandleTypeFlags
-> ExternalMemoryProperties
ExternalMemoryProperties
ExternalMemoryFeatureFlags
externalMemoryFeatures ExternalMemoryHandleTypeFlags
exportFromImportedHandleTypes ExternalMemoryHandleTypeFlags
compatibleHandleTypes
instance Storable ExternalMemoryProperties where
sizeOf :: ExternalMemoryProperties -> Int
sizeOf ~ExternalMemoryProperties
_ = 12
alignment :: ExternalMemoryProperties -> Int
alignment ~ExternalMemoryProperties
_ = 4
peek :: Ptr ExternalMemoryProperties -> IO ExternalMemoryProperties
peek = Ptr ExternalMemoryProperties -> IO ExternalMemoryProperties
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ExternalMemoryProperties -> ExternalMemoryProperties -> IO ()
poke ptr :: Ptr ExternalMemoryProperties
ptr poked :: ExternalMemoryProperties
poked = Ptr ExternalMemoryProperties
-> ExternalMemoryProperties -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExternalMemoryProperties
ptr ExternalMemoryProperties
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ExternalMemoryProperties where
zero :: ExternalMemoryProperties
zero = ExternalMemoryFeatureFlags
-> ExternalMemoryHandleTypeFlags
-> ExternalMemoryHandleTypeFlags
-> ExternalMemoryProperties
ExternalMemoryProperties
ExternalMemoryFeatureFlags
forall a. Zero a => a
zero
ExternalMemoryHandleTypeFlags
forall a. Zero a => a
zero
ExternalMemoryHandleTypeFlags
forall a. Zero a => a
zero
data PhysicalDeviceExternalImageFormatInfo = PhysicalDeviceExternalImageFormatInfo
{
PhysicalDeviceExternalImageFormatInfo
-> ExternalMemoryHandleTypeFlags
handleType :: ExternalMemoryHandleTypeFlagBits }
deriving (Typeable, PhysicalDeviceExternalImageFormatInfo
-> PhysicalDeviceExternalImageFormatInfo -> Bool
(PhysicalDeviceExternalImageFormatInfo
-> PhysicalDeviceExternalImageFormatInfo -> Bool)
-> (PhysicalDeviceExternalImageFormatInfo
-> PhysicalDeviceExternalImageFormatInfo -> Bool)
-> Eq PhysicalDeviceExternalImageFormatInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceExternalImageFormatInfo
-> PhysicalDeviceExternalImageFormatInfo -> Bool
$c/= :: PhysicalDeviceExternalImageFormatInfo
-> PhysicalDeviceExternalImageFormatInfo -> Bool
== :: PhysicalDeviceExternalImageFormatInfo
-> PhysicalDeviceExternalImageFormatInfo -> Bool
$c== :: PhysicalDeviceExternalImageFormatInfo
-> PhysicalDeviceExternalImageFormatInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceExternalImageFormatInfo)
#endif
deriving instance Show PhysicalDeviceExternalImageFormatInfo
instance ToCStruct PhysicalDeviceExternalImageFormatInfo where
withCStruct :: PhysicalDeviceExternalImageFormatInfo
-> (Ptr PhysicalDeviceExternalImageFormatInfo -> IO b) -> IO b
withCStruct x :: PhysicalDeviceExternalImageFormatInfo
x f :: Ptr PhysicalDeviceExternalImageFormatInfo -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceExternalImageFormatInfo -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr PhysicalDeviceExternalImageFormatInfo -> IO b) -> IO b)
-> (Ptr PhysicalDeviceExternalImageFormatInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceExternalImageFormatInfo
p -> Ptr PhysicalDeviceExternalImageFormatInfo
-> PhysicalDeviceExternalImageFormatInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceExternalImageFormatInfo
p PhysicalDeviceExternalImageFormatInfo
x (Ptr PhysicalDeviceExternalImageFormatInfo -> IO b
f Ptr PhysicalDeviceExternalImageFormatInfo
p)
pokeCStruct :: Ptr PhysicalDeviceExternalImageFormatInfo
-> PhysicalDeviceExternalImageFormatInfo -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceExternalImageFormatInfo
p PhysicalDeviceExternalImageFormatInfo{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalImageFormatInfo
p Ptr PhysicalDeviceExternalImageFormatInfo
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalImageFormatInfo
p Ptr PhysicalDeviceExternalImageFormatInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ExternalMemoryHandleTypeFlags
-> ExternalMemoryHandleTypeFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalImageFormatInfo
p Ptr PhysicalDeviceExternalImageFormatInfo
-> Int -> Ptr ExternalMemoryHandleTypeFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ExternalMemoryHandleTypeFlagBits)) (ExternalMemoryHandleTypeFlags
handleType)
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr PhysicalDeviceExternalImageFormatInfo -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceExternalImageFormatInfo
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalImageFormatInfo
p Ptr PhysicalDeviceExternalImageFormatInfo
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalImageFormatInfo
p Ptr PhysicalDeviceExternalImageFormatInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct PhysicalDeviceExternalImageFormatInfo where
peekCStruct :: Ptr PhysicalDeviceExternalImageFormatInfo
-> IO PhysicalDeviceExternalImageFormatInfo
peekCStruct p :: Ptr PhysicalDeviceExternalImageFormatInfo
p = do
ExternalMemoryHandleTypeFlags
handleType <- Ptr ExternalMemoryHandleTypeFlags
-> IO ExternalMemoryHandleTypeFlags
forall a. Storable a => Ptr a -> IO a
peek @ExternalMemoryHandleTypeFlagBits ((Ptr PhysicalDeviceExternalImageFormatInfo
p Ptr PhysicalDeviceExternalImageFormatInfo
-> Int -> Ptr ExternalMemoryHandleTypeFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ExternalMemoryHandleTypeFlagBits))
PhysicalDeviceExternalImageFormatInfo
-> IO PhysicalDeviceExternalImageFormatInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceExternalImageFormatInfo
-> IO PhysicalDeviceExternalImageFormatInfo)
-> PhysicalDeviceExternalImageFormatInfo
-> IO PhysicalDeviceExternalImageFormatInfo
forall a b. (a -> b) -> a -> b
$ ExternalMemoryHandleTypeFlags
-> PhysicalDeviceExternalImageFormatInfo
PhysicalDeviceExternalImageFormatInfo
ExternalMemoryHandleTypeFlags
handleType
instance Storable PhysicalDeviceExternalImageFormatInfo where
sizeOf :: PhysicalDeviceExternalImageFormatInfo -> Int
sizeOf ~PhysicalDeviceExternalImageFormatInfo
_ = 24
alignment :: PhysicalDeviceExternalImageFormatInfo -> Int
alignment ~PhysicalDeviceExternalImageFormatInfo
_ = 8
peek :: Ptr PhysicalDeviceExternalImageFormatInfo
-> IO PhysicalDeviceExternalImageFormatInfo
peek = Ptr PhysicalDeviceExternalImageFormatInfo
-> IO PhysicalDeviceExternalImageFormatInfo
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceExternalImageFormatInfo
-> PhysicalDeviceExternalImageFormatInfo -> IO ()
poke ptr :: Ptr PhysicalDeviceExternalImageFormatInfo
ptr poked :: PhysicalDeviceExternalImageFormatInfo
poked = Ptr PhysicalDeviceExternalImageFormatInfo
-> PhysicalDeviceExternalImageFormatInfo -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceExternalImageFormatInfo
ptr PhysicalDeviceExternalImageFormatInfo
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceExternalImageFormatInfo where
zero :: PhysicalDeviceExternalImageFormatInfo
zero = ExternalMemoryHandleTypeFlags
-> PhysicalDeviceExternalImageFormatInfo
PhysicalDeviceExternalImageFormatInfo
ExternalMemoryHandleTypeFlags
forall a. Zero a => a
zero
data ExternalImageFormatProperties = ExternalImageFormatProperties
{
ExternalImageFormatProperties -> ExternalMemoryProperties
externalMemoryProperties :: ExternalMemoryProperties }
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ExternalImageFormatProperties)
#endif
deriving instance Show ExternalImageFormatProperties
instance ToCStruct ExternalImageFormatProperties where
withCStruct :: ExternalImageFormatProperties
-> (Ptr ExternalImageFormatProperties -> IO b) -> IO b
withCStruct x :: ExternalImageFormatProperties
x f :: Ptr ExternalImageFormatProperties -> IO b
f = Int -> Int -> (Ptr ExternalImageFormatProperties -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr ExternalImageFormatProperties -> IO b) -> IO b)
-> (Ptr ExternalImageFormatProperties -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr ExternalImageFormatProperties
p -> Ptr ExternalImageFormatProperties
-> ExternalImageFormatProperties -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExternalImageFormatProperties
p ExternalImageFormatProperties
x (Ptr ExternalImageFormatProperties -> IO b
f Ptr ExternalImageFormatProperties
p)
pokeCStruct :: Ptr ExternalImageFormatProperties
-> ExternalImageFormatProperties -> IO b -> IO b
pokeCStruct p :: Ptr ExternalImageFormatProperties
p ExternalImageFormatProperties{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalImageFormatProperties
p Ptr ExternalImageFormatProperties -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalImageFormatProperties
p Ptr ExternalImageFormatProperties -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ExternalMemoryProperties -> ExternalMemoryProperties -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalImageFormatProperties
p Ptr ExternalImageFormatProperties
-> Int -> Ptr ExternalMemoryProperties
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ExternalMemoryProperties)) (ExternalMemoryProperties
externalMemoryProperties)
IO b
f
cStructSize :: Int
cStructSize = 32
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr ExternalImageFormatProperties -> IO b -> IO b
pokeZeroCStruct p :: Ptr ExternalImageFormatProperties
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalImageFormatProperties
p Ptr ExternalImageFormatProperties -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalImageFormatProperties
p Ptr ExternalImageFormatProperties -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ExternalMemoryProperties -> ExternalMemoryProperties -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalImageFormatProperties
p Ptr ExternalImageFormatProperties
-> Int -> Ptr ExternalMemoryProperties
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ExternalMemoryProperties)) (ExternalMemoryProperties
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ExternalImageFormatProperties where
peekCStruct :: Ptr ExternalImageFormatProperties
-> IO ExternalImageFormatProperties
peekCStruct p :: Ptr ExternalImageFormatProperties
p = do
ExternalMemoryProperties
externalMemoryProperties <- Ptr ExternalMemoryProperties -> IO ExternalMemoryProperties
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ExternalMemoryProperties ((Ptr ExternalImageFormatProperties
p Ptr ExternalImageFormatProperties
-> Int -> Ptr ExternalMemoryProperties
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ExternalMemoryProperties))
ExternalImageFormatProperties -> IO ExternalImageFormatProperties
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ExternalImageFormatProperties -> IO ExternalImageFormatProperties)
-> ExternalImageFormatProperties
-> IO ExternalImageFormatProperties
forall a b. (a -> b) -> a -> b
$ ExternalMemoryProperties -> ExternalImageFormatProperties
ExternalImageFormatProperties
ExternalMemoryProperties
externalMemoryProperties
instance Storable ExternalImageFormatProperties where
sizeOf :: ExternalImageFormatProperties -> Int
sizeOf ~ExternalImageFormatProperties
_ = 32
alignment :: ExternalImageFormatProperties -> Int
alignment ~ExternalImageFormatProperties
_ = 8
peek :: Ptr ExternalImageFormatProperties
-> IO ExternalImageFormatProperties
peek = Ptr ExternalImageFormatProperties
-> IO ExternalImageFormatProperties
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ExternalImageFormatProperties
-> ExternalImageFormatProperties -> IO ()
poke ptr :: Ptr ExternalImageFormatProperties
ptr poked :: ExternalImageFormatProperties
poked = Ptr ExternalImageFormatProperties
-> ExternalImageFormatProperties -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExternalImageFormatProperties
ptr ExternalImageFormatProperties
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ExternalImageFormatProperties where
zero :: ExternalImageFormatProperties
zero = ExternalMemoryProperties -> ExternalImageFormatProperties
ExternalImageFormatProperties
ExternalMemoryProperties
forall a. Zero a => a
zero
data PhysicalDeviceExternalBufferInfo = PhysicalDeviceExternalBufferInfo
{
PhysicalDeviceExternalBufferInfo -> BufferCreateFlags
flags :: BufferCreateFlags
,
PhysicalDeviceExternalBufferInfo -> BufferUsageFlags
usage :: BufferUsageFlags
,
PhysicalDeviceExternalBufferInfo -> ExternalMemoryHandleTypeFlags
handleType :: ExternalMemoryHandleTypeFlagBits
}
deriving (Typeable, PhysicalDeviceExternalBufferInfo
-> PhysicalDeviceExternalBufferInfo -> Bool
(PhysicalDeviceExternalBufferInfo
-> PhysicalDeviceExternalBufferInfo -> Bool)
-> (PhysicalDeviceExternalBufferInfo
-> PhysicalDeviceExternalBufferInfo -> Bool)
-> Eq PhysicalDeviceExternalBufferInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceExternalBufferInfo
-> PhysicalDeviceExternalBufferInfo -> Bool
$c/= :: PhysicalDeviceExternalBufferInfo
-> PhysicalDeviceExternalBufferInfo -> Bool
== :: PhysicalDeviceExternalBufferInfo
-> PhysicalDeviceExternalBufferInfo -> Bool
$c== :: PhysicalDeviceExternalBufferInfo
-> PhysicalDeviceExternalBufferInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceExternalBufferInfo)
#endif
deriving instance Show PhysicalDeviceExternalBufferInfo
instance ToCStruct PhysicalDeviceExternalBufferInfo where
withCStruct :: PhysicalDeviceExternalBufferInfo
-> (("pExternalBufferInfo"
::: Ptr PhysicalDeviceExternalBufferInfo)
-> IO b)
-> IO b
withCStruct x :: PhysicalDeviceExternalBufferInfo
x f :: ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> IO b
f = Int
-> Int
-> (("pExternalBufferInfo"
::: Ptr PhysicalDeviceExternalBufferInfo)
-> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> IO b)
-> IO b)
-> (("pExternalBufferInfo"
::: Ptr PhysicalDeviceExternalBufferInfo)
-> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p -> ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> PhysicalDeviceExternalBufferInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p PhysicalDeviceExternalBufferInfo
x (("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> IO b
f "pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p)
pokeCStruct :: ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> PhysicalDeviceExternalBufferInfo -> IO b -> IO b
pokeCStruct p :: "pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p PhysicalDeviceExternalBufferInfo{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr BufferCreateFlags -> BufferCreateFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> Int -> Ptr BufferCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr BufferCreateFlags)) (BufferCreateFlags
flags)
Ptr BufferUsageFlags -> BufferUsageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> Int -> Ptr BufferUsageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr BufferUsageFlags)) (BufferUsageFlags
usage)
Ptr ExternalMemoryHandleTypeFlags
-> ExternalMemoryHandleTypeFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> Int -> Ptr ExternalMemoryHandleTypeFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ExternalMemoryHandleTypeFlagBits)) (ExternalMemoryHandleTypeFlags
handleType)
IO b
f
cStructSize :: Int
cStructSize = 32
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> IO b -> IO b
pokeZeroCStruct p :: "pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr BufferUsageFlags -> BufferUsageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> Int -> Ptr BufferUsageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr BufferUsageFlags)) (BufferUsageFlags
forall a. Zero a => a
zero)
Ptr ExternalMemoryHandleTypeFlags
-> ExternalMemoryHandleTypeFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> Int -> Ptr ExternalMemoryHandleTypeFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ExternalMemoryHandleTypeFlagBits)) (ExternalMemoryHandleTypeFlags
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct PhysicalDeviceExternalBufferInfo where
peekCStruct :: ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> IO PhysicalDeviceExternalBufferInfo
peekCStruct p :: "pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p = do
BufferCreateFlags
flags <- Ptr BufferCreateFlags -> IO BufferCreateFlags
forall a. Storable a => Ptr a -> IO a
peek @BufferCreateFlags (("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> Int -> Ptr BufferCreateFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr BufferCreateFlags))
BufferUsageFlags
usage <- Ptr BufferUsageFlags -> IO BufferUsageFlags
forall a. Storable a => Ptr a -> IO a
peek @BufferUsageFlags (("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> Int -> Ptr BufferUsageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr BufferUsageFlags))
ExternalMemoryHandleTypeFlags
handleType <- Ptr ExternalMemoryHandleTypeFlags
-> IO ExternalMemoryHandleTypeFlags
forall a. Storable a => Ptr a -> IO a
peek @ExternalMemoryHandleTypeFlagBits (("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
p ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> Int -> Ptr ExternalMemoryHandleTypeFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ExternalMemoryHandleTypeFlagBits))
PhysicalDeviceExternalBufferInfo
-> IO PhysicalDeviceExternalBufferInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceExternalBufferInfo
-> IO PhysicalDeviceExternalBufferInfo)
-> PhysicalDeviceExternalBufferInfo
-> IO PhysicalDeviceExternalBufferInfo
forall a b. (a -> b) -> a -> b
$ BufferCreateFlags
-> BufferUsageFlags
-> ExternalMemoryHandleTypeFlags
-> PhysicalDeviceExternalBufferInfo
PhysicalDeviceExternalBufferInfo
BufferCreateFlags
flags BufferUsageFlags
usage ExternalMemoryHandleTypeFlags
handleType
instance Storable PhysicalDeviceExternalBufferInfo where
sizeOf :: PhysicalDeviceExternalBufferInfo -> Int
sizeOf ~PhysicalDeviceExternalBufferInfo
_ = 32
alignment :: PhysicalDeviceExternalBufferInfo -> Int
alignment ~PhysicalDeviceExternalBufferInfo
_ = 8
peek :: ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> IO PhysicalDeviceExternalBufferInfo
peek = ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> IO PhysicalDeviceExternalBufferInfo
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> PhysicalDeviceExternalBufferInfo -> IO ()
poke ptr :: "pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
ptr poked :: PhysicalDeviceExternalBufferInfo
poked = ("pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo)
-> PhysicalDeviceExternalBufferInfo -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pExternalBufferInfo" ::: Ptr PhysicalDeviceExternalBufferInfo
ptr PhysicalDeviceExternalBufferInfo
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceExternalBufferInfo where
zero :: PhysicalDeviceExternalBufferInfo
zero = BufferCreateFlags
-> BufferUsageFlags
-> ExternalMemoryHandleTypeFlags
-> PhysicalDeviceExternalBufferInfo
PhysicalDeviceExternalBufferInfo
BufferCreateFlags
forall a. Zero a => a
zero
BufferUsageFlags
forall a. Zero a => a
zero
ExternalMemoryHandleTypeFlags
forall a. Zero a => a
zero
data ExternalBufferProperties = ExternalBufferProperties
{
ExternalBufferProperties -> ExternalMemoryProperties
externalMemoryProperties :: ExternalMemoryProperties }
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ExternalBufferProperties)
#endif
deriving instance Show ExternalBufferProperties
instance ToCStruct ExternalBufferProperties where
withCStruct :: ExternalBufferProperties
-> (("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO b)
-> IO b
withCStruct x :: ExternalBufferProperties
x f :: ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO b
f = Int
-> Int
-> (("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO b)
-> IO b)
-> (("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pExternalBufferProperties" ::: Ptr ExternalBufferProperties
p -> ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> ExternalBufferProperties -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pExternalBufferProperties" ::: Ptr ExternalBufferProperties
p ExternalBufferProperties
x (("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO b
f "pExternalBufferProperties" ::: Ptr ExternalBufferProperties
p)
pokeCStruct :: ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> ExternalBufferProperties -> IO b -> IO b
pokeCStruct p :: "pExternalBufferProperties" ::: Ptr ExternalBufferProperties
p ExternalBufferProperties{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalBufferProperties" ::: Ptr ExternalBufferProperties
p ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalBufferProperties" ::: Ptr ExternalBufferProperties
p ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ExternalMemoryProperties -> ExternalMemoryProperties -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalBufferProperties" ::: Ptr ExternalBufferProperties
p ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> Int -> Ptr ExternalMemoryProperties
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ExternalMemoryProperties)) (ExternalMemoryProperties
externalMemoryProperties)
IO b
f
cStructSize :: Int
cStructSize = 32
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO b -> IO b
pokeZeroCStruct p :: "pExternalBufferProperties" ::: Ptr ExternalBufferProperties
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalBufferProperties" ::: Ptr ExternalBufferProperties
p ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalBufferProperties" ::: Ptr ExternalBufferProperties
p ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ExternalMemoryProperties -> ExternalMemoryProperties -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pExternalBufferProperties" ::: Ptr ExternalBufferProperties
p ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> Int -> Ptr ExternalMemoryProperties
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ExternalMemoryProperties)) (ExternalMemoryProperties
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ExternalBufferProperties where
peekCStruct :: ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO ExternalBufferProperties
peekCStruct p :: "pExternalBufferProperties" ::: Ptr ExternalBufferProperties
p = do
ExternalMemoryProperties
externalMemoryProperties <- Ptr ExternalMemoryProperties -> IO ExternalMemoryProperties
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ExternalMemoryProperties (("pExternalBufferProperties" ::: Ptr ExternalBufferProperties
p ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> Int -> Ptr ExternalMemoryProperties
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr ExternalMemoryProperties))
ExternalBufferProperties -> IO ExternalBufferProperties
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ExternalBufferProperties -> IO ExternalBufferProperties)
-> ExternalBufferProperties -> IO ExternalBufferProperties
forall a b. (a -> b) -> a -> b
$ ExternalMemoryProperties -> ExternalBufferProperties
ExternalBufferProperties
ExternalMemoryProperties
externalMemoryProperties
instance Storable ExternalBufferProperties where
sizeOf :: ExternalBufferProperties -> Int
sizeOf ~ExternalBufferProperties
_ = 32
alignment :: ExternalBufferProperties -> Int
alignment ~ExternalBufferProperties
_ = 8
peek :: ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO ExternalBufferProperties
peek = ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> IO ExternalBufferProperties
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> ExternalBufferProperties -> IO ()
poke ptr :: "pExternalBufferProperties" ::: Ptr ExternalBufferProperties
ptr poked :: ExternalBufferProperties
poked = ("pExternalBufferProperties" ::: Ptr ExternalBufferProperties)
-> ExternalBufferProperties -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pExternalBufferProperties" ::: Ptr ExternalBufferProperties
ptr ExternalBufferProperties
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ExternalBufferProperties where
zero :: ExternalBufferProperties
zero = ExternalMemoryProperties -> ExternalBufferProperties
ExternalBufferProperties
ExternalMemoryProperties
forall a. Zero a => a
zero
data PhysicalDeviceIDProperties = PhysicalDeviceIDProperties
{
PhysicalDeviceIDProperties -> ByteString
deviceUUID :: ByteString
,
PhysicalDeviceIDProperties -> ByteString
driverUUID :: ByteString
,
PhysicalDeviceIDProperties -> ByteString
deviceLUID :: ByteString
,
PhysicalDeviceIDProperties -> Word32
deviceNodeMask :: Word32
,
PhysicalDeviceIDProperties -> Bool
deviceLUIDValid :: Bool
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceIDProperties)
#endif
deriving instance Show PhysicalDeviceIDProperties
instance ToCStruct PhysicalDeviceIDProperties where
withCStruct :: PhysicalDeviceIDProperties
-> (Ptr PhysicalDeviceIDProperties -> IO b) -> IO b
withCStruct x :: PhysicalDeviceIDProperties
x f :: Ptr PhysicalDeviceIDProperties -> IO b
f = Int -> Int -> (Ptr PhysicalDeviceIDProperties -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 64 8 ((Ptr PhysicalDeviceIDProperties -> IO b) -> IO b)
-> (Ptr PhysicalDeviceIDProperties -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceIDProperties
p -> Ptr PhysicalDeviceIDProperties
-> PhysicalDeviceIDProperties -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceIDProperties
p PhysicalDeviceIDProperties
x (Ptr PhysicalDeviceIDProperties -> IO b
f Ptr PhysicalDeviceIDProperties
p)
pokeCStruct :: Ptr PhysicalDeviceIDProperties
-> PhysicalDeviceIDProperties -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceIDProperties
p PhysicalDeviceIDProperties{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr (FixedArray UUID_SIZE Word8) -> ByteString -> IO ()
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n Word8) -> ByteString -> IO ()
pokeFixedLengthByteString ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties
-> Int -> Ptr (FixedArray UUID_SIZE Word8)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (FixedArray UUID_SIZE Word8))) (ByteString
deviceUUID)
Ptr (FixedArray UUID_SIZE Word8) -> ByteString -> IO ()
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n Word8) -> ByteString -> IO ()
pokeFixedLengthByteString ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties
-> Int -> Ptr (FixedArray UUID_SIZE Word8)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (FixedArray UUID_SIZE Word8))) (ByteString
driverUUID)
Ptr (FixedArray LUID_SIZE Word8) -> ByteString -> IO ()
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n Word8) -> ByteString -> IO ()
pokeFixedLengthByteString ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties
-> Int -> Ptr (FixedArray LUID_SIZE Word8)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (FixedArray LUID_SIZE Word8))) (ByteString
deviceLUID)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Word32)) (Word32
deviceNodeMask)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
deviceLUIDValid))
IO b
f
cStructSize :: Int
cStructSize = 64
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr PhysicalDeviceIDProperties -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceIDProperties
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr (FixedArray UUID_SIZE Word8) -> ByteString -> IO ()
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n Word8) -> ByteString -> IO ()
pokeFixedLengthByteString ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties
-> Int -> Ptr (FixedArray UUID_SIZE Word8)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (FixedArray UUID_SIZE Word8))) (ByteString
forall a. Monoid a => a
mempty)
Ptr (FixedArray UUID_SIZE Word8) -> ByteString -> IO ()
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n Word8) -> ByteString -> IO ()
pokeFixedLengthByteString ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties
-> Int -> Ptr (FixedArray UUID_SIZE Word8)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (FixedArray UUID_SIZE Word8))) (ByteString
forall a. Monoid a => a
mempty)
Ptr (FixedArray LUID_SIZE Word8) -> ByteString -> IO ()
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n Word8) -> ByteString -> IO ()
pokeFixedLengthByteString ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties
-> Int -> Ptr (FixedArray LUID_SIZE Word8)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (FixedArray LUID_SIZE Word8))) (ByteString
forall a. Monoid a => a
mempty)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceIDProperties where
peekCStruct :: Ptr PhysicalDeviceIDProperties -> IO PhysicalDeviceIDProperties
peekCStruct p :: Ptr PhysicalDeviceIDProperties
p = do
ByteString
deviceUUID <- Ptr (FixedArray UUID_SIZE Word8) -> IO ByteString
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n Word8) -> IO ByteString
peekByteStringFromSizedVectorPtr ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties
-> Int -> Ptr (FixedArray UUID_SIZE Word8)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (FixedArray UUID_SIZE Word8)))
ByteString
driverUUID <- Ptr (FixedArray UUID_SIZE Word8) -> IO ByteString
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n Word8) -> IO ByteString
peekByteStringFromSizedVectorPtr ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties
-> Int -> Ptr (FixedArray UUID_SIZE Word8)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (FixedArray UUID_SIZE Word8)))
ByteString
deviceLUID <- Ptr (FixedArray LUID_SIZE Word8) -> IO ByteString
forall (n :: Nat).
KnownNat n =>
Ptr (FixedArray n Word8) -> IO ByteString
peekByteStringFromSizedVectorPtr ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties
-> Int -> Ptr (FixedArray LUID_SIZE Word8)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr (FixedArray LUID_SIZE Word8)))
Word32
deviceNodeMask <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Word32))
Bool32
deviceLUIDValid <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceIDProperties
p Ptr PhysicalDeviceIDProperties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Bool32))
PhysicalDeviceIDProperties -> IO PhysicalDeviceIDProperties
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceIDProperties -> IO PhysicalDeviceIDProperties)
-> PhysicalDeviceIDProperties -> IO PhysicalDeviceIDProperties
forall a b. (a -> b) -> a -> b
$ ByteString
-> ByteString
-> ByteString
-> Word32
-> Bool
-> PhysicalDeviceIDProperties
PhysicalDeviceIDProperties
ByteString
deviceUUID ByteString
driverUUID ByteString
deviceLUID Word32
deviceNodeMask (Bool32 -> Bool
bool32ToBool Bool32
deviceLUIDValid)
instance Storable PhysicalDeviceIDProperties where
sizeOf :: PhysicalDeviceIDProperties -> Int
sizeOf ~PhysicalDeviceIDProperties
_ = 64
alignment :: PhysicalDeviceIDProperties -> Int
alignment ~PhysicalDeviceIDProperties
_ = 8
peek :: Ptr PhysicalDeviceIDProperties -> IO PhysicalDeviceIDProperties
peek = Ptr PhysicalDeviceIDProperties -> IO PhysicalDeviceIDProperties
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceIDProperties
-> PhysicalDeviceIDProperties -> IO ()
poke ptr :: Ptr PhysicalDeviceIDProperties
ptr poked :: PhysicalDeviceIDProperties
poked = Ptr PhysicalDeviceIDProperties
-> PhysicalDeviceIDProperties -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceIDProperties
ptr PhysicalDeviceIDProperties
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceIDProperties where
zero :: PhysicalDeviceIDProperties
zero = ByteString
-> ByteString
-> ByteString
-> Word32
-> Bool
-> PhysicalDeviceIDProperties
PhysicalDeviceIDProperties
ByteString
forall a. Monoid a => a
mempty
ByteString
forall a. Monoid a => a
mempty
ByteString
forall a. Monoid a => a
mempty
Word32
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero