{-# language CPP #-}
module VulkanMemoryAllocator ( createAllocator
, withAllocator
, destroyAllocator
, getAllocatorInfo
, getPhysicalDeviceProperties
, getMemoryProperties
, getMemoryTypeProperties
, setCurrentFrameIndex
, calculateStatistics
, getHeapBudgets
, findMemoryTypeIndex
, findMemoryTypeIndexForBufferInfo
, findMemoryTypeIndexForImageInfo
, createPool
, withPool
, destroyPool
, getPoolStatistics
, calculatePoolStatistics
, checkPoolCorruption
, getPoolName
, setPoolName
, allocateMemory
, withMemory
, allocateMemoryPages
, withMemoryPages
, allocateMemoryForBuffer
, withMemoryForBuffer
, allocateMemoryForImage
, withMemoryForImage
, freeMemory
, freeMemoryPages
, getAllocationInfo
, setAllocationUserData
, setAllocationName
, getAllocationMemoryProperties
, mapMemory
, withMappedMemory
, unmapMemory
, flushAllocation
, invalidateAllocation
, flushAllocations
, invalidateAllocations
, checkCorruption
, beginDefragmentation
, withDefragmentation
, endDefragmentation
, beginDefragmentationPass
, useDefragmentationPass
, endDefragmentationPass
, bindBufferMemory
, bindBufferMemory2
, bindImageMemory
, bindImageMemory2
, createBuffer
, withBuffer
, createBufferWithAlignment
, createAliasingBuffer
, createAliasingBuffer2
, destroyBuffer
, createImage
, withImage
, createAliasingImage
, createAliasingImage2
, destroyImage
, createVirtualBlock
, withVirtualBlock
, destroyVirtualBlock
, isVirtualBlockEmpty
, getVirtualAllocationInfo
, virtualAllocate
, withVirtualAllocation
, virtualFree
, clearVirtualBlock
, setVirtualAllocationUserData
, getVirtualBlockStatistics
, calculateVirtualBlockStatistics
, buildVirtualBlockStatsString
, freeVirtualBlockStatsString
, buildStatsString
, freeStatsString
, AllocatorCreateFlags
, AllocatorCreateFlagBits( ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT
, ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT
, ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT
, ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT
, ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT
, ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT
, ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT
, ..
)
, MemoryUsage( MEMORY_USAGE_UNKNOWN
, MEMORY_USAGE_GPU_ONLY
, MEMORY_USAGE_CPU_ONLY
, MEMORY_USAGE_CPU_TO_GPU
, MEMORY_USAGE_GPU_TO_CPU
, MEMORY_USAGE_CPU_COPY
, MEMORY_USAGE_GPU_LAZILY_ALLOCATED
, MEMORY_USAGE_AUTO
, MEMORY_USAGE_AUTO_PREFER_DEVICE
, MEMORY_USAGE_AUTO_PREFER_HOST
, ..
)
, AllocationCreateFlags
, AllocationCreateFlagBits( ALLOCATION_CREATE_DEDICATED_MEMORY_BIT
, ALLOCATION_CREATE_NEVER_ALLOCATE_BIT
, ALLOCATION_CREATE_MAPPED_BIT
, ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT
, ALLOCATION_CREATE_UPPER_ADDRESS_BIT
, ALLOCATION_CREATE_DONT_BIND_BIT
, ALLOCATION_CREATE_WITHIN_BUDGET_BIT
, ALLOCATION_CREATE_CAN_ALIAS_BIT
, ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT
, ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT
, ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT
, ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT
, ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT
, ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT
, ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT
, ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT
, ALLOCATION_CREATE_STRATEGY_MASK
, ..
)
, PoolCreateFlags
, PoolCreateFlagBits( POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT
, POOL_CREATE_LINEAR_ALGORITHM_BIT
, POOL_CREATE_ALGORITHM_MASK
, ..
)
, DefragmentationFlags
, DefragmentationFlagBits( DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT
, DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT
, DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT
, DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT
, DEFRAGMENTATION_FLAG_ALGORITHM_MASK
, ..
)
, DefragmentationMoveOperation( DEFRAGMENTATION_MOVE_OPERATION_COPY
, DEFRAGMENTATION_MOVE_OPERATION_IGNORE
, DEFRAGMENTATION_MOVE_OPERATION_DESTROY
, ..
)
, VirtualBlockCreateFlags
, VirtualBlockCreateFlagBits( VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT
, VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK
, ..
)
, VirtualAllocationCreateFlags
, VirtualAllocationCreateFlagBits( VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT
, VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT
, VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT
, VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT
, VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK
, ..
)
, Allocator(..)
, Pool(..)
, Allocation(..)
, DefragmentationContext(..)
, VirtualAllocation(..)
, VirtualBlock(..)
, PFN_vmaAllocateDeviceMemoryFunction
, FN_vmaAllocateDeviceMemoryFunction
, PFN_vmaFreeDeviceMemoryFunction
, FN_vmaFreeDeviceMemoryFunction
, DeviceMemoryCallbacks(..)
, VulkanFunctions(..)
, AllocatorCreateInfo(..)
, AllocatorInfo(..)
, Statistics(..)
, DetailedStatistics(..)
, TotalStatistics(..)
, Budget(..)
, AllocationCreateInfo(..)
, PoolCreateInfo(..)
, AllocationInfo(..)
, PFN_vmaCheckDefragmentationBreakFunction
, FN_vmaCheckDefragmentationBreakFunction
, DefragmentationInfo(..)
, DefragmentationMove(..)
, DefragmentationPassMoveInfo(..)
, DefragmentationStats(..)
, VirtualBlockCreateInfo(..)
, VirtualAllocationCreateInfo(..)
, VirtualAllocationInfo(..)
) where
import Data.Bits (Bits)
import Data.Bits (FiniteBits)
import Vulkan (AllocationCallbacks)
import Vulkan (BindBufferMemoryInfo)
import Vulkan (BindImageMemoryInfo)
import Vulkan (Bool32)
import Vulkan (Buffer)
import Vulkan (BufferCopy)
import Vulkan (BufferCreateInfo)
import Vulkan (BufferMemoryRequirementsInfo2)
import Vulkan (CommandBuffer_T)
import Vulkan (DeviceBufferMemoryRequirements)
import Vulkan (DeviceImageMemoryRequirements)
import Vulkan (DeviceMemory)
import Vulkan (DeviceSize)
import Vulkan (Device_T)
import Vulkan (ExternalMemoryHandleTypeFlagsKHR)
import Vulkan (Flags)
import Vulkan (Image)
import Vulkan (ImageCreateInfo)
import Vulkan (ImageMemoryRequirementsInfo2)
import Vulkan (Instance_T)
import Vulkan (MappedMemoryRange)
import Vulkan (MemoryAllocateInfo)
import Vulkan (MemoryMapFlags)
import Vulkan (MemoryPropertyFlags)
import Vulkan (MemoryRequirements)
import Vulkan (MemoryRequirements2)
import Vulkan (PhysicalDeviceMemoryProperties)
import Vulkan (PhysicalDeviceMemoryProperties2)
import Vulkan (PhysicalDeviceProperties)
import Vulkan (PhysicalDevice_T)
import Vulkan (Result)
import Vulkan.CStruct.Utils (FixedArray)
import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import Vulkan.Internal.Utils (traceAroundEvent)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.CStruct.Utils (lowerArrayPtr)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
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 Foreign.Marshal.Utils (maybePeek)
import GHC.Base (when)
import GHC.IO (throwIO)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Show (showParen)
import GHC.Show (showString)
import GHC.Show (showsPrec)
import Numeric (showHex)
import Data.ByteString (packCString)
import Data.ByteString (useAsCString)
import Data.Coerce (coerce)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import qualified Data.Vector (null)
import Vulkan.Core10.APIConstants (pattern MAX_MEMORY_HEAPS)
import Vulkan.Core10.APIConstants (pattern MAX_MEMORY_TYPES)
import Vulkan.Core10.Enums.Result (pattern SUCCESS)
import Foreign.C.Types (CChar(..))
import Foreign.C.Types (CSize(..))
import Vulkan (Bool32(..))
import Vulkan (Buffer(..))
import Vulkan (Image(..))
import Vulkan (MemoryPropertyFlagBits(..))
import Vulkan (Result(..))
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.APIConstants (IsHandle)
import Vulkan.Core10.APIConstants (MAX_MEMORY_HEAPS)
import Vulkan.Core10.APIConstants (MAX_MEMORY_TYPES)
import Vulkan.Exception (VulkanException(..))
import Vulkan.NamedType ((:::))
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.Typeable (Typeable)
import Foreign.C.Types (CChar)
import Foreign.C.Types (CFloat)
import Foreign.C.Types (CFloat(..))
import Foreign.C.Types (CFloat(CFloat))
import Foreign.C.Types (CSize)
import Foreign.C.Types (CSize(..))
import Foreign.C.Types (CSize(CSize))
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 Data.Int (Int32)
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Data.Word (Word32)
import Data.Word (Word64)
import Data.ByteString (ByteString)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaCreateAllocator" ffiVmaCreateAllocator
:: Ptr AllocatorCreateInfo -> Ptr Allocator -> IO Result
createAllocator :: forall io
. (MonadIO io)
=>
AllocatorCreateInfo
-> io (Allocator)
createAllocator :: forall (io :: * -> *).
MonadIO io =>
AllocatorCreateInfo -> io Allocator
createAllocator AllocatorCreateInfo
createInfo = 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
Ptr AllocatorCreateInfo
pCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocatorCreateInfo
createInfo)
Ptr Allocator
pPAllocator <- 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 @Allocator 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
"vmaCreateAllocator" ((Ptr AllocatorCreateInfo -> Ptr Allocator -> IO Result
ffiVmaCreateAllocator)
Ptr AllocatorCreateInfo
pCreateInfo
(Ptr Allocator
pPAllocator))
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))
Allocator
pAllocator <- 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 @Allocator Ptr Allocator
pPAllocator
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Allocator
pAllocator)
withAllocator :: forall io r . MonadIO io => AllocatorCreateInfo -> (io Allocator -> (Allocator -> io ()) -> r) -> r
withAllocator :: forall (io :: * -> *) r.
MonadIO io =>
AllocatorCreateInfo
-> (io Allocator -> (Allocator -> io ()) -> r) -> r
withAllocator AllocatorCreateInfo
pCreateInfo io Allocator -> (Allocator -> io ()) -> r
b =
io Allocator -> (Allocator -> io ()) -> r
b (forall (io :: * -> *).
MonadIO io =>
AllocatorCreateInfo -> io Allocator
createAllocator AllocatorCreateInfo
pCreateInfo)
(\(Allocator
o0) -> forall (io :: * -> *). MonadIO io => Allocator -> io ()
destroyAllocator Allocator
o0)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaDestroyAllocator" ffiVmaDestroyAllocator
:: Allocator -> IO ()
destroyAllocator :: forall io
. (MonadIO io)
=>
Allocator
-> io ()
destroyAllocator :: forall (io :: * -> *). MonadIO io => Allocator -> io ()
destroyAllocator Allocator
allocator = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaDestroyAllocator" ((Allocator -> IO ()
ffiVmaDestroyAllocator) (Allocator
allocator))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaGetAllocatorInfo" ffiVmaGetAllocatorInfo
:: Allocator -> Ptr AllocatorInfo -> IO ()
getAllocatorInfo :: forall io
. (MonadIO io)
=>
Allocator
-> io (AllocatorInfo)
getAllocatorInfo :: forall (io :: * -> *). MonadIO io => Allocator -> io AllocatorInfo
getAllocatorInfo Allocator
allocator = 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
Ptr AllocatorInfo
pPAllocatorInfo <- 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 @AllocatorInfo)
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
"vmaGetAllocatorInfo" ((Allocator -> Ptr AllocatorInfo -> IO ()
ffiVmaGetAllocatorInfo)
(Allocator
allocator)
(Ptr AllocatorInfo
pPAllocatorInfo))
AllocatorInfo
pAllocatorInfo <- 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 @AllocatorInfo Ptr AllocatorInfo
pPAllocatorInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (AllocatorInfo
pAllocatorInfo)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaGetPhysicalDeviceProperties" ffiVmaGetPhysicalDeviceProperties
:: Allocator -> Ptr (Ptr PhysicalDeviceProperties) -> IO ()
getPhysicalDeviceProperties :: forall io
. (MonadIO io)
=>
Allocator
-> io (Ptr PhysicalDeviceProperties)
getPhysicalDeviceProperties :: forall (io :: * -> *).
MonadIO io =>
Allocator -> io (Ptr PhysicalDeviceProperties)
getPhysicalDeviceProperties Allocator
allocator = 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
Ptr (Ptr PhysicalDeviceProperties)
pPpPhysicalDeviceProperties <- 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 @(Ptr PhysicalDeviceProperties) Int
8) forall a. Ptr a -> IO ()
free
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
"vmaGetPhysicalDeviceProperties" ((Allocator -> Ptr (Ptr PhysicalDeviceProperties) -> IO ()
ffiVmaGetPhysicalDeviceProperties)
(Allocator
allocator)
(Ptr (Ptr PhysicalDeviceProperties)
pPpPhysicalDeviceProperties))
Ptr PhysicalDeviceProperties
ppPhysicalDeviceProperties <- 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 @(Ptr PhysicalDeviceProperties) Ptr (Ptr PhysicalDeviceProperties)
pPpPhysicalDeviceProperties
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Ptr PhysicalDeviceProperties
ppPhysicalDeviceProperties)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaGetMemoryProperties" ffiVmaGetMemoryProperties
:: Allocator -> Ptr (Ptr PhysicalDeviceMemoryProperties) -> IO ()
getMemoryProperties :: forall io
. (MonadIO io)
=>
Allocator
-> io (Ptr PhysicalDeviceMemoryProperties)
getMemoryProperties :: forall (io :: * -> *).
MonadIO io =>
Allocator -> io (Ptr PhysicalDeviceMemoryProperties)
getMemoryProperties Allocator
allocator = 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
Ptr (Ptr PhysicalDeviceMemoryProperties)
pPpPhysicalDeviceMemoryProperties <- 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 @(Ptr PhysicalDeviceMemoryProperties) Int
8) forall a. Ptr a -> IO ()
free
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
"vmaGetMemoryProperties" ((Allocator -> Ptr (Ptr PhysicalDeviceMemoryProperties) -> IO ()
ffiVmaGetMemoryProperties)
(Allocator
allocator)
(Ptr (Ptr PhysicalDeviceMemoryProperties)
pPpPhysicalDeviceMemoryProperties))
Ptr PhysicalDeviceMemoryProperties
ppPhysicalDeviceMemoryProperties <- 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 @(Ptr PhysicalDeviceMemoryProperties) Ptr (Ptr PhysicalDeviceMemoryProperties)
pPpPhysicalDeviceMemoryProperties
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Ptr PhysicalDeviceMemoryProperties
ppPhysicalDeviceMemoryProperties)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaGetMemoryTypeProperties" ffiVmaGetMemoryTypeProperties
:: Allocator -> Word32 -> Ptr MemoryPropertyFlags -> IO ()
getMemoryTypeProperties :: forall io
. (MonadIO io)
=>
Allocator
->
("memoryTypeIndex" ::: Word32)
-> io (MemoryPropertyFlags)
getMemoryTypeProperties :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Flags -> io MemoryPropertyFlags
getMemoryTypeProperties Allocator
allocator Flags
memoryTypeIndex = 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
Ptr MemoryPropertyFlags
pPFlags <- 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 @MemoryPropertyFlags Int
4) forall a. Ptr a -> IO ()
free
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
"vmaGetMemoryTypeProperties" ((Allocator -> Flags -> Ptr MemoryPropertyFlags -> IO ()
ffiVmaGetMemoryTypeProperties)
(Allocator
allocator)
(Flags
memoryTypeIndex)
(Ptr MemoryPropertyFlags
pPFlags))
MemoryPropertyFlags
pFlags <- 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 @MemoryPropertyFlags Ptr MemoryPropertyFlags
pPFlags
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (MemoryPropertyFlags
pFlags)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaSetCurrentFrameIndex" ffiVmaSetCurrentFrameIndex
:: Allocator -> Word32 -> IO ()
setCurrentFrameIndex :: forall io
. (MonadIO io)
=>
Allocator
->
("frameIndex" ::: Word32)
-> io ()
setCurrentFrameIndex :: forall (io :: * -> *). MonadIO io => Allocator -> Flags -> io ()
setCurrentFrameIndex Allocator
allocator Flags
frameIndex = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaSetCurrentFrameIndex" ((Allocator -> Flags -> IO ()
ffiVmaSetCurrentFrameIndex)
(Allocator
allocator)
(Flags
frameIndex))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaCalculateStatistics" ffiVmaCalculateStatistics
:: Allocator -> Ptr TotalStatistics -> IO ()
calculateStatistics :: forall io
. (MonadIO io)
=>
Allocator
-> io (("stats" ::: TotalStatistics))
calculateStatistics :: forall (io :: * -> *).
MonadIO io =>
Allocator -> io TotalStatistics
calculateStatistics Allocator
allocator = 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
Ptr TotalStatistics
pPStats <- 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 @TotalStatistics)
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
"vmaCalculateStatistics" ((Allocator -> Ptr TotalStatistics -> IO ()
ffiVmaCalculateStatistics)
(Allocator
allocator)
(Ptr TotalStatistics
pPStats))
TotalStatistics
pStats <- 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 @TotalStatistics Ptr TotalStatistics
pPStats
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (TotalStatistics
pStats)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaGetHeapBudgets" ffiVmaGetHeapBudgets
:: Allocator -> Ptr Budget -> IO ()
getHeapBudgets :: forall io
. (MonadIO io)
=>
Allocator
->
("budgets" ::: Ptr Budget)
-> io ()
getHeapBudgets :: forall (io :: * -> *).
MonadIO io =>
Allocator -> ("budgets" ::: Ptr Budget) -> io ()
getHeapBudgets Allocator
allocator "budgets" ::: Ptr Budget
budgets = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaGetHeapBudgets" ((Allocator -> ("budgets" ::: Ptr Budget) -> IO ()
ffiVmaGetHeapBudgets)
(Allocator
allocator)
("budgets" ::: Ptr Budget
budgets))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaFindMemoryTypeIndex" ffiVmaFindMemoryTypeIndex
:: Allocator -> Word32 -> Ptr AllocationCreateInfo -> Ptr Word32 -> IO Result
findMemoryTypeIndex :: forall io
. (MonadIO io)
=>
Allocator
->
("memoryTypeBits" ::: Word32)
->
AllocationCreateInfo
-> io (("memoryTypeIndex" ::: Word32))
findMemoryTypeIndex :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Flags -> AllocationCreateInfo -> io Flags
findMemoryTypeIndex Allocator
allocator
Flags
memoryTypeBits
AllocationCreateInfo
allocationCreateInfo = 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
Ptr AllocationCreateInfo
pAllocationCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCreateInfo
allocationCreateInfo)
Ptr Flags
pPMemoryTypeIndex <- 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 @Word32 Int
4) forall a. Ptr a -> IO ()
free
Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaFindMemoryTypeIndex" ((Allocator
-> Flags -> Ptr AllocationCreateInfo -> Ptr Flags -> IO Result
ffiVmaFindMemoryTypeIndex)
(Allocator
allocator)
(Flags
memoryTypeBits)
Ptr AllocationCreateInfo
pAllocationCreateInfo
(Ptr Flags
pPMemoryTypeIndex))
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))
Flags
pMemoryTypeIndex <- 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 @Word32 Ptr Flags
pPMemoryTypeIndex
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Flags
pMemoryTypeIndex)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaFindMemoryTypeIndexForBufferInfo" ffiVmaFindMemoryTypeIndexForBufferInfo
:: Allocator -> Ptr (SomeStruct BufferCreateInfo) -> Ptr AllocationCreateInfo -> Ptr Word32 -> IO Result
findMemoryTypeIndexForBufferInfo :: forall a io
. ( Extendss BufferCreateInfo a
, PokeChain a
, MonadIO io )
=>
Allocator
->
(BufferCreateInfo a)
->
AllocationCreateInfo
-> io (("memoryTypeIndex" ::: Word32))
findMemoryTypeIndexForBufferInfo :: forall (a :: [*]) (io :: * -> *).
(Extendss BufferCreateInfo a, PokeChain a, MonadIO io) =>
Allocator -> BufferCreateInfo a -> AllocationCreateInfo -> io Flags
findMemoryTypeIndexForBufferInfo Allocator
allocator
BufferCreateInfo a
bufferCreateInfo
AllocationCreateInfo
allocationCreateInfo = 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
Ptr (BufferCreateInfo a)
pBufferCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (BufferCreateInfo a
bufferCreateInfo)
Ptr AllocationCreateInfo
pAllocationCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCreateInfo
allocationCreateInfo)
Ptr Flags
pPMemoryTypeIndex <- 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 @Word32 Int
4) forall a. Ptr a -> IO ()
free
Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaFindMemoryTypeIndexForBufferInfo" ((Allocator
-> Ptr (SomeStruct BufferCreateInfo)
-> Ptr AllocationCreateInfo
-> Ptr Flags
-> IO Result
ffiVmaFindMemoryTypeIndexForBufferInfo)
(Allocator
allocator)
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (BufferCreateInfo a)
pBufferCreateInfo)
Ptr AllocationCreateInfo
pAllocationCreateInfo
(Ptr Flags
pPMemoryTypeIndex))
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))
Flags
pMemoryTypeIndex <- 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 @Word32 Ptr Flags
pPMemoryTypeIndex
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Flags
pMemoryTypeIndex)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaFindMemoryTypeIndexForImageInfo" ffiVmaFindMemoryTypeIndexForImageInfo
:: Allocator -> Ptr (SomeStruct ImageCreateInfo) -> Ptr AllocationCreateInfo -> Ptr Word32 -> IO Result
findMemoryTypeIndexForImageInfo :: forall a io
. ( Extendss ImageCreateInfo a
, PokeChain a
, MonadIO io )
=>
Allocator
->
(ImageCreateInfo a)
->
AllocationCreateInfo
-> io (("memoryTypeIndex" ::: Word32))
findMemoryTypeIndexForImageInfo :: forall (a :: [*]) (io :: * -> *).
(Extendss ImageCreateInfo a, PokeChain a, MonadIO io) =>
Allocator -> ImageCreateInfo a -> AllocationCreateInfo -> io Flags
findMemoryTypeIndexForImageInfo Allocator
allocator
ImageCreateInfo a
imageCreateInfo
AllocationCreateInfo
allocationCreateInfo = 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
Ptr (ImageCreateInfo a)
pImageCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (ImageCreateInfo a
imageCreateInfo)
Ptr AllocationCreateInfo
pAllocationCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCreateInfo
allocationCreateInfo)
Ptr Flags
pPMemoryTypeIndex <- 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 @Word32 Int
4) forall a. Ptr a -> IO ()
free
Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaFindMemoryTypeIndexForImageInfo" ((Allocator
-> Ptr (SomeStruct ImageCreateInfo)
-> Ptr AllocationCreateInfo
-> Ptr Flags
-> IO Result
ffiVmaFindMemoryTypeIndexForImageInfo)
(Allocator
allocator)
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (ImageCreateInfo a)
pImageCreateInfo)
Ptr AllocationCreateInfo
pAllocationCreateInfo
(Ptr Flags
pPMemoryTypeIndex))
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))
Flags
pMemoryTypeIndex <- 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 @Word32 Ptr Flags
pPMemoryTypeIndex
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Flags
pMemoryTypeIndex)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaCreatePool" ffiVmaCreatePool
:: Allocator -> Ptr PoolCreateInfo -> Ptr Pool -> IO Result
createPool :: forall io
. (MonadIO io)
=>
Allocator
->
PoolCreateInfo
-> io (Pool)
createPool :: forall (io :: * -> *).
MonadIO io =>
Allocator -> PoolCreateInfo -> io Pool
createPool Allocator
allocator PoolCreateInfo
createInfo = 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
Ptr PoolCreateInfo
pCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (PoolCreateInfo
createInfo)
Ptr Pool
pPPool <- 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 @Pool 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
"vmaCreatePool" ((Allocator -> Ptr PoolCreateInfo -> Ptr Pool -> IO Result
ffiVmaCreatePool)
(Allocator
allocator)
Ptr PoolCreateInfo
pCreateInfo
(Ptr Pool
pPPool))
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))
Pool
pPool <- 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 @Pool Ptr Pool
pPPool
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Pool
pPool)
withPool :: forall io r . MonadIO io => Allocator -> PoolCreateInfo -> (io Pool -> (Pool -> io ()) -> r) -> r
withPool :: forall (io :: * -> *) r.
MonadIO io =>
Allocator
-> PoolCreateInfo -> (io Pool -> (Pool -> io ()) -> r) -> r
withPool Allocator
allocator PoolCreateInfo
pCreateInfo io Pool -> (Pool -> io ()) -> r
b =
io Pool -> (Pool -> io ()) -> r
b (forall (io :: * -> *).
MonadIO io =>
Allocator -> PoolCreateInfo -> io Pool
createPool Allocator
allocator PoolCreateInfo
pCreateInfo)
(\(Pool
o0) -> forall (io :: * -> *). MonadIO io => Allocator -> Pool -> io ()
destroyPool Allocator
allocator Pool
o0)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaDestroyPool" ffiVmaDestroyPool
:: Allocator -> Pool -> IO ()
destroyPool :: forall io
. (MonadIO io)
=>
Allocator
->
Pool
-> io ()
destroyPool :: forall (io :: * -> *). MonadIO io => Allocator -> Pool -> io ()
destroyPool Allocator
allocator Pool
pool = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaDestroyPool" ((Allocator -> Pool -> IO ()
ffiVmaDestroyPool) (Allocator
allocator) (Pool
pool))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaGetPoolStatistics" ffiVmaGetPoolStatistics
:: Allocator -> Pool -> Ptr Statistics -> IO ()
getPoolStatistics :: forall io
. (MonadIO io)
=>
Allocator
->
Pool
-> io (("poolStats" ::: Statistics))
getPoolStatistics :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Pool -> io Statistics
getPoolStatistics Allocator
allocator Pool
pool = 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
Ptr Statistics
pPPoolStats <- 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 @Statistics)
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
"vmaGetPoolStatistics" ((Allocator -> Pool -> Ptr Statistics -> IO ()
ffiVmaGetPoolStatistics)
(Allocator
allocator)
(Pool
pool)
(Ptr Statistics
pPPoolStats))
Statistics
pPoolStats <- 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 @Statistics Ptr Statistics
pPPoolStats
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Statistics
pPoolStats)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaCalculatePoolStatistics" ffiVmaCalculatePoolStatistics
:: Allocator -> Pool -> Ptr DetailedStatistics -> IO ()
calculatePoolStatistics :: forall io
. (MonadIO io)
=>
Allocator
->
Pool
-> io (("poolStats" ::: DetailedStatistics))
calculatePoolStatistics :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Pool -> io DetailedStatistics
calculatePoolStatistics Allocator
allocator Pool
pool = 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
Ptr DetailedStatistics
pPPoolStats <- 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 @DetailedStatistics)
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
"vmaCalculatePoolStatistics" ((Allocator -> Pool -> Ptr DetailedStatistics -> IO ()
ffiVmaCalculatePoolStatistics)
(Allocator
allocator)
(Pool
pool)
(Ptr DetailedStatistics
pPPoolStats))
DetailedStatistics
pPoolStats <- 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 @DetailedStatistics Ptr DetailedStatistics
pPPoolStats
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (DetailedStatistics
pPoolStats)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaCheckPoolCorruption" ffiVmaCheckPoolCorruption
:: Allocator -> Pool -> IO Result
checkPoolCorruption :: forall io
. (MonadIO io)
=>
Allocator
->
Pool
-> io ()
checkPoolCorruption :: forall (io :: * -> *). MonadIO io => Allocator -> Pool -> io ()
checkPoolCorruption Allocator
allocator Pool
pool = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Result
r <- forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaCheckPoolCorruption" ((Allocator -> Pool -> IO Result
ffiVmaCheckPoolCorruption)
(Allocator
allocator)
(Pool
pool))
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))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaGetPoolName" ffiVmaGetPoolName
:: Allocator -> Pool -> Ptr (Ptr CChar) -> IO ()
getPoolName :: forall io
. (MonadIO io)
=>
Allocator
->
Pool
-> io (("name" ::: Ptr CChar))
getPoolName :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Pool -> io ("name" ::: Ptr CChar)
getPoolName Allocator
allocator Pool
pool = 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
Ptr ("name" ::: Ptr CChar)
pPpName <- 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 @(Ptr CChar) Int
8) forall a. Ptr a -> IO ()
free
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
"vmaGetPoolName" ((Allocator -> Pool -> Ptr ("name" ::: Ptr CChar) -> IO ()
ffiVmaGetPoolName)
(Allocator
allocator)
(Pool
pool)
(Ptr ("name" ::: Ptr CChar)
pPpName))
"name" ::: Ptr CChar
ppName <- 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 @(Ptr CChar) Ptr ("name" ::: Ptr CChar)
pPpName
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("name" ::: Ptr CChar
ppName)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaSetPoolName" ffiVmaSetPoolName
:: Allocator -> Pool -> Ptr CChar -> IO ()
setPoolName :: forall io
. (MonadIO io)
=>
Allocator
->
Pool
->
("name" ::: Maybe ByteString)
-> io ()
setPoolName :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Pool -> ("name" ::: Maybe ByteString) -> io ()
setPoolName Allocator
allocator Pool
pool "name" ::: Maybe ByteString
name = 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
"name" ::: Ptr CChar
pName <- case ("name" ::: Maybe ByteString
name) of
"name" ::: Maybe ByteString
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just ByteString
j -> 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. ByteString -> (("name" ::: Ptr CChar) -> IO a) -> IO a
useAsCString (ByteString
j)
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
"vmaSetPoolName" ((Allocator -> Pool -> ("name" ::: Ptr CChar) -> IO ()
ffiVmaSetPoolName)
(Allocator
allocator)
(Pool
pool)
"name" ::: Ptr CChar
pName)
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaAllocateMemory" ffiVmaAllocateMemory
:: Allocator -> Ptr MemoryRequirements -> Ptr AllocationCreateInfo -> Ptr Allocation -> Ptr AllocationInfo -> IO Result
allocateMemory :: forall io
. (MonadIO io)
=>
Allocator
->
("vkMemoryRequirements" ::: MemoryRequirements)
->
AllocationCreateInfo
-> io (Allocation, AllocationInfo)
allocateMemory :: forall (io :: * -> *).
MonadIO io =>
Allocator
-> ("vkMemoryRequirements" ::: MemoryRequirements)
-> AllocationCreateInfo
-> io (Allocation, AllocationInfo)
allocateMemory Allocator
allocator
"vkMemoryRequirements" ::: MemoryRequirements
vkMemoryRequirements
AllocationCreateInfo
createInfo = 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
Ptr ("vkMemoryRequirements" ::: MemoryRequirements)
pVkMemoryRequirements <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct ("vkMemoryRequirements" ::: MemoryRequirements
vkMemoryRequirements)
Ptr AllocationCreateInfo
pCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCreateInfo
createInfo)
Ptr Allocation
pPAllocation <- 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 @Allocation Int
8) forall a. Ptr a -> IO ()
free
Ptr AllocationInfo
pPAllocationInfo <- 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 @AllocationInfo)
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
"vmaAllocateMemory" ((Allocator
-> Ptr ("vkMemoryRequirements" ::: MemoryRequirements)
-> Ptr AllocationCreateInfo
-> Ptr Allocation
-> Ptr AllocationInfo
-> IO Result
ffiVmaAllocateMemory)
(Allocator
allocator)
Ptr ("vkMemoryRequirements" ::: MemoryRequirements)
pVkMemoryRequirements
Ptr AllocationCreateInfo
pCreateInfo
(Ptr Allocation
pPAllocation)
(Ptr AllocationInfo
pPAllocationInfo))
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))
Allocation
pAllocation <- 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 @Allocation Ptr Allocation
pPAllocation
AllocationInfo
pAllocationInfo <- 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 @AllocationInfo Ptr AllocationInfo
pPAllocationInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Allocation
pAllocation, AllocationInfo
pAllocationInfo)
withMemory :: forall io r . MonadIO io => Allocator -> MemoryRequirements -> AllocationCreateInfo -> (io (Allocation, AllocationInfo) -> ((Allocation, AllocationInfo) -> io ()) -> r) -> r
withMemory :: forall (io :: * -> *) r.
MonadIO io =>
Allocator
-> ("vkMemoryRequirements" ::: MemoryRequirements)
-> AllocationCreateInfo
-> (io (Allocation, AllocationInfo)
-> ((Allocation, AllocationInfo) -> io ()) -> r)
-> r
withMemory Allocator
allocator "vkMemoryRequirements" ::: MemoryRequirements
pVkMemoryRequirements AllocationCreateInfo
pCreateInfo io (Allocation, AllocationInfo)
-> ((Allocation, AllocationInfo) -> io ()) -> r
b =
io (Allocation, AllocationInfo)
-> ((Allocation, AllocationInfo) -> io ()) -> r
b (forall (io :: * -> *).
MonadIO io =>
Allocator
-> ("vkMemoryRequirements" ::: MemoryRequirements)
-> AllocationCreateInfo
-> io (Allocation, AllocationInfo)
allocateMemory Allocator
allocator "vkMemoryRequirements" ::: MemoryRequirements
pVkMemoryRequirements AllocationCreateInfo
pCreateInfo)
(\(Allocation
o0, AllocationInfo
_) -> forall (io :: * -> *).
MonadIO io =>
Allocator -> Allocation -> io ()
freeMemory Allocator
allocator Allocation
o0)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaAllocateMemoryPages" ffiVmaAllocateMemoryPages
:: Allocator -> Ptr MemoryRequirements -> Ptr AllocationCreateInfo -> CSize -> Ptr Allocation -> Ptr AllocationInfo -> IO Result
allocateMemoryPages :: forall io
. (MonadIO io)
=>
Allocator
->
("vkMemoryRequirements" ::: Vector MemoryRequirements)
->
("createInfo" ::: Vector AllocationCreateInfo)
-> io (("allocations" ::: Vector Allocation), ("allocationInfo" ::: Vector AllocationInfo))
allocateMemoryPages :: forall (io :: * -> *).
MonadIO io =>
Allocator
-> ("vkMemoryRequirements"
::: Vector ("vkMemoryRequirements" ::: MemoryRequirements))
-> ("createInfo" ::: Vector AllocationCreateInfo)
-> io
("allocations" ::: Vector Allocation,
"allocationInfo" ::: Vector AllocationInfo)
allocateMemoryPages Allocator
allocator
"vkMemoryRequirements"
::: Vector ("vkMemoryRequirements" ::: MemoryRequirements)
vkMemoryRequirements
"createInfo" ::: Vector AllocationCreateInfo
createInfo = 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
Ptr ("vkMemoryRequirements" ::: MemoryRequirements)
pPVkMemoryRequirements <- 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. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @MemoryRequirements ((forall a. Vector a -> Int
Data.Vector.length ("vkMemoryRequirements"
::: Vector ("vkMemoryRequirements" ::: MemoryRequirements)
vkMemoryRequirements)) forall a. Num a => a -> a -> a
* Int
24)
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i "vkMemoryRequirements" ::: MemoryRequirements
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr ("vkMemoryRequirements" ::: MemoryRequirements)
pPVkMemoryRequirements forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
24 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr MemoryRequirements) ("vkMemoryRequirements" ::: MemoryRequirements
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) ("vkMemoryRequirements"
::: Vector ("vkMemoryRequirements" ::: MemoryRequirements)
vkMemoryRequirements)
Ptr AllocationCreateInfo
pPCreateInfo <- 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. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @AllocationCreateInfo ((forall a. Vector a -> Int
Data.Vector.length ("createInfo" ::: Vector AllocationCreateInfo
createInfo)) forall a. Num a => a -> a -> a
* Int
48)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i AllocationCreateInfo
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr AllocationCreateInfo
pPCreateInfo forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
48 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AllocationCreateInfo) (AllocationCreateInfo
e)) ("createInfo" ::: Vector AllocationCreateInfo
createInfo)
let pVkMemoryRequirementsLength :: Int
pVkMemoryRequirementsLength = forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("vkMemoryRequirements"
::: Vector ("vkMemoryRequirements" ::: MemoryRequirements)
vkMemoryRequirements)
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 ((forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("createInfo" ::: Vector AllocationCreateInfo
createInfo)) forall a. Eq a => a -> a -> Bool
== Int
pVkMemoryRequirementsLength) 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
"pCreateInfo and pVkMemoryRequirements must have the same length" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
Ptr Allocation
pPAllocations <- 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 @Allocation ((forall a b. (Integral a, Num b) => a -> b
fromIntegral ((forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pVkMemoryRequirementsLength :: CSize))) forall a. Num a => a -> a -> a
* Int
8)) forall a. Ptr a -> IO ()
free
Ptr AllocationInfo
pPAllocationInfo <- 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 @AllocationInfo ((forall a b. (Integral a, Num b) => a -> b
fromIntegral ((forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pVkMemoryRequirementsLength :: CSize))) forall a. Num a => a -> a -> a
* Int
56)) forall a. Ptr a -> IO ()
free
[()]
_ <- forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (\Int
i -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => Ptr a -> IO b -> IO b
pokeZeroCStruct (Ptr AllocationInfo
pPAllocationInfo forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
i forall a. Num a => a -> a -> a
* Int
56) :: Ptr AllocationInfo) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) [Int
0..(forall a b. (Integral a, Num b) => a -> b
fromIntegral ((forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pVkMemoryRequirementsLength :: CSize))) forall a. Num a => a -> a -> a
- Int
1]
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
"vmaAllocateMemoryPages" ((Allocator
-> Ptr ("vkMemoryRequirements" ::: MemoryRequirements)
-> Ptr AllocationCreateInfo
-> CSize
-> Ptr Allocation
-> Ptr AllocationInfo
-> IO Result
ffiVmaAllocateMemoryPages)
(Allocator
allocator)
(Ptr ("vkMemoryRequirements" ::: MemoryRequirements)
pPVkMemoryRequirements)
(Ptr AllocationCreateInfo
pPCreateInfo)
((forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pVkMemoryRequirementsLength :: CSize))
(Ptr Allocation
pPAllocations)
((Ptr AllocationInfo
pPAllocationInfo)))
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))
"allocations" ::: Vector Allocation
pAllocations <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral ((forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pVkMemoryRequirementsLength :: CSize))) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Allocation ((Ptr Allocation
pPAllocations forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Allocation)))
"allocationInfo" ::: Vector AllocationInfo
pAllocationInfo <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral ((forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pVkMemoryRequirementsLength :: CSize))) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @AllocationInfo (((Ptr AllocationInfo
pPAllocationInfo) forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
56 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr AllocationInfo)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("allocations" ::: Vector Allocation
pAllocations, "allocationInfo" ::: Vector AllocationInfo
pAllocationInfo)
withMemoryPages :: forall io r . MonadIO io => Allocator -> Vector MemoryRequirements -> Vector AllocationCreateInfo -> (io (Vector Allocation, Vector AllocationInfo) -> ((Vector Allocation, Vector AllocationInfo) -> io ()) -> r) -> r
withMemoryPages :: forall (io :: * -> *) r.
MonadIO io =>
Allocator
-> ("vkMemoryRequirements"
::: Vector ("vkMemoryRequirements" ::: MemoryRequirements))
-> ("createInfo" ::: Vector AllocationCreateInfo)
-> (io
("allocations" ::: Vector Allocation,
"allocationInfo" ::: Vector AllocationInfo)
-> (("allocations" ::: Vector Allocation,
"allocationInfo" ::: Vector AllocationInfo)
-> io ())
-> r)
-> r
withMemoryPages Allocator
allocator "vkMemoryRequirements"
::: Vector ("vkMemoryRequirements" ::: MemoryRequirements)
pVkMemoryRequirements "createInfo" ::: Vector AllocationCreateInfo
pCreateInfo io
("allocations" ::: Vector Allocation,
"allocationInfo" ::: Vector AllocationInfo)
-> (("allocations" ::: Vector Allocation,
"allocationInfo" ::: Vector AllocationInfo)
-> io ())
-> r
b =
io
("allocations" ::: Vector Allocation,
"allocationInfo" ::: Vector AllocationInfo)
-> (("allocations" ::: Vector Allocation,
"allocationInfo" ::: Vector AllocationInfo)
-> io ())
-> r
b (forall (io :: * -> *).
MonadIO io =>
Allocator
-> ("vkMemoryRequirements"
::: Vector ("vkMemoryRequirements" ::: MemoryRequirements))
-> ("createInfo" ::: Vector AllocationCreateInfo)
-> io
("allocations" ::: Vector Allocation,
"allocationInfo" ::: Vector AllocationInfo)
allocateMemoryPages Allocator
allocator "vkMemoryRequirements"
::: Vector ("vkMemoryRequirements" ::: MemoryRequirements)
pVkMemoryRequirements "createInfo" ::: Vector AllocationCreateInfo
pCreateInfo)
(\("allocations" ::: Vector Allocation
o0, "allocationInfo" ::: Vector AllocationInfo
_) -> forall (io :: * -> *).
MonadIO io =>
Allocator -> ("allocations" ::: Vector Allocation) -> io ()
freeMemoryPages Allocator
allocator "allocations" ::: Vector Allocation
o0)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaAllocateMemoryForBuffer" ffiVmaAllocateMemoryForBuffer
:: Allocator -> Buffer -> Ptr AllocationCreateInfo -> Ptr Allocation -> Ptr AllocationInfo -> IO Result
allocateMemoryForBuffer :: forall io
. (MonadIO io)
=>
Allocator
->
Buffer
->
AllocationCreateInfo
-> io (Allocation, AllocationInfo)
allocateMemoryForBuffer :: forall (io :: * -> *).
MonadIO io =>
Allocator
-> Buffer
-> AllocationCreateInfo
-> io (Allocation, AllocationInfo)
allocateMemoryForBuffer Allocator
allocator Buffer
buffer AllocationCreateInfo
createInfo = 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
Ptr AllocationCreateInfo
pCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCreateInfo
createInfo)
Ptr Allocation
pPAllocation <- 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 @Allocation Int
8) forall a. Ptr a -> IO ()
free
Ptr AllocationInfo
pPAllocationInfo <- 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 @AllocationInfo)
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
"vmaAllocateMemoryForBuffer" ((Allocator
-> Buffer
-> Ptr AllocationCreateInfo
-> Ptr Allocation
-> Ptr AllocationInfo
-> IO Result
ffiVmaAllocateMemoryForBuffer)
(Allocator
allocator)
(Buffer
buffer)
Ptr AllocationCreateInfo
pCreateInfo
(Ptr Allocation
pPAllocation)
(Ptr AllocationInfo
pPAllocationInfo))
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))
Allocation
pAllocation <- 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 @Allocation Ptr Allocation
pPAllocation
AllocationInfo
pAllocationInfo <- 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 @AllocationInfo Ptr AllocationInfo
pPAllocationInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Allocation
pAllocation, AllocationInfo
pAllocationInfo)
withMemoryForBuffer :: forall io r . MonadIO io => Allocator -> Buffer -> AllocationCreateInfo -> (io (Allocation, AllocationInfo) -> ((Allocation, AllocationInfo) -> io ()) -> r) -> r
withMemoryForBuffer :: forall (io :: * -> *) r.
MonadIO io =>
Allocator
-> Buffer
-> AllocationCreateInfo
-> (io (Allocation, AllocationInfo)
-> ((Allocation, AllocationInfo) -> io ()) -> r)
-> r
withMemoryForBuffer Allocator
allocator Buffer
buffer AllocationCreateInfo
pCreateInfo io (Allocation, AllocationInfo)
-> ((Allocation, AllocationInfo) -> io ()) -> r
b =
io (Allocation, AllocationInfo)
-> ((Allocation, AllocationInfo) -> io ()) -> r
b (forall (io :: * -> *).
MonadIO io =>
Allocator
-> Buffer
-> AllocationCreateInfo
-> io (Allocation, AllocationInfo)
allocateMemoryForBuffer Allocator
allocator Buffer
buffer AllocationCreateInfo
pCreateInfo)
(\(Allocation
o0, AllocationInfo
_) -> forall (io :: * -> *).
MonadIO io =>
Allocator -> Allocation -> io ()
freeMemory Allocator
allocator Allocation
o0)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaAllocateMemoryForImage" ffiVmaAllocateMemoryForImage
:: Allocator -> Image -> Ptr AllocationCreateInfo -> Ptr Allocation -> Ptr AllocationInfo -> IO Result
allocateMemoryForImage :: forall io
. (MonadIO io)
=>
Allocator
->
Image
->
AllocationCreateInfo
-> io (Allocation, AllocationInfo)
allocateMemoryForImage :: forall (io :: * -> *).
MonadIO io =>
Allocator
-> Image -> AllocationCreateInfo -> io (Allocation, AllocationInfo)
allocateMemoryForImage Allocator
allocator Image
image AllocationCreateInfo
createInfo = 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
Ptr AllocationCreateInfo
pCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCreateInfo
createInfo)
Ptr Allocation
pPAllocation <- 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 @Allocation Int
8) forall a. Ptr a -> IO ()
free
Ptr AllocationInfo
pPAllocationInfo <- 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 @AllocationInfo)
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
"vmaAllocateMemoryForImage" ((Allocator
-> Image
-> Ptr AllocationCreateInfo
-> Ptr Allocation
-> Ptr AllocationInfo
-> IO Result
ffiVmaAllocateMemoryForImage)
(Allocator
allocator)
(Image
image)
Ptr AllocationCreateInfo
pCreateInfo
(Ptr Allocation
pPAllocation)
(Ptr AllocationInfo
pPAllocationInfo))
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))
Allocation
pAllocation <- 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 @Allocation Ptr Allocation
pPAllocation
AllocationInfo
pAllocationInfo <- 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 @AllocationInfo Ptr AllocationInfo
pPAllocationInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Allocation
pAllocation, AllocationInfo
pAllocationInfo)
withMemoryForImage :: forall io r . MonadIO io => Allocator -> Image -> AllocationCreateInfo -> (io (Allocation, AllocationInfo) -> ((Allocation, AllocationInfo) -> io ()) -> r) -> r
withMemoryForImage :: forall (io :: * -> *) r.
MonadIO io =>
Allocator
-> Image
-> AllocationCreateInfo
-> (io (Allocation, AllocationInfo)
-> ((Allocation, AllocationInfo) -> io ()) -> r)
-> r
withMemoryForImage Allocator
allocator Image
image AllocationCreateInfo
pCreateInfo io (Allocation, AllocationInfo)
-> ((Allocation, AllocationInfo) -> io ()) -> r
b =
io (Allocation, AllocationInfo)
-> ((Allocation, AllocationInfo) -> io ()) -> r
b (forall (io :: * -> *).
MonadIO io =>
Allocator
-> Image -> AllocationCreateInfo -> io (Allocation, AllocationInfo)
allocateMemoryForImage Allocator
allocator Image
image AllocationCreateInfo
pCreateInfo)
(\(Allocation
o0, AllocationInfo
_) -> forall (io :: * -> *).
MonadIO io =>
Allocator -> Allocation -> io ()
freeMemory Allocator
allocator Allocation
o0)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaFreeMemory" ffiVmaFreeMemory
:: Allocator -> Allocation -> IO ()
freeMemory :: forall io
. (MonadIO io)
=>
Allocator
->
Allocation
-> io ()
freeMemory :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Allocation -> io ()
freeMemory Allocator
allocator Allocation
allocation = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaFreeMemory" ((Allocator -> Allocation -> IO ()
ffiVmaFreeMemory) (Allocator
allocator) (Allocation
allocation))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaFreeMemoryPages" ffiVmaFreeMemoryPages
:: Allocator -> CSize -> Ptr Allocation -> IO ()
freeMemoryPages :: forall io
. (MonadIO io)
=>
Allocator
->
("allocations" ::: Vector Allocation)
-> io ()
freeMemoryPages :: forall (io :: * -> *).
MonadIO io =>
Allocator -> ("allocations" ::: Vector Allocation) -> io ()
freeMemoryPages Allocator
allocator "allocations" ::: Vector Allocation
allocations = 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
Ptr Allocation
pPAllocations <- 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. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Allocation ((forall a. Vector a -> Int
Data.Vector.length ("allocations" ::: Vector Allocation
allocations)) forall a. Num a => a -> a -> a
* Int
8)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Allocation
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Allocation
pPAllocations forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Allocation) (Allocation
e)) ("allocations" ::: Vector Allocation
allocations)
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
"vmaFreeMemoryPages" ((Allocator -> CSize -> Ptr Allocation -> IO ()
ffiVmaFreeMemoryPages)
(Allocator
allocator)
((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("allocations" ::: Vector Allocation
allocations)) :: CSize))
(Ptr Allocation
pPAllocations))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaGetAllocationInfo" ffiVmaGetAllocationInfo
:: Allocator -> Allocation -> Ptr AllocationInfo -> IO ()
getAllocationInfo :: forall io
. (MonadIO io)
=>
Allocator
->
Allocation
-> io (AllocationInfo)
getAllocationInfo :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Allocation -> io AllocationInfo
getAllocationInfo Allocator
allocator Allocation
allocation = 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
Ptr AllocationInfo
pPAllocationInfo <- 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 @AllocationInfo)
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
"vmaGetAllocationInfo" ((Allocator -> Allocation -> Ptr AllocationInfo -> IO ()
ffiVmaGetAllocationInfo)
(Allocator
allocator)
(Allocation
allocation)
(Ptr AllocationInfo
pPAllocationInfo))
AllocationInfo
pAllocationInfo <- 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 @AllocationInfo Ptr AllocationInfo
pPAllocationInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (AllocationInfo
pAllocationInfo)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaSetAllocationUserData" ffiVmaSetAllocationUserData
:: Allocator -> Allocation -> Ptr () -> IO ()
setAllocationUserData :: forall io
. (MonadIO io)
=>
Allocator
->
Allocation
->
("userData" ::: Ptr ())
-> io ()
setAllocationUserData :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Allocation -> ("userData" ::: Ptr ()) -> io ()
setAllocationUserData Allocator
allocator Allocation
allocation "userData" ::: Ptr ()
userData = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaSetAllocationUserData" ((Allocator -> Allocation -> ("userData" ::: Ptr ()) -> IO ()
ffiVmaSetAllocationUserData)
(Allocator
allocator)
(Allocation
allocation)
("userData" ::: Ptr ()
userData))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaSetAllocationName" ffiVmaSetAllocationName
:: Allocator -> Allocation -> Ptr CChar -> IO ()
setAllocationName :: forall io
. (MonadIO io)
=>
Allocator
->
Allocation
->
("name" ::: Maybe ByteString)
-> io ()
setAllocationName :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Allocation -> ("name" ::: Maybe ByteString) -> io ()
setAllocationName Allocator
allocator Allocation
allocation "name" ::: Maybe ByteString
name = 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
"name" ::: Ptr CChar
pName <- case ("name" ::: Maybe ByteString
name) of
"name" ::: Maybe ByteString
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just ByteString
j -> 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. ByteString -> (("name" ::: Ptr CChar) -> IO a) -> IO a
useAsCString (ByteString
j)
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
"vmaSetAllocationName" ((Allocator -> Allocation -> ("name" ::: Ptr CChar) -> IO ()
ffiVmaSetAllocationName)
(Allocator
allocator)
(Allocation
allocation)
"name" ::: Ptr CChar
pName)
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaGetAllocationMemoryProperties" ffiVmaGetAllocationMemoryProperties
:: Allocator -> Allocation -> Ptr MemoryPropertyFlags -> IO ()
getAllocationMemoryProperties :: forall io
. (MonadIO io)
=>
Allocator
->
Allocation
-> io (MemoryPropertyFlags)
getAllocationMemoryProperties :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Allocation -> io MemoryPropertyFlags
getAllocationMemoryProperties Allocator
allocator Allocation
allocation = 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
Ptr MemoryPropertyFlags
pPFlags <- 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 @MemoryPropertyFlags Int
4) forall a. Ptr a -> IO ()
free
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
"vmaGetAllocationMemoryProperties" ((Allocator -> Allocation -> Ptr MemoryPropertyFlags -> IO ()
ffiVmaGetAllocationMemoryProperties)
(Allocator
allocator)
(Allocation
allocation)
(Ptr MemoryPropertyFlags
pPFlags))
MemoryPropertyFlags
pFlags <- 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 @MemoryPropertyFlags Ptr MemoryPropertyFlags
pPFlags
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (MemoryPropertyFlags
pFlags)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaMapMemory" ffiVmaMapMemory
:: Allocator -> Allocation -> Ptr (Ptr ()) -> IO Result
mapMemory :: forall io
. (MonadIO io)
=>
Allocator
->
Allocation
-> io (("data" ::: Ptr ()))
mapMemory :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Allocation -> io ("userData" ::: Ptr ())
mapMemory Allocator
allocator Allocation
allocation = 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
Ptr ("userData" ::: Ptr ())
pPpData <- 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 @(Ptr ()) 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
"vmaMapMemory" ((Allocator -> Allocation -> Ptr ("userData" ::: Ptr ()) -> IO Result
ffiVmaMapMemory)
(Allocator
allocator)
(Allocation
allocation)
(Ptr ("userData" ::: Ptr ())
pPpData))
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))
"userData" ::: Ptr ()
ppData <- 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 @(Ptr ()) Ptr ("userData" ::: Ptr ())
pPpData
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("userData" ::: Ptr ()
ppData)
withMappedMemory :: forall io r . MonadIO io => Allocator -> Allocation -> (io (Ptr ()) -> (Ptr () -> io ()) -> r) -> r
withMappedMemory :: forall (io :: * -> *) r.
MonadIO io =>
Allocator
-> Allocation
-> (io ("userData" ::: Ptr ())
-> (("userData" ::: Ptr ()) -> io ()) -> r)
-> r
withMappedMemory Allocator
allocator Allocation
allocation io ("userData" ::: Ptr ())
-> (("userData" ::: Ptr ()) -> io ()) -> r
b =
io ("userData" ::: Ptr ())
-> (("userData" ::: Ptr ()) -> io ()) -> r
b (forall (io :: * -> *).
MonadIO io =>
Allocator -> Allocation -> io ("userData" ::: Ptr ())
mapMemory Allocator
allocator Allocation
allocation)
(\("userData" ::: Ptr ()
_) -> forall (io :: * -> *).
MonadIO io =>
Allocator -> Allocation -> io ()
unmapMemory Allocator
allocator Allocation
allocation)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaUnmapMemory" ffiVmaUnmapMemory
:: Allocator -> Allocation -> IO ()
unmapMemory :: forall io
. (MonadIO io)
=>
Allocator
->
Allocation
-> io ()
unmapMemory :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Allocation -> io ()
unmapMemory Allocator
allocator Allocation
allocation = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaUnmapMemory" ((Allocator -> Allocation -> IO ()
ffiVmaUnmapMemory)
(Allocator
allocator)
(Allocation
allocation))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaFlushAllocation" ffiVmaFlushAllocation
:: Allocator -> Allocation -> DeviceSize -> DeviceSize -> IO Result
flushAllocation :: forall io
. (MonadIO io)
=>
Allocator
->
Allocation
->
("offset" ::: DeviceSize)
->
DeviceSize
-> io ()
flushAllocation :: forall (io :: * -> *).
MonadIO io =>
Allocator
-> Allocation
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> io ()
flushAllocation Allocator
allocator Allocation
allocation "offset" ::: DeviceSize
offset "offset" ::: DeviceSize
size = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Result
r <- forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaFlushAllocation" ((Allocator
-> Allocation
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> IO Result
ffiVmaFlushAllocation)
(Allocator
allocator)
(Allocation
allocation)
("offset" ::: DeviceSize
offset)
("offset" ::: DeviceSize
size))
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))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaInvalidateAllocation" ffiVmaInvalidateAllocation
:: Allocator -> Allocation -> DeviceSize -> DeviceSize -> IO Result
invalidateAllocation :: forall io
. (MonadIO io)
=>
Allocator
->
Allocation
->
("offset" ::: DeviceSize)
->
DeviceSize
-> io ()
invalidateAllocation :: forall (io :: * -> *).
MonadIO io =>
Allocator
-> Allocation
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> io ()
invalidateAllocation Allocator
allocator Allocation
allocation "offset" ::: DeviceSize
offset "offset" ::: DeviceSize
size = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Result
r <- forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaInvalidateAllocation" ((Allocator
-> Allocation
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> IO Result
ffiVmaInvalidateAllocation)
(Allocator
allocator)
(Allocation
allocation)
("offset" ::: DeviceSize
offset)
("offset" ::: DeviceSize
size))
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))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaFlushAllocations" ffiVmaFlushAllocations
:: Allocator -> Word32 -> Ptr Allocation -> Ptr DeviceSize -> Ptr DeviceSize -> IO Result
flushAllocations :: forall io
. (MonadIO io)
=>
Allocator
->
("allocations" ::: Vector Allocation)
->
("offsets" ::: Vector DeviceSize)
->
("sizes" ::: Vector DeviceSize)
-> io ()
flushAllocations :: forall (io :: * -> *).
MonadIO io =>
Allocator
-> ("allocations" ::: Vector Allocation)
-> ("offsets" ::: Vector ("offset" ::: DeviceSize))
-> ("offsets" ::: Vector ("offset" ::: DeviceSize))
-> io ()
flushAllocations Allocator
allocator "allocations" ::: Vector Allocation
allocations "offsets" ::: Vector ("offset" ::: DeviceSize)
offsets "offsets" ::: Vector ("offset" ::: DeviceSize)
sizes = 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 allocationsLength :: Int
allocationsLength = forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("allocations" ::: Vector Allocation
allocations)
let offsetsLength :: Int
offsetsLength = forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("offsets" ::: Vector ("offset" ::: DeviceSize)
offsets)
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 (forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
offsetsLength forall a. Eq a => a -> a -> Bool
== Int
allocationsLength Bool -> Bool -> Bool
|| Int
offsetsLength forall a. Eq a => a -> a -> Bool
== Int
0) 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
"offsets and allocations must have the same length" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let sizesLength :: Int
sizesLength = forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("offsets" ::: Vector ("offset" ::: DeviceSize)
sizes)
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 (forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
sizesLength forall a. Eq a => a -> a -> Bool
== Int
allocationsLength Bool -> Bool -> Bool
|| Int
sizesLength forall a. Eq a => a -> a -> Bool
== Int
0) 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
"sizes and allocations must have the same length" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
Ptr Allocation
pAllocations <- 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. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Allocation ((forall a. Vector a -> Int
Data.Vector.length ("allocations" ::: Vector Allocation
allocations)) forall a. Num a => a -> a -> a
* Int
8)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Allocation
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Allocation
pAllocations forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Allocation) (Allocation
e)) ("allocations" ::: Vector Allocation
allocations)
Ptr ("offset" ::: DeviceSize)
offsets' <- if forall a. Vector a -> Bool
Data.Vector.null ("offsets" ::: Vector ("offset" ::: DeviceSize)
offsets)
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
else do
Ptr ("offset" ::: DeviceSize)
pOffsets <- 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. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @DeviceSize (((forall a. Vector a -> Int
Data.Vector.length ("offsets" ::: Vector ("offset" ::: DeviceSize)
offsets))) forall a. Num a => a -> a -> a
* Int
8)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i "offset" ::: DeviceSize
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("offset" ::: DeviceSize)
pOffsets forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DeviceSize) ("offset" ::: DeviceSize
e)) (("offsets" ::: Vector ("offset" ::: DeviceSize)
offsets))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr ("offset" ::: DeviceSize)
pOffsets
Ptr ("offset" ::: DeviceSize)
sizes' <- if forall a. Vector a -> Bool
Data.Vector.null ("offsets" ::: Vector ("offset" ::: DeviceSize)
sizes)
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
else do
Ptr ("offset" ::: DeviceSize)
pSizes <- 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. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @DeviceSize (((forall a. Vector a -> Int
Data.Vector.length ("offsets" ::: Vector ("offset" ::: DeviceSize)
sizes))) forall a. Num a => a -> a -> a
* Int
8)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i "offset" ::: DeviceSize
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("offset" ::: DeviceSize)
pSizes forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DeviceSize) ("offset" ::: DeviceSize
e)) (("offsets" ::: Vector ("offset" ::: DeviceSize)
sizes))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr ("offset" ::: DeviceSize)
pSizes
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
"vmaFlushAllocations" ((Allocator
-> Flags
-> Ptr Allocation
-> Ptr ("offset" ::: DeviceSize)
-> Ptr ("offset" ::: DeviceSize)
-> IO Result
ffiVmaFlushAllocations)
(Allocator
allocator)
((forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
allocationsLength :: Word32))
(Ptr Allocation
pAllocations)
Ptr ("offset" ::: DeviceSize)
offsets'
Ptr ("offset" ::: DeviceSize)
sizes')
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))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaInvalidateAllocations" ffiVmaInvalidateAllocations
:: Allocator -> Word32 -> Ptr Allocation -> Ptr DeviceSize -> Ptr DeviceSize -> IO Result
invalidateAllocations :: forall io
. (MonadIO io)
=>
Allocator
->
("allocations" ::: Vector Allocation)
->
("offsets" ::: Vector DeviceSize)
->
("sizes" ::: Vector DeviceSize)
-> io ()
invalidateAllocations :: forall (io :: * -> *).
MonadIO io =>
Allocator
-> ("allocations" ::: Vector Allocation)
-> ("offsets" ::: Vector ("offset" ::: DeviceSize))
-> ("offsets" ::: Vector ("offset" ::: DeviceSize))
-> io ()
invalidateAllocations Allocator
allocator
"allocations" ::: Vector Allocation
allocations
"offsets" ::: Vector ("offset" ::: DeviceSize)
offsets
"offsets" ::: Vector ("offset" ::: DeviceSize)
sizes = 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 allocationsLength :: Int
allocationsLength = forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("allocations" ::: Vector Allocation
allocations)
let offsetsLength :: Int
offsetsLength = forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("offsets" ::: Vector ("offset" ::: DeviceSize)
offsets)
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 (forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
offsetsLength forall a. Eq a => a -> a -> Bool
== Int
allocationsLength Bool -> Bool -> Bool
|| Int
offsetsLength forall a. Eq a => a -> a -> Bool
== Int
0) 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
"offsets and allocations must have the same length" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let sizesLength :: Int
sizesLength = forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("offsets" ::: Vector ("offset" ::: DeviceSize)
sizes)
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 (forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
sizesLength forall a. Eq a => a -> a -> Bool
== Int
allocationsLength Bool -> Bool -> Bool
|| Int
sizesLength forall a. Eq a => a -> a -> Bool
== Int
0) 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
"sizes and allocations must have the same length" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
Ptr Allocation
pAllocations <- 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. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Allocation ((forall a. Vector a -> Int
Data.Vector.length ("allocations" ::: Vector Allocation
allocations)) forall a. Num a => a -> a -> a
* Int
8)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Allocation
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Allocation
pAllocations forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Allocation) (Allocation
e)) ("allocations" ::: Vector Allocation
allocations)
Ptr ("offset" ::: DeviceSize)
offsets' <- if forall a. Vector a -> Bool
Data.Vector.null ("offsets" ::: Vector ("offset" ::: DeviceSize)
offsets)
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
else do
Ptr ("offset" ::: DeviceSize)
pOffsets <- 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. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @DeviceSize (((forall a. Vector a -> Int
Data.Vector.length ("offsets" ::: Vector ("offset" ::: DeviceSize)
offsets))) forall a. Num a => a -> a -> a
* Int
8)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i "offset" ::: DeviceSize
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("offset" ::: DeviceSize)
pOffsets forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DeviceSize) ("offset" ::: DeviceSize
e)) (("offsets" ::: Vector ("offset" ::: DeviceSize)
offsets))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr ("offset" ::: DeviceSize)
pOffsets
Ptr ("offset" ::: DeviceSize)
sizes' <- if forall a. Vector a -> Bool
Data.Vector.null ("offsets" ::: Vector ("offset" ::: DeviceSize)
sizes)
then forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
else do
Ptr ("offset" ::: DeviceSize)
pSizes <- 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. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @DeviceSize (((forall a. Vector a -> Int
Data.Vector.length ("offsets" ::: Vector ("offset" ::: DeviceSize)
sizes))) forall a. Num a => a -> a -> a
* Int
8)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i "offset" ::: DeviceSize
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ("offset" ::: DeviceSize)
pSizes forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DeviceSize) ("offset" ::: DeviceSize
e)) (("offsets" ::: Vector ("offset" ::: DeviceSize)
sizes))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr ("offset" ::: DeviceSize)
pSizes
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
"vmaInvalidateAllocations" ((Allocator
-> Flags
-> Ptr Allocation
-> Ptr ("offset" ::: DeviceSize)
-> Ptr ("offset" ::: DeviceSize)
-> IO Result
ffiVmaInvalidateAllocations)
(Allocator
allocator)
((forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
allocationsLength :: Word32))
(Ptr Allocation
pAllocations)
Ptr ("offset" ::: DeviceSize)
offsets'
Ptr ("offset" ::: DeviceSize)
sizes')
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))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaCheckCorruption" ffiVmaCheckCorruption
:: Allocator -> Word32 -> IO Result
checkCorruption :: forall io
. (MonadIO io)
=>
Allocator
->
("memoryTypeBits" ::: Word32)
-> io ()
checkCorruption :: forall (io :: * -> *). MonadIO io => Allocator -> Flags -> io ()
checkCorruption Allocator
allocator Flags
memoryTypeBits = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Result
r <- forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaCheckCorruption" ((Allocator -> Flags -> IO Result
ffiVmaCheckCorruption)
(Allocator
allocator)
(Flags
memoryTypeBits))
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))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaBeginDefragmentation" ffiVmaBeginDefragmentation
:: Allocator -> Ptr DefragmentationInfo -> Ptr DefragmentationContext -> IO Result
beginDefragmentation :: forall io
. (MonadIO io)
=>
Allocator
->
DefragmentationInfo
-> io (DefragmentationContext)
beginDefragmentation :: forall (io :: * -> *).
MonadIO io =>
Allocator -> DefragmentationInfo -> io DefragmentationContext
beginDefragmentation Allocator
allocator DefragmentationInfo
info = 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
Ptr DefragmentationInfo
pInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (DefragmentationInfo
info)
Ptr DefragmentationContext
pPContext <- 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 @DefragmentationContext 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
"vmaBeginDefragmentation" ((Allocator
-> Ptr DefragmentationInfo
-> Ptr DefragmentationContext
-> IO Result
ffiVmaBeginDefragmentation)
(Allocator
allocator)
Ptr DefragmentationInfo
pInfo
(Ptr DefragmentationContext
pPContext))
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))
DefragmentationContext
pContext <- 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 @DefragmentationContext Ptr DefragmentationContext
pPContext
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (DefragmentationContext
pContext)
withDefragmentation :: forall io r . MonadIO io => Allocator -> DefragmentationInfo -> (io DefragmentationContext -> (DefragmentationContext -> io (DefragmentationStats)) -> r) -> r
withDefragmentation :: forall (io :: * -> *) r.
MonadIO io =>
Allocator
-> DefragmentationInfo
-> (io DefragmentationContext
-> (DefragmentationContext -> io DefragmentationStats) -> r)
-> r
withDefragmentation Allocator
allocator DefragmentationInfo
pInfo io DefragmentationContext
-> (DefragmentationContext -> io DefragmentationStats) -> r
b =
io DefragmentationContext
-> (DefragmentationContext -> io DefragmentationStats) -> r
b (forall (io :: * -> *).
MonadIO io =>
Allocator -> DefragmentationInfo -> io DefragmentationContext
beginDefragmentation Allocator
allocator DefragmentationInfo
pInfo)
(\(DefragmentationContext
o0) -> forall (io :: * -> *).
MonadIO io =>
Allocator -> DefragmentationContext -> io DefragmentationStats
endDefragmentation Allocator
allocator DefragmentationContext
o0)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaEndDefragmentation" ffiVmaEndDefragmentation
:: Allocator -> DefragmentationContext -> Ptr DefragmentationStats -> IO ()
endDefragmentation :: forall io
. (MonadIO io)
=>
Allocator
->
DefragmentationContext
-> io (DefragmentationStats)
endDefragmentation :: forall (io :: * -> *).
MonadIO io =>
Allocator -> DefragmentationContext -> io DefragmentationStats
endDefragmentation Allocator
allocator DefragmentationContext
context = 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
Ptr DefragmentationStats
pPStats <- 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 @DefragmentationStats)
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
"vmaEndDefragmentation" ((Allocator
-> DefragmentationContext -> Ptr DefragmentationStats -> IO ()
ffiVmaEndDefragmentation)
(Allocator
allocator)
(DefragmentationContext
context)
(Ptr DefragmentationStats
pPStats))
DefragmentationStats
pStats <- 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 @DefragmentationStats Ptr DefragmentationStats
pPStats
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (DefragmentationStats
pStats)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaBeginDefragmentationPass" ffiVmaBeginDefragmentationPass
:: Allocator -> DefragmentationContext -> Ptr DefragmentationPassMoveInfo -> IO Result
beginDefragmentationPass :: forall io
. (MonadIO io)
=>
Allocator
->
DefragmentationContext
-> io (("passInfo" ::: DefragmentationPassMoveInfo))
beginDefragmentationPass :: forall (io :: * -> *).
MonadIO io =>
Allocator
-> DefragmentationContext -> io DefragmentationPassMoveInfo
beginDefragmentationPass Allocator
allocator DefragmentationContext
context = 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
Ptr DefragmentationPassMoveInfo
pPPassInfo <- 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 @DefragmentationPassMoveInfo)
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
"vmaBeginDefragmentationPass" ((Allocator
-> DefragmentationContext
-> Ptr DefragmentationPassMoveInfo
-> IO Result
ffiVmaBeginDefragmentationPass)
(Allocator
allocator)
(DefragmentationContext
context)
(Ptr DefragmentationPassMoveInfo
pPPassInfo))
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))
DefragmentationPassMoveInfo
pPassInfo <- 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 @DefragmentationPassMoveInfo Ptr DefragmentationPassMoveInfo
pPPassInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (DefragmentationPassMoveInfo
pPassInfo)
useDefragmentationPass :: forall io r . MonadIO io => Allocator -> DefragmentationContext -> (DefragmentationPassMoveInfo -> io r) -> io (("passInfo" ::: DefragmentationPassMoveInfo), r)
useDefragmentationPass :: forall (io :: * -> *) r.
MonadIO io =>
Allocator
-> DefragmentationContext
-> (DefragmentationPassMoveInfo -> io r)
-> io (DefragmentationPassMoveInfo, r)
useDefragmentationPass Allocator
allocator DefragmentationContext
context DefragmentationPassMoveInfo -> io r
a =
do
DefragmentationPassMoveInfo
x <- forall (io :: * -> *).
MonadIO io =>
Allocator
-> DefragmentationContext -> io DefragmentationPassMoveInfo
beginDefragmentationPass Allocator
allocator DefragmentationContext
context
r
r <- DefragmentationPassMoveInfo -> io r
a DefragmentationPassMoveInfo
x
DefragmentationPassMoveInfo
d <- (\(DefragmentationPassMoveInfo
_) -> forall (io :: * -> *).
MonadIO io =>
Allocator
-> DefragmentationContext -> io DefragmentationPassMoveInfo
endDefragmentationPass Allocator
allocator DefragmentationContext
context) DefragmentationPassMoveInfo
x
forall (f :: * -> *) a. Applicative f => a -> f a
pure (DefragmentationPassMoveInfo
d, r
r)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaEndDefragmentationPass" ffiVmaEndDefragmentationPass
:: Allocator -> DefragmentationContext -> Ptr DefragmentationPassMoveInfo -> IO Result
endDefragmentationPass :: forall io
. (MonadIO io)
=>
Allocator
->
DefragmentationContext
-> io (("passInfo" ::: DefragmentationPassMoveInfo))
endDefragmentationPass :: forall (io :: * -> *).
MonadIO io =>
Allocator
-> DefragmentationContext -> io DefragmentationPassMoveInfo
endDefragmentationPass Allocator
allocator DefragmentationContext
context = 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
Ptr DefragmentationPassMoveInfo
pPPassInfo <- 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 @DefragmentationPassMoveInfo)
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
"vmaEndDefragmentationPass" ((Allocator
-> DefragmentationContext
-> Ptr DefragmentationPassMoveInfo
-> IO Result
ffiVmaEndDefragmentationPass)
(Allocator
allocator)
(DefragmentationContext
context)
(Ptr DefragmentationPassMoveInfo
pPPassInfo))
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))
DefragmentationPassMoveInfo
pPassInfo <- 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 @DefragmentationPassMoveInfo Ptr DefragmentationPassMoveInfo
pPPassInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (DefragmentationPassMoveInfo
pPassInfo)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaBindBufferMemory" ffiVmaBindBufferMemory
:: Allocator -> Allocation -> Buffer -> IO Result
bindBufferMemory :: forall io
. (MonadIO io)
=>
Allocator
->
Allocation
->
Buffer
-> io ()
bindBufferMemory :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Allocation -> Buffer -> io ()
bindBufferMemory Allocator
allocator Allocation
allocation Buffer
buffer = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Result
r <- forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaBindBufferMemory" ((Allocator -> Allocation -> Buffer -> IO Result
ffiVmaBindBufferMemory)
(Allocator
allocator)
(Allocation
allocation)
(Buffer
buffer))
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))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaBindBufferMemory2" ffiVmaBindBufferMemory2
:: Allocator -> Allocation -> DeviceSize -> Buffer -> Ptr () -> IO Result
bindBufferMemory2 :: forall io
. (MonadIO io)
=>
Allocator
->
Allocation
->
("allocationLocalOffset" ::: DeviceSize)
->
Buffer
->
("next" ::: Ptr ())
-> io ()
bindBufferMemory2 :: forall (io :: * -> *).
MonadIO io =>
Allocator
-> Allocation
-> ("offset" ::: DeviceSize)
-> Buffer
-> ("userData" ::: Ptr ())
-> io ()
bindBufferMemory2 Allocator
allocator
Allocation
allocation
"offset" ::: DeviceSize
allocationLocalOffset
Buffer
buffer
"userData" ::: Ptr ()
next = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Result
r <- forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaBindBufferMemory2" ((Allocator
-> Allocation
-> ("offset" ::: DeviceSize)
-> Buffer
-> ("userData" ::: Ptr ())
-> IO Result
ffiVmaBindBufferMemory2)
(Allocator
allocator)
(Allocation
allocation)
("offset" ::: DeviceSize
allocationLocalOffset)
(Buffer
buffer)
("userData" ::: Ptr ()
next))
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))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaBindImageMemory" ffiVmaBindImageMemory
:: Allocator -> Allocation -> Image -> IO Result
bindImageMemory :: forall io
. (MonadIO io)
=>
Allocator
->
Allocation
->
Image
-> io ()
bindImageMemory :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Allocation -> Image -> io ()
bindImageMemory Allocator
allocator Allocation
allocation Image
image = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Result
r <- forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaBindImageMemory" ((Allocator -> Allocation -> Image -> IO Result
ffiVmaBindImageMemory)
(Allocator
allocator)
(Allocation
allocation)
(Image
image))
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))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaBindImageMemory2" ffiVmaBindImageMemory2
:: Allocator -> Allocation -> DeviceSize -> Image -> Ptr () -> IO Result
bindImageMemory2 :: forall io
. (MonadIO io)
=>
Allocator
->
Allocation
->
("allocationLocalOffset" ::: DeviceSize)
->
Image
->
("next" ::: Ptr ())
-> io ()
bindImageMemory2 :: forall (io :: * -> *).
MonadIO io =>
Allocator
-> Allocation
-> ("offset" ::: DeviceSize)
-> Image
-> ("userData" ::: Ptr ())
-> io ()
bindImageMemory2 Allocator
allocator
Allocation
allocation
"offset" ::: DeviceSize
allocationLocalOffset
Image
image
"userData" ::: Ptr ()
next = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Result
r <- forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaBindImageMemory2" ((Allocator
-> Allocation
-> ("offset" ::: DeviceSize)
-> Image
-> ("userData" ::: Ptr ())
-> IO Result
ffiVmaBindImageMemory2)
(Allocator
allocator)
(Allocation
allocation)
("offset" ::: DeviceSize
allocationLocalOffset)
(Image
image)
("userData" ::: Ptr ()
next))
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))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaCreateBuffer" ffiVmaCreateBuffer
:: Allocator -> Ptr (SomeStruct BufferCreateInfo) -> Ptr AllocationCreateInfo -> Ptr Buffer -> Ptr Allocation -> Ptr AllocationInfo -> IO Result
createBuffer :: forall a io
. (Extendss BufferCreateInfo a, PokeChain a, MonadIO io)
=>
Allocator
->
(BufferCreateInfo a)
->
AllocationCreateInfo
-> io (Buffer, Allocation, AllocationInfo)
createBuffer :: forall (a :: [*]) (io :: * -> *).
(Extendss BufferCreateInfo a, PokeChain a, MonadIO io) =>
Allocator
-> BufferCreateInfo a
-> AllocationCreateInfo
-> io (Buffer, Allocation, AllocationInfo)
createBuffer Allocator
allocator
BufferCreateInfo a
bufferCreateInfo
AllocationCreateInfo
allocationCreateInfo = 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
Ptr (BufferCreateInfo a)
pBufferCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (BufferCreateInfo a
bufferCreateInfo)
Ptr AllocationCreateInfo
pAllocationCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCreateInfo
allocationCreateInfo)
Ptr Buffer
pPBuffer <- 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 @Buffer Int
8) forall a. Ptr a -> IO ()
free
Ptr Allocation
pPAllocation <- 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 @Allocation Int
8) forall a. Ptr a -> IO ()
free
Ptr AllocationInfo
pPAllocationInfo <- 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 @AllocationInfo)
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
"vmaCreateBuffer" ((Allocator
-> Ptr (SomeStruct BufferCreateInfo)
-> Ptr AllocationCreateInfo
-> Ptr Buffer
-> Ptr Allocation
-> Ptr AllocationInfo
-> IO Result
ffiVmaCreateBuffer)
(Allocator
allocator)
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (BufferCreateInfo a)
pBufferCreateInfo)
Ptr AllocationCreateInfo
pAllocationCreateInfo
(Ptr Buffer
pPBuffer)
(Ptr Allocation
pPAllocation)
(Ptr AllocationInfo
pPAllocationInfo))
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))
Buffer
pBuffer <- 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 @Buffer Ptr Buffer
pPBuffer
Allocation
pAllocation <- 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 @Allocation Ptr Allocation
pPAllocation
AllocationInfo
pAllocationInfo <- 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 @AllocationInfo Ptr AllocationInfo
pPAllocationInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Buffer
pBuffer, Allocation
pAllocation, AllocationInfo
pAllocationInfo)
withBuffer :: forall a io r . (Extendss BufferCreateInfo a, PokeChain a, MonadIO io) => Allocator -> BufferCreateInfo a -> AllocationCreateInfo -> (io (Buffer, Allocation, AllocationInfo) -> ((Buffer, Allocation, AllocationInfo) -> io ()) -> r) -> r
withBuffer :: forall (a :: [*]) (io :: * -> *) r.
(Extendss BufferCreateInfo a, PokeChain a, MonadIO io) =>
Allocator
-> BufferCreateInfo a
-> AllocationCreateInfo
-> (io (Buffer, Allocation, AllocationInfo)
-> ((Buffer, Allocation, AllocationInfo) -> io ()) -> r)
-> r
withBuffer Allocator
allocator BufferCreateInfo a
pBufferCreateInfo AllocationCreateInfo
pAllocationCreateInfo io (Buffer, Allocation, AllocationInfo)
-> ((Buffer, Allocation, AllocationInfo) -> io ()) -> r
b =
io (Buffer, Allocation, AllocationInfo)
-> ((Buffer, Allocation, AllocationInfo) -> io ()) -> r
b (forall (a :: [*]) (io :: * -> *).
(Extendss BufferCreateInfo a, PokeChain a, MonadIO io) =>
Allocator
-> BufferCreateInfo a
-> AllocationCreateInfo
-> io (Buffer, Allocation, AllocationInfo)
createBuffer Allocator
allocator BufferCreateInfo a
pBufferCreateInfo AllocationCreateInfo
pAllocationCreateInfo)
(\(Buffer
o0, Allocation
o1, AllocationInfo
_) -> forall (io :: * -> *).
MonadIO io =>
Allocator -> Buffer -> Allocation -> io ()
destroyBuffer Allocator
allocator Buffer
o0 Allocation
o1)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaCreateBufferWithAlignment" ffiVmaCreateBufferWithAlignment
:: Allocator -> Ptr (SomeStruct BufferCreateInfo) -> Ptr AllocationCreateInfo -> DeviceSize -> Ptr Buffer -> Ptr Allocation -> Ptr AllocationInfo -> IO Result
createBufferWithAlignment :: forall a io
. ( Extendss BufferCreateInfo a
, PokeChain a
, MonadIO io )
=>
Allocator
->
(BufferCreateInfo a)
->
AllocationCreateInfo
->
("minAlignment" ::: DeviceSize)
-> io (Buffer, Allocation, AllocationInfo)
createBufferWithAlignment :: forall (a :: [*]) (io :: * -> *).
(Extendss BufferCreateInfo a, PokeChain a, MonadIO io) =>
Allocator
-> BufferCreateInfo a
-> AllocationCreateInfo
-> ("offset" ::: DeviceSize)
-> io (Buffer, Allocation, AllocationInfo)
createBufferWithAlignment Allocator
allocator
BufferCreateInfo a
bufferCreateInfo
AllocationCreateInfo
allocationCreateInfo
"offset" ::: DeviceSize
minAlignment = 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
Ptr (BufferCreateInfo a)
pBufferCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (BufferCreateInfo a
bufferCreateInfo)
Ptr AllocationCreateInfo
pAllocationCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCreateInfo
allocationCreateInfo)
Ptr Buffer
pPBuffer <- 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 @Buffer Int
8) forall a. Ptr a -> IO ()
free
Ptr Allocation
pPAllocation <- 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 @Allocation Int
8) forall a. Ptr a -> IO ()
free
Ptr AllocationInfo
pPAllocationInfo <- 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 @AllocationInfo)
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
"vmaCreateBufferWithAlignment" ((Allocator
-> Ptr (SomeStruct BufferCreateInfo)
-> Ptr AllocationCreateInfo
-> ("offset" ::: DeviceSize)
-> Ptr Buffer
-> Ptr Allocation
-> Ptr AllocationInfo
-> IO Result
ffiVmaCreateBufferWithAlignment)
(Allocator
allocator)
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (BufferCreateInfo a)
pBufferCreateInfo)
Ptr AllocationCreateInfo
pAllocationCreateInfo
("offset" ::: DeviceSize
minAlignment)
(Ptr Buffer
pPBuffer)
(Ptr Allocation
pPAllocation)
(Ptr AllocationInfo
pPAllocationInfo))
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))
Buffer
pBuffer <- 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 @Buffer Ptr Buffer
pPBuffer
Allocation
pAllocation <- 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 @Allocation Ptr Allocation
pPAllocation
AllocationInfo
pAllocationInfo <- 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 @AllocationInfo Ptr AllocationInfo
pPAllocationInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Buffer
pBuffer, Allocation
pAllocation, AllocationInfo
pAllocationInfo)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaCreateAliasingBuffer" ffiVmaCreateAliasingBuffer
:: Allocator -> Allocation -> Ptr (SomeStruct BufferCreateInfo) -> Ptr Buffer -> IO Result
createAliasingBuffer :: forall a io
. (Extendss BufferCreateInfo a, PokeChain a, MonadIO io)
=>
Allocator
->
Allocation
->
(BufferCreateInfo a)
-> io (Buffer)
createAliasingBuffer :: forall (a :: [*]) (io :: * -> *).
(Extendss BufferCreateInfo a, PokeChain a, MonadIO io) =>
Allocator -> Allocation -> BufferCreateInfo a -> io Buffer
createAliasingBuffer Allocator
allocator
Allocation
allocation
BufferCreateInfo a
bufferCreateInfo = 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
Ptr (BufferCreateInfo a)
pBufferCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (BufferCreateInfo a
bufferCreateInfo)
Ptr Buffer
pPBuffer <- 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 @Buffer 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
"vmaCreateAliasingBuffer" ((Allocator
-> Allocation
-> Ptr (SomeStruct BufferCreateInfo)
-> Ptr Buffer
-> IO Result
ffiVmaCreateAliasingBuffer)
(Allocator
allocator)
(Allocation
allocation)
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (BufferCreateInfo a)
pBufferCreateInfo)
(Ptr Buffer
pPBuffer))
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))
Buffer
pBuffer <- 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 @Buffer Ptr Buffer
pPBuffer
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Buffer
pBuffer)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaCreateAliasingBuffer2" ffiVmaCreateAliasingBuffer2
:: Allocator -> Allocation -> DeviceSize -> Ptr (SomeStruct BufferCreateInfo) -> Ptr Buffer -> IO Result
createAliasingBuffer2 :: forall a io
. (Extendss BufferCreateInfo a, PokeChain a, MonadIO io)
=>
Allocator
->
Allocation
->
("allocationLocalOffset" ::: DeviceSize)
->
(BufferCreateInfo a)
-> io (Buffer)
createAliasingBuffer2 :: forall (a :: [*]) (io :: * -> *).
(Extendss BufferCreateInfo a, PokeChain a, MonadIO io) =>
Allocator
-> Allocation
-> ("offset" ::: DeviceSize)
-> BufferCreateInfo a
-> io Buffer
createAliasingBuffer2 Allocator
allocator
Allocation
allocation
"offset" ::: DeviceSize
allocationLocalOffset
BufferCreateInfo a
bufferCreateInfo = 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
Ptr (BufferCreateInfo a)
pBufferCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (BufferCreateInfo a
bufferCreateInfo)
Ptr Buffer
pPBuffer <- 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 @Buffer 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
"vmaCreateAliasingBuffer2" ((Allocator
-> Allocation
-> ("offset" ::: DeviceSize)
-> Ptr (SomeStruct BufferCreateInfo)
-> Ptr Buffer
-> IO Result
ffiVmaCreateAliasingBuffer2)
(Allocator
allocator)
(Allocation
allocation)
("offset" ::: DeviceSize
allocationLocalOffset)
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (BufferCreateInfo a)
pBufferCreateInfo)
(Ptr Buffer
pPBuffer))
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))
Buffer
pBuffer <- 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 @Buffer Ptr Buffer
pPBuffer
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Buffer
pBuffer)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaDestroyBuffer" ffiVmaDestroyBuffer
:: Allocator -> Buffer -> Allocation -> IO ()
destroyBuffer :: forall io
. (MonadIO io)
=>
Allocator
->
Buffer
->
Allocation
-> io ()
destroyBuffer :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Buffer -> Allocation -> io ()
destroyBuffer Allocator
allocator Buffer
buffer Allocation
allocation = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaDestroyBuffer" ((Allocator -> Buffer -> Allocation -> IO ()
ffiVmaDestroyBuffer)
(Allocator
allocator)
(Buffer
buffer)
(Allocation
allocation))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaCreateImage" ffiVmaCreateImage
:: Allocator -> Ptr (SomeStruct ImageCreateInfo) -> Ptr AllocationCreateInfo -> Ptr Image -> Ptr Allocation -> Ptr AllocationInfo -> IO Result
createImage :: forall a io
. (Extendss ImageCreateInfo a, PokeChain a, MonadIO io)
=>
Allocator
->
(ImageCreateInfo a)
->
AllocationCreateInfo
-> io (Image, Allocation, AllocationInfo)
createImage :: forall (a :: [*]) (io :: * -> *).
(Extendss ImageCreateInfo a, PokeChain a, MonadIO io) =>
Allocator
-> ImageCreateInfo a
-> AllocationCreateInfo
-> io (Image, Allocation, AllocationInfo)
createImage Allocator
allocator
ImageCreateInfo a
imageCreateInfo
AllocationCreateInfo
allocationCreateInfo = 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
Ptr (ImageCreateInfo a)
pImageCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (ImageCreateInfo a
imageCreateInfo)
Ptr AllocationCreateInfo
pAllocationCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCreateInfo
allocationCreateInfo)
Ptr Image
pPImage <- 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 @Image Int
8) forall a. Ptr a -> IO ()
free
Ptr Allocation
pPAllocation <- 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 @Allocation Int
8) forall a. Ptr a -> IO ()
free
Ptr AllocationInfo
pPAllocationInfo <- 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 @AllocationInfo)
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
"vmaCreateImage" ((Allocator
-> Ptr (SomeStruct ImageCreateInfo)
-> Ptr AllocationCreateInfo
-> Ptr Image
-> Ptr Allocation
-> Ptr AllocationInfo
-> IO Result
ffiVmaCreateImage)
(Allocator
allocator)
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (ImageCreateInfo a)
pImageCreateInfo)
Ptr AllocationCreateInfo
pAllocationCreateInfo
(Ptr Image
pPImage)
(Ptr Allocation
pPAllocation)
(Ptr AllocationInfo
pPAllocationInfo))
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))
Image
pImage <- 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 @Image Ptr Image
pPImage
Allocation
pAllocation <- 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 @Allocation Ptr Allocation
pPAllocation
AllocationInfo
pAllocationInfo <- 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 @AllocationInfo Ptr AllocationInfo
pPAllocationInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Image
pImage, Allocation
pAllocation, AllocationInfo
pAllocationInfo)
withImage :: forall a io r . (Extendss ImageCreateInfo a, PokeChain a, MonadIO io) => Allocator -> ImageCreateInfo a -> AllocationCreateInfo -> (io (Image, Allocation, AllocationInfo) -> ((Image, Allocation, AllocationInfo) -> io ()) -> r) -> r
withImage :: forall (a :: [*]) (io :: * -> *) r.
(Extendss ImageCreateInfo a, PokeChain a, MonadIO io) =>
Allocator
-> ImageCreateInfo a
-> AllocationCreateInfo
-> (io (Image, Allocation, AllocationInfo)
-> ((Image, Allocation, AllocationInfo) -> io ()) -> r)
-> r
withImage Allocator
allocator ImageCreateInfo a
pImageCreateInfo AllocationCreateInfo
pAllocationCreateInfo io (Image, Allocation, AllocationInfo)
-> ((Image, Allocation, AllocationInfo) -> io ()) -> r
b =
io (Image, Allocation, AllocationInfo)
-> ((Image, Allocation, AllocationInfo) -> io ()) -> r
b (forall (a :: [*]) (io :: * -> *).
(Extendss ImageCreateInfo a, PokeChain a, MonadIO io) =>
Allocator
-> ImageCreateInfo a
-> AllocationCreateInfo
-> io (Image, Allocation, AllocationInfo)
createImage Allocator
allocator ImageCreateInfo a
pImageCreateInfo AllocationCreateInfo
pAllocationCreateInfo)
(\(Image
o0, Allocation
o1, AllocationInfo
_) -> forall (io :: * -> *).
MonadIO io =>
Allocator -> Image -> Allocation -> io ()
destroyImage Allocator
allocator Image
o0 Allocation
o1)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaCreateAliasingImage" ffiVmaCreateAliasingImage
:: Allocator -> Allocation -> Ptr (SomeStruct ImageCreateInfo) -> Ptr Image -> IO Result
createAliasingImage :: forall a io
. (Extendss ImageCreateInfo a, PokeChain a, MonadIO io)
=>
Allocator
->
Allocation
->
(ImageCreateInfo a)
-> io (Image)
createAliasingImage :: forall (a :: [*]) (io :: * -> *).
(Extendss ImageCreateInfo a, PokeChain a, MonadIO io) =>
Allocator -> Allocation -> ImageCreateInfo a -> io Image
createAliasingImage Allocator
allocator
Allocation
allocation
ImageCreateInfo a
imageCreateInfo = 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
Ptr (ImageCreateInfo a)
pImageCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (ImageCreateInfo a
imageCreateInfo)
Ptr Image
pPImage <- 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 @Image 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
"vmaCreateAliasingImage" ((Allocator
-> Allocation
-> Ptr (SomeStruct ImageCreateInfo)
-> Ptr Image
-> IO Result
ffiVmaCreateAliasingImage)
(Allocator
allocator)
(Allocation
allocation)
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (ImageCreateInfo a)
pImageCreateInfo)
(Ptr Image
pPImage))
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))
Image
pImage <- 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 @Image Ptr Image
pPImage
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Image
pImage)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaCreateAliasingImage2" ffiVmaCreateAliasingImage2
:: Allocator -> Allocation -> DeviceSize -> Ptr (SomeStruct ImageCreateInfo) -> Ptr Image -> IO Result
createAliasingImage2 :: forall a io
. (Extendss ImageCreateInfo a, PokeChain a, MonadIO io)
=>
Allocator
->
Allocation
->
("allocationLocalOffset" ::: DeviceSize)
->
(ImageCreateInfo a)
-> io (Image)
createAliasingImage2 :: forall (a :: [*]) (io :: * -> *).
(Extendss ImageCreateInfo a, PokeChain a, MonadIO io) =>
Allocator
-> Allocation
-> ("offset" ::: DeviceSize)
-> ImageCreateInfo a
-> io Image
createAliasingImage2 Allocator
allocator
Allocation
allocation
"offset" ::: DeviceSize
allocationLocalOffset
ImageCreateInfo a
imageCreateInfo = 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
Ptr (ImageCreateInfo a)
pImageCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (ImageCreateInfo a
imageCreateInfo)
Ptr Image
pPImage <- 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 @Image 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
"vmaCreateAliasingImage2" ((Allocator
-> Allocation
-> ("offset" ::: DeviceSize)
-> Ptr (SomeStruct ImageCreateInfo)
-> Ptr Image
-> IO Result
ffiVmaCreateAliasingImage2)
(Allocator
allocator)
(Allocation
allocation)
("offset" ::: DeviceSize
allocationLocalOffset)
(forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (ImageCreateInfo a)
pImageCreateInfo)
(Ptr Image
pPImage))
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))
Image
pImage <- 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 @Image Ptr Image
pPImage
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Image
pImage)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaDestroyImage" ffiVmaDestroyImage
:: Allocator -> Image -> Allocation -> IO ()
destroyImage :: forall io
. (MonadIO io)
=>
Allocator
->
Image
->
Allocation
-> io ()
destroyImage :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Image -> Allocation -> io ()
destroyImage Allocator
allocator Image
image Allocation
allocation = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaDestroyImage" ((Allocator -> Image -> Allocation -> IO ()
ffiVmaDestroyImage)
(Allocator
allocator)
(Image
image)
(Allocation
allocation))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaCreateVirtualBlock" ffiVmaCreateVirtualBlock
:: Ptr VirtualBlockCreateInfo -> Ptr VirtualBlock -> IO Result
createVirtualBlock :: forall io
. (MonadIO io)
=>
VirtualBlockCreateInfo
-> io (VirtualBlock)
createVirtualBlock :: forall (io :: * -> *).
MonadIO io =>
VirtualBlockCreateInfo -> io VirtualBlock
createVirtualBlock VirtualBlockCreateInfo
createInfo = 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
Ptr VirtualBlockCreateInfo
pCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (VirtualBlockCreateInfo
createInfo)
Ptr VirtualBlock
pPVirtualBlock <- 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 @VirtualBlock 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
"vmaCreateVirtualBlock" ((Ptr VirtualBlockCreateInfo -> Ptr VirtualBlock -> IO Result
ffiVmaCreateVirtualBlock)
Ptr VirtualBlockCreateInfo
pCreateInfo
(Ptr VirtualBlock
pPVirtualBlock))
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))
VirtualBlock
pVirtualBlock <- 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 @VirtualBlock Ptr VirtualBlock
pPVirtualBlock
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (VirtualBlock
pVirtualBlock)
withVirtualBlock :: forall io r . MonadIO io => VirtualBlockCreateInfo -> (io VirtualBlock -> (VirtualBlock -> io ()) -> r) -> r
withVirtualBlock :: forall (io :: * -> *) r.
MonadIO io =>
VirtualBlockCreateInfo
-> (io VirtualBlock -> (VirtualBlock -> io ()) -> r) -> r
withVirtualBlock VirtualBlockCreateInfo
pCreateInfo io VirtualBlock -> (VirtualBlock -> io ()) -> r
b =
io VirtualBlock -> (VirtualBlock -> io ()) -> r
b (forall (io :: * -> *).
MonadIO io =>
VirtualBlockCreateInfo -> io VirtualBlock
createVirtualBlock VirtualBlockCreateInfo
pCreateInfo)
(\(VirtualBlock
o0) -> forall (io :: * -> *). MonadIO io => VirtualBlock -> io ()
destroyVirtualBlock VirtualBlock
o0)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaDestroyVirtualBlock" ffiVmaDestroyVirtualBlock
:: VirtualBlock -> IO ()
destroyVirtualBlock :: forall io
. (MonadIO io)
=>
VirtualBlock
-> io ()
destroyVirtualBlock :: forall (io :: * -> *). MonadIO io => VirtualBlock -> io ()
destroyVirtualBlock VirtualBlock
virtualBlock = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaDestroyVirtualBlock" ((VirtualBlock -> IO ()
ffiVmaDestroyVirtualBlock)
(VirtualBlock
virtualBlock))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaIsVirtualBlockEmpty" ffiVmaIsVirtualBlockEmpty
:: VirtualBlock -> IO Bool32
isVirtualBlockEmpty :: forall io
. (MonadIO io)
=>
VirtualBlock
-> io (Bool)
isVirtualBlockEmpty :: forall (io :: * -> *). MonadIO io => VirtualBlock -> io Bool
isVirtualBlockEmpty VirtualBlock
virtualBlock = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Bool32
r <- forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaIsVirtualBlockEmpty" ((VirtualBlock -> IO Bool32
ffiVmaIsVirtualBlockEmpty)
(VirtualBlock
virtualBlock))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ((Bool32 -> Bool
bool32ToBool Bool32
r))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaGetVirtualAllocationInfo" ffiVmaGetVirtualAllocationInfo
:: VirtualBlock -> VirtualAllocation -> Ptr VirtualAllocationInfo -> IO ()
getVirtualAllocationInfo :: forall io
. (MonadIO io)
=>
VirtualBlock
->
VirtualAllocation
-> io (("virtualAllocInfo" ::: VirtualAllocationInfo))
getVirtualAllocationInfo :: forall (io :: * -> *).
MonadIO io =>
VirtualBlock -> VirtualAllocation -> io VirtualAllocationInfo
getVirtualAllocationInfo VirtualBlock
virtualBlock VirtualAllocation
allocation = 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
Ptr VirtualAllocationInfo
pPVirtualAllocInfo <- 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 @VirtualAllocationInfo)
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
"vmaGetVirtualAllocationInfo" ((VirtualBlock
-> VirtualAllocation -> Ptr VirtualAllocationInfo -> IO ()
ffiVmaGetVirtualAllocationInfo)
(VirtualBlock
virtualBlock)
(VirtualAllocation
allocation)
(Ptr VirtualAllocationInfo
pPVirtualAllocInfo))
VirtualAllocationInfo
pVirtualAllocInfo <- 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 @VirtualAllocationInfo Ptr VirtualAllocationInfo
pPVirtualAllocInfo
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (VirtualAllocationInfo
pVirtualAllocInfo)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaVirtualAllocate" ffiVmaVirtualAllocate
:: VirtualBlock -> Ptr VirtualAllocationCreateInfo -> Ptr VirtualAllocation -> Ptr DeviceSize -> IO Result
virtualAllocate :: forall io
. (MonadIO io)
=>
VirtualBlock
->
VirtualAllocationCreateInfo
-> io (VirtualAllocation, ("offset" ::: DeviceSize))
virtualAllocate :: forall (io :: * -> *).
MonadIO io =>
VirtualBlock
-> VirtualAllocationCreateInfo
-> io (VirtualAllocation, "offset" ::: DeviceSize)
virtualAllocate VirtualBlock
virtualBlock VirtualAllocationCreateInfo
createInfo = 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
Ptr VirtualAllocationCreateInfo
pCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (VirtualAllocationCreateInfo
createInfo)
Ptr VirtualAllocation
pPAllocation <- 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 @VirtualAllocation Int
8) forall a. Ptr a -> IO ()
free
Ptr ("offset" ::: DeviceSize)
pPOffset <- 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 @DeviceSize 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
"vmaVirtualAllocate" ((VirtualBlock
-> Ptr VirtualAllocationCreateInfo
-> Ptr VirtualAllocation
-> Ptr ("offset" ::: DeviceSize)
-> IO Result
ffiVmaVirtualAllocate)
(VirtualBlock
virtualBlock)
Ptr VirtualAllocationCreateInfo
pCreateInfo
(Ptr VirtualAllocation
pPAllocation)
(Ptr ("offset" ::: DeviceSize)
pPOffset))
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))
VirtualAllocation
pAllocation <- 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 @VirtualAllocation Ptr VirtualAllocation
pPAllocation
"offset" ::: DeviceSize
pOffset <- 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 @DeviceSize Ptr ("offset" ::: DeviceSize)
pPOffset
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (VirtualAllocation
pAllocation, "offset" ::: DeviceSize
pOffset)
withVirtualAllocation :: forall io r . MonadIO io => VirtualBlock -> VirtualAllocationCreateInfo -> (io (VirtualAllocation, DeviceSize) -> ((VirtualAllocation, DeviceSize) -> io ()) -> r) -> r
withVirtualAllocation :: forall (io :: * -> *) r.
MonadIO io =>
VirtualBlock
-> VirtualAllocationCreateInfo
-> (io (VirtualAllocation, "offset" ::: DeviceSize)
-> ((VirtualAllocation, "offset" ::: DeviceSize) -> io ()) -> r)
-> r
withVirtualAllocation VirtualBlock
virtualBlock VirtualAllocationCreateInfo
pCreateInfo io (VirtualAllocation, "offset" ::: DeviceSize)
-> ((VirtualAllocation, "offset" ::: DeviceSize) -> io ()) -> r
b =
io (VirtualAllocation, "offset" ::: DeviceSize)
-> ((VirtualAllocation, "offset" ::: DeviceSize) -> io ()) -> r
b (forall (io :: * -> *).
MonadIO io =>
VirtualBlock
-> VirtualAllocationCreateInfo
-> io (VirtualAllocation, "offset" ::: DeviceSize)
virtualAllocate VirtualBlock
virtualBlock VirtualAllocationCreateInfo
pCreateInfo)
(\(VirtualAllocation
o0, "offset" ::: DeviceSize
_) -> forall (io :: * -> *).
MonadIO io =>
VirtualBlock -> VirtualAllocation -> io ()
virtualFree VirtualBlock
virtualBlock VirtualAllocation
o0)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaVirtualFree" ffiVmaVirtualFree
:: VirtualBlock -> VirtualAllocation -> IO ()
virtualFree :: forall io
. (MonadIO io)
=>
VirtualBlock
->
VirtualAllocation
-> io ()
virtualFree :: forall (io :: * -> *).
MonadIO io =>
VirtualBlock -> VirtualAllocation -> io ()
virtualFree VirtualBlock
virtualBlock VirtualAllocation
allocation = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaVirtualFree" ((VirtualBlock -> VirtualAllocation -> IO ()
ffiVmaVirtualFree)
(VirtualBlock
virtualBlock)
(VirtualAllocation
allocation))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaClearVirtualBlock" ffiVmaClearVirtualBlock
:: VirtualBlock -> IO ()
clearVirtualBlock :: forall io
. (MonadIO io)
=>
VirtualBlock
-> io ()
clearVirtualBlock :: forall (io :: * -> *). MonadIO io => VirtualBlock -> io ()
clearVirtualBlock VirtualBlock
virtualBlock = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaClearVirtualBlock" ((VirtualBlock -> IO ()
ffiVmaClearVirtualBlock)
(VirtualBlock
virtualBlock))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaSetVirtualAllocationUserData" ffiVmaSetVirtualAllocationUserData
:: VirtualBlock -> VirtualAllocation -> Ptr () -> IO ()
setVirtualAllocationUserData :: forall io
. (MonadIO io)
=>
VirtualBlock
->
VirtualAllocation
->
("userData" ::: Ptr ())
-> io ()
setVirtualAllocationUserData :: forall (io :: * -> *).
MonadIO io =>
VirtualBlock
-> VirtualAllocation -> ("userData" ::: Ptr ()) -> io ()
setVirtualAllocationUserData VirtualBlock
virtualBlock VirtualAllocation
allocation "userData" ::: Ptr ()
userData = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaSetVirtualAllocationUserData" ((VirtualBlock
-> VirtualAllocation -> ("userData" ::: Ptr ()) -> IO ()
ffiVmaSetVirtualAllocationUserData)
(VirtualBlock
virtualBlock)
(VirtualAllocation
allocation)
("userData" ::: Ptr ()
userData))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaGetVirtualBlockStatistics" ffiVmaGetVirtualBlockStatistics
:: VirtualBlock -> Ptr Statistics -> IO ()
getVirtualBlockStatistics :: forall io
. (MonadIO io)
=>
VirtualBlock
-> io (("stats" ::: Statistics))
getVirtualBlockStatistics :: forall (io :: * -> *). MonadIO io => VirtualBlock -> io Statistics
getVirtualBlockStatistics VirtualBlock
virtualBlock = 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
Ptr Statistics
pPStats <- 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 @Statistics)
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
"vmaGetVirtualBlockStatistics" ((VirtualBlock -> Ptr Statistics -> IO ()
ffiVmaGetVirtualBlockStatistics)
(VirtualBlock
virtualBlock)
(Ptr Statistics
pPStats))
Statistics
pStats <- 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 @Statistics Ptr Statistics
pPStats
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (Statistics
pStats)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaCalculateVirtualBlockStatistics" ffiVmaCalculateVirtualBlockStatistics
:: VirtualBlock -> Ptr DetailedStatistics -> IO ()
calculateVirtualBlockStatistics :: forall io
. (MonadIO io)
=>
VirtualBlock
-> io (("stats" ::: DetailedStatistics))
calculateVirtualBlockStatistics :: forall (io :: * -> *).
MonadIO io =>
VirtualBlock -> io DetailedStatistics
calculateVirtualBlockStatistics VirtualBlock
virtualBlock = 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
Ptr DetailedStatistics
pPStats <- 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 @DetailedStatistics)
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
"vmaCalculateVirtualBlockStatistics" ((VirtualBlock -> Ptr DetailedStatistics -> IO ()
ffiVmaCalculateVirtualBlockStatistics)
(VirtualBlock
virtualBlock)
(Ptr DetailedStatistics
pPStats))
DetailedStatistics
pStats <- 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 @DetailedStatistics Ptr DetailedStatistics
pPStats
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (DetailedStatistics
pStats)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaBuildVirtualBlockStatsString" ffiVmaBuildVirtualBlockStatsString
:: VirtualBlock -> Ptr (Ptr CChar) -> Bool32 -> IO ()
buildVirtualBlockStatsString :: forall io
. (MonadIO io)
=>
VirtualBlock
->
("detailedMap" ::: Bool)
-> io (("statsString" ::: Ptr CChar))
buildVirtualBlockStatsString :: forall (io :: * -> *).
MonadIO io =>
VirtualBlock -> Bool -> io ("name" ::: Ptr CChar)
buildVirtualBlockStatsString VirtualBlock
virtualBlock Bool
detailedMap = 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
Ptr ("name" ::: Ptr CChar)
pPpStatsString <- 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 @(Ptr CChar) Int
8) forall a. Ptr a -> IO ()
free
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
"vmaBuildVirtualBlockStatsString" ((VirtualBlock -> Ptr ("name" ::: Ptr CChar) -> Bool32 -> IO ()
ffiVmaBuildVirtualBlockStatsString)
(VirtualBlock
virtualBlock)
(Ptr ("name" ::: Ptr CChar)
pPpStatsString)
(Bool -> Bool32
boolToBool32 (Bool
detailedMap)))
"name" ::: Ptr CChar
ppStatsString <- 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 @(Ptr CChar) Ptr ("name" ::: Ptr CChar)
pPpStatsString
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("name" ::: Ptr CChar
ppStatsString)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaFreeVirtualBlockStatsString" ffiVmaFreeVirtualBlockStatsString
:: VirtualBlock -> Ptr CChar -> IO ()
freeVirtualBlockStatsString :: forall io
. (MonadIO io)
=>
VirtualBlock
->
("statsString" ::: Ptr CChar)
-> io ()
freeVirtualBlockStatsString :: forall (io :: * -> *).
MonadIO io =>
VirtualBlock -> ("name" ::: Ptr CChar) -> io ()
freeVirtualBlockStatsString VirtualBlock
virtualBlock "name" ::: Ptr CChar
statsString = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaFreeVirtualBlockStatsString" ((VirtualBlock -> ("name" ::: Ptr CChar) -> IO ()
ffiVmaFreeVirtualBlockStatsString)
(VirtualBlock
virtualBlock)
("name" ::: Ptr CChar
statsString))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaBuildStatsString" ffiVmaBuildStatsString
:: Allocator -> Ptr (Ptr CChar) -> Bool32 -> IO ()
buildStatsString :: forall io
. (MonadIO io)
=>
Allocator
->
("detailedMap" ::: Bool)
-> io (("statsString" ::: Ptr CChar))
buildStatsString :: forall (io :: * -> *).
MonadIO io =>
Allocator -> Bool -> io ("name" ::: Ptr CChar)
buildStatsString Allocator
allocator Bool
detailedMap = 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
Ptr ("name" ::: Ptr CChar)
pPpStatsString <- 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 @(Ptr CChar) Int
8) forall a. Ptr a -> IO ()
free
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
"vmaBuildStatsString" ((Allocator -> Ptr ("name" ::: Ptr CChar) -> Bool32 -> IO ()
ffiVmaBuildStatsString)
(Allocator
allocator)
(Ptr ("name" ::: Ptr CChar)
pPpStatsString)
(Bool -> Bool32
boolToBool32 (Bool
detailedMap)))
"name" ::: Ptr CChar
ppStatsString <- 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 @(Ptr CChar) Ptr ("name" ::: Ptr CChar)
pPpStatsString
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("name" ::: Ptr CChar
ppStatsString)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"vmaFreeStatsString" ffiVmaFreeStatsString
:: Allocator -> Ptr CChar -> IO ()
freeStatsString :: forall io
. (MonadIO io)
=>
Allocator
->
("statsString" ::: Ptr CChar)
-> io ()
freeStatsString :: forall (io :: * -> *).
MonadIO io =>
Allocator -> ("name" ::: Ptr CChar) -> io ()
freeStatsString Allocator
allocator "name" ::: Ptr CChar
statsString = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. String -> IO a -> IO a
traceAroundEvent String
"vmaFreeStatsString" ((Allocator -> ("name" ::: Ptr CChar) -> IO ()
ffiVmaFreeStatsString)
(Allocator
allocator)
("name" ::: Ptr CChar
statsString))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
type FN_vkAllocateMemory = Ptr Device_T -> ("pAllocateInfo" ::: Ptr (SomeStruct MemoryAllocateInfo)) -> ("pAllocator" ::: Ptr AllocationCallbacks) -> ("pMemory" ::: Ptr DeviceMemory) -> IO Result
type PFN_vkAllocateMemory = FunPtr FN_vkAllocateMemory
type FN_vkBindBufferMemory = Ptr Device_T -> Buffer -> DeviceMemory -> ("memoryOffset" ::: DeviceSize) -> IO Result
type PFN_vkBindBufferMemory = FunPtr FN_vkBindBufferMemory
type FN_vkBindBufferMemory2KHR = Ptr Device_T -> ("bindInfoCount" ::: Word32) -> ("pBindInfos" ::: Ptr (SomeStruct BindBufferMemoryInfo)) -> IO Result
type PFN_vkBindBufferMemory2KHR = FunPtr FN_vkBindBufferMemory2KHR
type FN_vkBindImageMemory = Ptr Device_T -> Image -> DeviceMemory -> ("memoryOffset" ::: DeviceSize) -> IO Result
type PFN_vkBindImageMemory = FunPtr FN_vkBindImageMemory
type FN_vkBindImageMemory2KHR = Ptr Device_T -> ("bindInfoCount" ::: Word32) -> ("pBindInfos" ::: Ptr (SomeStruct BindImageMemoryInfo)) -> IO Result
type PFN_vkBindImageMemory2KHR = FunPtr FN_vkBindImageMemory2KHR
type FN_vkCmdCopyBuffer = Ptr CommandBuffer_T -> ("srcBuffer" ::: Buffer) -> ("dstBuffer" ::: Buffer) -> ("regionCount" ::: Word32) -> ("pRegions" ::: Ptr BufferCopy) -> IO ()
type PFN_vkCmdCopyBuffer = FunPtr FN_vkCmdCopyBuffer
type FN_vkCreateBuffer = Ptr Device_T -> ("pCreateInfo" ::: Ptr (SomeStruct BufferCreateInfo)) -> ("pAllocator" ::: Ptr AllocationCallbacks) -> ("pBuffer" ::: Ptr Buffer) -> IO Result
type PFN_vkCreateBuffer = FunPtr FN_vkCreateBuffer
type FN_vkCreateImage = Ptr Device_T -> ("pCreateInfo" ::: Ptr (SomeStruct ImageCreateInfo)) -> ("pAllocator" ::: Ptr AllocationCallbacks) -> ("pImage" ::: Ptr Image) -> IO Result
type PFN_vkCreateImage = FunPtr FN_vkCreateImage
type FN_vkDestroyBuffer = Ptr Device_T -> Buffer -> ("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()
type PFN_vkDestroyBuffer = FunPtr FN_vkDestroyBuffer
type FN_vkDestroyImage = Ptr Device_T -> Image -> ("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()
type PFN_vkDestroyImage = FunPtr FN_vkDestroyImage
type FN_vkFlushMappedMemoryRanges = Ptr Device_T -> ("memoryRangeCount" ::: Word32) -> ("pMemoryRanges" ::: Ptr MappedMemoryRange) -> IO Result
type PFN_vkFlushMappedMemoryRanges = FunPtr FN_vkFlushMappedMemoryRanges
type FN_vkFreeMemory = Ptr Device_T -> DeviceMemory -> ("pAllocator" ::: Ptr AllocationCallbacks) -> IO ()
type PFN_vkFreeMemory = FunPtr FN_vkFreeMemory
type FN_vkGetBufferMemoryRequirements = Ptr Device_T -> Buffer -> ("pMemoryRequirements" ::: Ptr MemoryRequirements) -> IO ()
type PFN_vkGetBufferMemoryRequirements = FunPtr FN_vkGetBufferMemoryRequirements
type FN_vkGetBufferMemoryRequirements2KHR = Ptr Device_T -> ("pInfo" ::: Ptr BufferMemoryRequirementsInfo2) -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2)) -> IO ()
type PFN_vkGetBufferMemoryRequirements2KHR = FunPtr FN_vkGetBufferMemoryRequirements2KHR
type FN_vkGetImageMemoryRequirements = Ptr Device_T -> Image -> ("pMemoryRequirements" ::: Ptr MemoryRequirements) -> IO ()
type PFN_vkGetImageMemoryRequirements = FunPtr FN_vkGetImageMemoryRequirements
type FN_vkGetImageMemoryRequirements2KHR = Ptr Device_T -> ("pInfo" ::: Ptr (SomeStruct ImageMemoryRequirementsInfo2)) -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2)) -> IO ()
type PFN_vkGetImageMemoryRequirements2KHR = FunPtr FN_vkGetImageMemoryRequirements2KHR
type FN_vkGetPhysicalDeviceMemoryProperties = Ptr PhysicalDevice_T -> ("pMemoryProperties" ::: Ptr PhysicalDeviceMemoryProperties) -> IO ()
type PFN_vkGetPhysicalDeviceMemoryProperties = FunPtr FN_vkGetPhysicalDeviceMemoryProperties
type FN_vkGetPhysicalDeviceMemoryProperties2KHR = Ptr PhysicalDevice_T -> ("pMemoryProperties" ::: Ptr (SomeStruct PhysicalDeviceMemoryProperties2)) -> IO ()
type PFN_vkGetPhysicalDeviceMemoryProperties2KHR = FunPtr FN_vkGetPhysicalDeviceMemoryProperties2KHR
type FN_vkGetPhysicalDeviceProperties = Ptr PhysicalDevice_T -> ("pProperties" ::: Ptr PhysicalDeviceProperties) -> IO ()
type PFN_vkGetPhysicalDeviceProperties = FunPtr FN_vkGetPhysicalDeviceProperties
type FN_vkGetDeviceProcAddr = Ptr Device_T -> ("pName" ::: Ptr CChar) -> IO PFN_vkVoidFunction
type PFN_vkGetDeviceProcAddr = FunPtr FN_vkGetDeviceProcAddr
type FN_vkGetInstanceProcAddr = Ptr Instance_T -> ("pName" ::: Ptr CChar) -> IO PFN_vkVoidFunction
type PFN_vkGetInstanceProcAddr = FunPtr FN_vkGetInstanceProcAddr
type FN_vkInvalidateMappedMemoryRanges = Ptr Device_T -> ("memoryRangeCount" ::: Word32) -> ("pMemoryRanges" ::: Ptr MappedMemoryRange) -> IO Result
type PFN_vkInvalidateMappedMemoryRanges = FunPtr FN_vkInvalidateMappedMemoryRanges
type FN_vkVoidFunction = IO ()
type PFN_vkVoidFunction = FunPtr FN_vkVoidFunction
type FN_vkMapMemory = Ptr Device_T -> DeviceMemory -> ("offset" ::: DeviceSize) -> DeviceSize -> MemoryMapFlags -> ("ppData" ::: Ptr (Ptr ())) -> IO Result
type PFN_vkMapMemory = FunPtr FN_vkMapMemory
type FN_vkUnmapMemory = Ptr Device_T -> DeviceMemory -> IO ()
type PFN_vkUnmapMemory = FunPtr FN_vkUnmapMemory
type FN_vkGetDeviceBufferMemoryRequirements = Ptr Device_T -> ("pInfo" ::: Ptr DeviceBufferMemoryRequirements) -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2)) -> IO ()
type PFN_vkGetDeviceBufferMemoryRequirements = FunPtr FN_vkGetDeviceBufferMemoryRequirements
type FN_vkGetDeviceImageMemoryRequirements = Ptr Device_T -> ("pInfo" ::: Ptr DeviceImageMemoryRequirements) -> ("pMemoryRequirements" ::: Ptr (SomeStruct MemoryRequirements2)) -> IO ()
type PFN_vkGetDeviceImageMemoryRequirements = FunPtr FN_vkGetDeviceImageMemoryRequirements
type AllocatorCreateFlags = AllocatorCreateFlagBits
newtype AllocatorCreateFlagBits = AllocatorCreateFlagBits Flags
deriving newtype (AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> Bool
$c/= :: AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> Bool
== :: AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> Bool
$c== :: AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> Bool
Eq, Eq AllocatorCreateFlagBits
AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> Bool
AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> Ordering
AllocatorCreateFlagBits
-> AllocatorCreateFlagBits -> AllocatorCreateFlagBits
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: AllocatorCreateFlagBits
-> AllocatorCreateFlagBits -> AllocatorCreateFlagBits
$cmin :: AllocatorCreateFlagBits
-> AllocatorCreateFlagBits -> AllocatorCreateFlagBits
max :: AllocatorCreateFlagBits
-> AllocatorCreateFlagBits -> AllocatorCreateFlagBits
$cmax :: AllocatorCreateFlagBits
-> AllocatorCreateFlagBits -> AllocatorCreateFlagBits
>= :: AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> Bool
$c>= :: AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> Bool
> :: AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> Bool
$c> :: AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> Bool
<= :: AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> Bool
$c<= :: AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> Bool
< :: AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> Bool
$c< :: AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> Bool
compare :: AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> Ordering
$ccompare :: AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> Ordering
Ord, Ptr AllocatorCreateFlagBits -> IO AllocatorCreateFlagBits
Ptr AllocatorCreateFlagBits -> Int -> IO AllocatorCreateFlagBits
Ptr AllocatorCreateFlagBits
-> Int -> AllocatorCreateFlagBits -> IO ()
Ptr AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> IO ()
AllocatorCreateFlagBits -> Int
forall b. Ptr b -> Int -> IO AllocatorCreateFlagBits
forall b. Ptr b -> Int -> AllocatorCreateFlagBits -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> IO ()
$cpoke :: Ptr AllocatorCreateFlagBits -> AllocatorCreateFlagBits -> IO ()
peek :: Ptr AllocatorCreateFlagBits -> IO AllocatorCreateFlagBits
$cpeek :: Ptr AllocatorCreateFlagBits -> IO AllocatorCreateFlagBits
pokeByteOff :: forall b. Ptr b -> Int -> AllocatorCreateFlagBits -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> AllocatorCreateFlagBits -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO AllocatorCreateFlagBits
$cpeekByteOff :: forall b. Ptr b -> Int -> IO AllocatorCreateFlagBits
pokeElemOff :: Ptr AllocatorCreateFlagBits
-> Int -> AllocatorCreateFlagBits -> IO ()
$cpokeElemOff :: Ptr AllocatorCreateFlagBits
-> Int -> AllocatorCreateFlagBits -> IO ()
peekElemOff :: Ptr AllocatorCreateFlagBits -> Int -> IO AllocatorCreateFlagBits
$cpeekElemOff :: Ptr AllocatorCreateFlagBits -> Int -> IO AllocatorCreateFlagBits
alignment :: AllocatorCreateFlagBits -> Int
$calignment :: AllocatorCreateFlagBits -> Int
sizeOf :: AllocatorCreateFlagBits -> Int
$csizeOf :: AllocatorCreateFlagBits -> Int
Storable, AllocatorCreateFlagBits
forall a. a -> Zero a
zero :: AllocatorCreateFlagBits
$czero :: AllocatorCreateFlagBits
Zero, Eq AllocatorCreateFlagBits
AllocatorCreateFlagBits
Int -> AllocatorCreateFlagBits
AllocatorCreateFlagBits -> Bool
AllocatorCreateFlagBits -> Int
AllocatorCreateFlagBits -> Maybe Int
AllocatorCreateFlagBits -> AllocatorCreateFlagBits
AllocatorCreateFlagBits -> Int -> Bool
AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
AllocatorCreateFlagBits
-> AllocatorCreateFlagBits -> AllocatorCreateFlagBits
forall a.
Eq a
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: AllocatorCreateFlagBits -> Int
$cpopCount :: AllocatorCreateFlagBits -> Int
rotateR :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
$crotateR :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
rotateL :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
$crotateL :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
unsafeShiftR :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
$cunsafeShiftR :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
shiftR :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
$cshiftR :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
unsafeShiftL :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
$cunsafeShiftL :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
shiftL :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
$cshiftL :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
isSigned :: AllocatorCreateFlagBits -> Bool
$cisSigned :: AllocatorCreateFlagBits -> Bool
bitSize :: AllocatorCreateFlagBits -> Int
$cbitSize :: AllocatorCreateFlagBits -> Int
bitSizeMaybe :: AllocatorCreateFlagBits -> Maybe Int
$cbitSizeMaybe :: AllocatorCreateFlagBits -> Maybe Int
testBit :: AllocatorCreateFlagBits -> Int -> Bool
$ctestBit :: AllocatorCreateFlagBits -> Int -> Bool
complementBit :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
$ccomplementBit :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
clearBit :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
$cclearBit :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
setBit :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
$csetBit :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
bit :: Int -> AllocatorCreateFlagBits
$cbit :: Int -> AllocatorCreateFlagBits
zeroBits :: AllocatorCreateFlagBits
$czeroBits :: AllocatorCreateFlagBits
rotate :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
$crotate :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
shift :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
$cshift :: AllocatorCreateFlagBits -> Int -> AllocatorCreateFlagBits
complement :: AllocatorCreateFlagBits -> AllocatorCreateFlagBits
$ccomplement :: AllocatorCreateFlagBits -> AllocatorCreateFlagBits
xor :: AllocatorCreateFlagBits
-> AllocatorCreateFlagBits -> AllocatorCreateFlagBits
$cxor :: AllocatorCreateFlagBits
-> AllocatorCreateFlagBits -> AllocatorCreateFlagBits
.|. :: AllocatorCreateFlagBits
-> AllocatorCreateFlagBits -> AllocatorCreateFlagBits
$c.|. :: AllocatorCreateFlagBits
-> AllocatorCreateFlagBits -> AllocatorCreateFlagBits
.&. :: AllocatorCreateFlagBits
-> AllocatorCreateFlagBits -> AllocatorCreateFlagBits
$c.&. :: AllocatorCreateFlagBits
-> AllocatorCreateFlagBits -> AllocatorCreateFlagBits
Bits, Bits AllocatorCreateFlagBits
AllocatorCreateFlagBits -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: AllocatorCreateFlagBits -> Int
$ccountTrailingZeros :: AllocatorCreateFlagBits -> Int
countLeadingZeros :: AllocatorCreateFlagBits -> Int
$ccountLeadingZeros :: AllocatorCreateFlagBits -> Int
finiteBitSize :: AllocatorCreateFlagBits -> Int
$cfiniteBitSize :: AllocatorCreateFlagBits -> Int
FiniteBits)
pattern $bALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT :: AllocatorCreateFlagBits
$mALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT :: forall {r}.
AllocatorCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT = AllocatorCreateFlagBits 0x00000001
pattern $bALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT :: AllocatorCreateFlagBits
$mALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT :: forall {r}.
AllocatorCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT = AllocatorCreateFlagBits 0x00000002
pattern $bALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT :: AllocatorCreateFlagBits
$mALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT :: forall {r}.
AllocatorCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT = AllocatorCreateFlagBits 0x00000004
pattern $bALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT :: AllocatorCreateFlagBits
$mALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT :: forall {r}.
AllocatorCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT = AllocatorCreateFlagBits 0x00000008
pattern $bALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT :: AllocatorCreateFlagBits
$mALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT :: forall {r}.
AllocatorCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT = AllocatorCreateFlagBits 0x00000010
pattern $bALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT :: AllocatorCreateFlagBits
$mALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT :: forall {r}.
AllocatorCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT = AllocatorCreateFlagBits 0x00000020
pattern $bALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT :: AllocatorCreateFlagBits
$mALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT :: forall {r}.
AllocatorCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT = AllocatorCreateFlagBits 0x00000040
conNameAllocatorCreateFlagBits :: String
conNameAllocatorCreateFlagBits :: String
conNameAllocatorCreateFlagBits = String
"AllocatorCreateFlagBits"
enumPrefixAllocatorCreateFlagBits :: String
enumPrefixAllocatorCreateFlagBits :: String
enumPrefixAllocatorCreateFlagBits = String
"ALLOCATOR_CREATE_"
showTableAllocatorCreateFlagBits :: [(AllocatorCreateFlagBits, String)]
showTableAllocatorCreateFlagBits :: [(AllocatorCreateFlagBits, String)]
showTableAllocatorCreateFlagBits =
[
( AllocatorCreateFlagBits
ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT
, String
"EXTERNALLY_SYNCHRONIZED_BIT"
)
,
( AllocatorCreateFlagBits
ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT
, String
"KHR_DEDICATED_ALLOCATION_BIT"
)
,
( AllocatorCreateFlagBits
ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT
, String
"KHR_BIND_MEMORY2_BIT"
)
,
( AllocatorCreateFlagBits
ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT
, String
"EXT_MEMORY_BUDGET_BIT"
)
,
( AllocatorCreateFlagBits
ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT
, String
"AMD_DEVICE_COHERENT_MEMORY_BIT"
)
,
( AllocatorCreateFlagBits
ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT
, String
"BUFFER_DEVICE_ADDRESS_BIT"
)
,
( AllocatorCreateFlagBits
ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT
, String
"EXT_MEMORY_PRIORITY_BIT"
)
]
instance Show AllocatorCreateFlagBits where
showsPrec :: Int -> AllocatorCreateFlagBits -> ShowS
showsPrec =
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixAllocatorCreateFlagBits
[(AllocatorCreateFlagBits, String)]
showTableAllocatorCreateFlagBits
String
conNameAllocatorCreateFlagBits
(\(AllocatorCreateFlagBits Flags
x) -> Flags
x)
(\Flags
x -> String -> ShowS
showString String
"0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex Flags
x)
instance Read AllocatorCreateFlagBits where
readPrec :: ReadPrec AllocatorCreateFlagBits
readPrec =
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixAllocatorCreateFlagBits
[(AllocatorCreateFlagBits, String)]
showTableAllocatorCreateFlagBits
String
conNameAllocatorCreateFlagBits
Flags -> AllocatorCreateFlagBits
AllocatorCreateFlagBits
newtype MemoryUsage = MemoryUsage Int32
deriving newtype (MemoryUsage -> MemoryUsage -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MemoryUsage -> MemoryUsage -> Bool
$c/= :: MemoryUsage -> MemoryUsage -> Bool
== :: MemoryUsage -> MemoryUsage -> Bool
$c== :: MemoryUsage -> MemoryUsage -> Bool
Eq, Eq MemoryUsage
MemoryUsage -> MemoryUsage -> Bool
MemoryUsage -> MemoryUsage -> Ordering
MemoryUsage -> MemoryUsage -> MemoryUsage
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: MemoryUsage -> MemoryUsage -> MemoryUsage
$cmin :: MemoryUsage -> MemoryUsage -> MemoryUsage
max :: MemoryUsage -> MemoryUsage -> MemoryUsage
$cmax :: MemoryUsage -> MemoryUsage -> MemoryUsage
>= :: MemoryUsage -> MemoryUsage -> Bool
$c>= :: MemoryUsage -> MemoryUsage -> Bool
> :: MemoryUsage -> MemoryUsage -> Bool
$c> :: MemoryUsage -> MemoryUsage -> Bool
<= :: MemoryUsage -> MemoryUsage -> Bool
$c<= :: MemoryUsage -> MemoryUsage -> Bool
< :: MemoryUsage -> MemoryUsage -> Bool
$c< :: MemoryUsage -> MemoryUsage -> Bool
compare :: MemoryUsage -> MemoryUsage -> Ordering
$ccompare :: MemoryUsage -> MemoryUsage -> Ordering
Ord, Ptr MemoryUsage -> IO MemoryUsage
Ptr MemoryUsage -> Int -> IO MemoryUsage
Ptr MemoryUsage -> Int -> MemoryUsage -> IO ()
Ptr MemoryUsage -> MemoryUsage -> IO ()
MemoryUsage -> Int
forall b. Ptr b -> Int -> IO MemoryUsage
forall b. Ptr b -> Int -> MemoryUsage -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr MemoryUsage -> MemoryUsage -> IO ()
$cpoke :: Ptr MemoryUsage -> MemoryUsage -> IO ()
peek :: Ptr MemoryUsage -> IO MemoryUsage
$cpeek :: Ptr MemoryUsage -> IO MemoryUsage
pokeByteOff :: forall b. Ptr b -> Int -> MemoryUsage -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> MemoryUsage -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO MemoryUsage
$cpeekByteOff :: forall b. Ptr b -> Int -> IO MemoryUsage
pokeElemOff :: Ptr MemoryUsage -> Int -> MemoryUsage -> IO ()
$cpokeElemOff :: Ptr MemoryUsage -> Int -> MemoryUsage -> IO ()
peekElemOff :: Ptr MemoryUsage -> Int -> IO MemoryUsage
$cpeekElemOff :: Ptr MemoryUsage -> Int -> IO MemoryUsage
alignment :: MemoryUsage -> Int
$calignment :: MemoryUsage -> Int
sizeOf :: MemoryUsage -> Int
$csizeOf :: MemoryUsage -> Int
Storable, MemoryUsage
forall a. a -> Zero a
zero :: MemoryUsage
$czero :: MemoryUsage
Zero)
pattern $bMEMORY_USAGE_UNKNOWN :: MemoryUsage
$mMEMORY_USAGE_UNKNOWN :: forall {r}. MemoryUsage -> ((# #) -> r) -> ((# #) -> r) -> r
MEMORY_USAGE_UNKNOWN = MemoryUsage 0
pattern $bMEMORY_USAGE_GPU_ONLY :: MemoryUsage
$mMEMORY_USAGE_GPU_ONLY :: forall {r}. MemoryUsage -> ((# #) -> r) -> ((# #) -> r) -> r
MEMORY_USAGE_GPU_ONLY = MemoryUsage 1
pattern $bMEMORY_USAGE_CPU_ONLY :: MemoryUsage
$mMEMORY_USAGE_CPU_ONLY :: forall {r}. MemoryUsage -> ((# #) -> r) -> ((# #) -> r) -> r
MEMORY_USAGE_CPU_ONLY = MemoryUsage 2
pattern $bMEMORY_USAGE_CPU_TO_GPU :: MemoryUsage
$mMEMORY_USAGE_CPU_TO_GPU :: forall {r}. MemoryUsage -> ((# #) -> r) -> ((# #) -> r) -> r
MEMORY_USAGE_CPU_TO_GPU = MemoryUsage 3
pattern $bMEMORY_USAGE_GPU_TO_CPU :: MemoryUsage
$mMEMORY_USAGE_GPU_TO_CPU :: forall {r}. MemoryUsage -> ((# #) -> r) -> ((# #) -> r) -> r
MEMORY_USAGE_GPU_TO_CPU = MemoryUsage 4
pattern $bMEMORY_USAGE_CPU_COPY :: MemoryUsage
$mMEMORY_USAGE_CPU_COPY :: forall {r}. MemoryUsage -> ((# #) -> r) -> ((# #) -> r) -> r
MEMORY_USAGE_CPU_COPY = MemoryUsage 5
pattern $bMEMORY_USAGE_GPU_LAZILY_ALLOCATED :: MemoryUsage
$mMEMORY_USAGE_GPU_LAZILY_ALLOCATED :: forall {r}. MemoryUsage -> ((# #) -> r) -> ((# #) -> r) -> r
MEMORY_USAGE_GPU_LAZILY_ALLOCATED = MemoryUsage 6
pattern $bMEMORY_USAGE_AUTO :: MemoryUsage
$mMEMORY_USAGE_AUTO :: forall {r}. MemoryUsage -> ((# #) -> r) -> ((# #) -> r) -> r
MEMORY_USAGE_AUTO = MemoryUsage 7
pattern $bMEMORY_USAGE_AUTO_PREFER_DEVICE :: MemoryUsage
$mMEMORY_USAGE_AUTO_PREFER_DEVICE :: forall {r}. MemoryUsage -> ((# #) -> r) -> ((# #) -> r) -> r
MEMORY_USAGE_AUTO_PREFER_DEVICE = MemoryUsage 8
pattern $bMEMORY_USAGE_AUTO_PREFER_HOST :: MemoryUsage
$mMEMORY_USAGE_AUTO_PREFER_HOST :: forall {r}. MemoryUsage -> ((# #) -> r) -> ((# #) -> r) -> r
MEMORY_USAGE_AUTO_PREFER_HOST = MemoryUsage 9
{-# COMPLETE
MEMORY_USAGE_UNKNOWN
, MEMORY_USAGE_GPU_ONLY
, MEMORY_USAGE_CPU_ONLY
, MEMORY_USAGE_CPU_TO_GPU
, MEMORY_USAGE_GPU_TO_CPU
, MEMORY_USAGE_CPU_COPY
, MEMORY_USAGE_GPU_LAZILY_ALLOCATED
, MEMORY_USAGE_AUTO
, MEMORY_USAGE_AUTO_PREFER_DEVICE
, MEMORY_USAGE_AUTO_PREFER_HOST ::
MemoryUsage
#-}
conNameMemoryUsage :: String
conNameMemoryUsage :: String
conNameMemoryUsage = String
"MemoryUsage"
enumPrefixMemoryUsage :: String
enumPrefixMemoryUsage :: String
enumPrefixMemoryUsage = String
"MEMORY_USAGE_"
showTableMemoryUsage :: [(MemoryUsage, String)]
showTableMemoryUsage :: [(MemoryUsage, String)]
showTableMemoryUsage =
[ (MemoryUsage
MEMORY_USAGE_UNKNOWN, String
"UNKNOWN")
, (MemoryUsage
MEMORY_USAGE_GPU_ONLY, String
"GPU_ONLY")
, (MemoryUsage
MEMORY_USAGE_CPU_ONLY, String
"CPU_ONLY")
, (MemoryUsage
MEMORY_USAGE_CPU_TO_GPU, String
"CPU_TO_GPU")
, (MemoryUsage
MEMORY_USAGE_GPU_TO_CPU, String
"GPU_TO_CPU")
, (MemoryUsage
MEMORY_USAGE_CPU_COPY, String
"CPU_COPY")
,
( MemoryUsage
MEMORY_USAGE_GPU_LAZILY_ALLOCATED
, String
"GPU_LAZILY_ALLOCATED"
)
, (MemoryUsage
MEMORY_USAGE_AUTO, String
"AUTO")
, (MemoryUsage
MEMORY_USAGE_AUTO_PREFER_DEVICE, String
"AUTO_PREFER_DEVICE")
, (MemoryUsage
MEMORY_USAGE_AUTO_PREFER_HOST, String
"AUTO_PREFER_HOST")
]
instance Show MemoryUsage where
showsPrec :: Int -> MemoryUsage -> ShowS
showsPrec =
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixMemoryUsage
[(MemoryUsage, String)]
showTableMemoryUsage
String
conNameMemoryUsage
(\(MemoryUsage Int32
x) -> Int32
x)
(forall a. Show a => Int -> a -> ShowS
showsPrec Int
11)
instance Read MemoryUsage where
readPrec :: ReadPrec MemoryUsage
readPrec =
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixMemoryUsage
[(MemoryUsage, String)]
showTableMemoryUsage
String
conNameMemoryUsage
Int32 -> MemoryUsage
MemoryUsage
type AllocationCreateFlags = AllocationCreateFlagBits
newtype AllocationCreateFlagBits = AllocationCreateFlagBits Flags
deriving newtype (AllocationCreateFlagBits -> AllocationCreateFlagBits -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AllocationCreateFlagBits -> AllocationCreateFlagBits -> Bool
$c/= :: AllocationCreateFlagBits -> AllocationCreateFlagBits -> Bool
== :: AllocationCreateFlagBits -> AllocationCreateFlagBits -> Bool
$c== :: AllocationCreateFlagBits -> AllocationCreateFlagBits -> Bool
Eq, Eq AllocationCreateFlagBits
AllocationCreateFlagBits -> AllocationCreateFlagBits -> Bool
AllocationCreateFlagBits -> AllocationCreateFlagBits -> Ordering
AllocationCreateFlagBits
-> AllocationCreateFlagBits -> AllocationCreateFlagBits
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: AllocationCreateFlagBits
-> AllocationCreateFlagBits -> AllocationCreateFlagBits
$cmin :: AllocationCreateFlagBits
-> AllocationCreateFlagBits -> AllocationCreateFlagBits
max :: AllocationCreateFlagBits
-> AllocationCreateFlagBits -> AllocationCreateFlagBits
$cmax :: AllocationCreateFlagBits
-> AllocationCreateFlagBits -> AllocationCreateFlagBits
>= :: AllocationCreateFlagBits -> AllocationCreateFlagBits -> Bool
$c>= :: AllocationCreateFlagBits -> AllocationCreateFlagBits -> Bool
> :: AllocationCreateFlagBits -> AllocationCreateFlagBits -> Bool
$c> :: AllocationCreateFlagBits -> AllocationCreateFlagBits -> Bool
<= :: AllocationCreateFlagBits -> AllocationCreateFlagBits -> Bool
$c<= :: AllocationCreateFlagBits -> AllocationCreateFlagBits -> Bool
< :: AllocationCreateFlagBits -> AllocationCreateFlagBits -> Bool
$c< :: AllocationCreateFlagBits -> AllocationCreateFlagBits -> Bool
compare :: AllocationCreateFlagBits -> AllocationCreateFlagBits -> Ordering
$ccompare :: AllocationCreateFlagBits -> AllocationCreateFlagBits -> Ordering
Ord, Ptr AllocationCreateFlagBits -> IO AllocationCreateFlagBits
Ptr AllocationCreateFlagBits -> Int -> IO AllocationCreateFlagBits
Ptr AllocationCreateFlagBits
-> Int -> AllocationCreateFlagBits -> IO ()
Ptr AllocationCreateFlagBits -> AllocationCreateFlagBits -> IO ()
AllocationCreateFlagBits -> Int
forall b. Ptr b -> Int -> IO AllocationCreateFlagBits
forall b. Ptr b -> Int -> AllocationCreateFlagBits -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr AllocationCreateFlagBits -> AllocationCreateFlagBits -> IO ()
$cpoke :: Ptr AllocationCreateFlagBits -> AllocationCreateFlagBits -> IO ()
peek :: Ptr AllocationCreateFlagBits -> IO AllocationCreateFlagBits
$cpeek :: Ptr AllocationCreateFlagBits -> IO AllocationCreateFlagBits
pokeByteOff :: forall b. Ptr b -> Int -> AllocationCreateFlagBits -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> AllocationCreateFlagBits -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO AllocationCreateFlagBits
$cpeekByteOff :: forall b. Ptr b -> Int -> IO AllocationCreateFlagBits
pokeElemOff :: Ptr AllocationCreateFlagBits
-> Int -> AllocationCreateFlagBits -> IO ()
$cpokeElemOff :: Ptr AllocationCreateFlagBits
-> Int -> AllocationCreateFlagBits -> IO ()
peekElemOff :: Ptr AllocationCreateFlagBits -> Int -> IO AllocationCreateFlagBits
$cpeekElemOff :: Ptr AllocationCreateFlagBits -> Int -> IO AllocationCreateFlagBits
alignment :: AllocationCreateFlagBits -> Int
$calignment :: AllocationCreateFlagBits -> Int
sizeOf :: AllocationCreateFlagBits -> Int
$csizeOf :: AllocationCreateFlagBits -> Int
Storable, AllocationCreateFlagBits
forall a. a -> Zero a
zero :: AllocationCreateFlagBits
$czero :: AllocationCreateFlagBits
Zero, Eq AllocationCreateFlagBits
AllocationCreateFlagBits
Int -> AllocationCreateFlagBits
AllocationCreateFlagBits -> Bool
AllocationCreateFlagBits -> Int
AllocationCreateFlagBits -> Maybe Int
AllocationCreateFlagBits -> AllocationCreateFlagBits
AllocationCreateFlagBits -> Int -> Bool
AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
AllocationCreateFlagBits
-> AllocationCreateFlagBits -> AllocationCreateFlagBits
forall a.
Eq a
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: AllocationCreateFlagBits -> Int
$cpopCount :: AllocationCreateFlagBits -> Int
rotateR :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
$crotateR :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
rotateL :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
$crotateL :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
unsafeShiftR :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
$cunsafeShiftR :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
shiftR :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
$cshiftR :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
unsafeShiftL :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
$cunsafeShiftL :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
shiftL :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
$cshiftL :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
isSigned :: AllocationCreateFlagBits -> Bool
$cisSigned :: AllocationCreateFlagBits -> Bool
bitSize :: AllocationCreateFlagBits -> Int
$cbitSize :: AllocationCreateFlagBits -> Int
bitSizeMaybe :: AllocationCreateFlagBits -> Maybe Int
$cbitSizeMaybe :: AllocationCreateFlagBits -> Maybe Int
testBit :: AllocationCreateFlagBits -> Int -> Bool
$ctestBit :: AllocationCreateFlagBits -> Int -> Bool
complementBit :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
$ccomplementBit :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
clearBit :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
$cclearBit :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
setBit :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
$csetBit :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
bit :: Int -> AllocationCreateFlagBits
$cbit :: Int -> AllocationCreateFlagBits
zeroBits :: AllocationCreateFlagBits
$czeroBits :: AllocationCreateFlagBits
rotate :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
$crotate :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
shift :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
$cshift :: AllocationCreateFlagBits -> Int -> AllocationCreateFlagBits
complement :: AllocationCreateFlagBits -> AllocationCreateFlagBits
$ccomplement :: AllocationCreateFlagBits -> AllocationCreateFlagBits
xor :: AllocationCreateFlagBits
-> AllocationCreateFlagBits -> AllocationCreateFlagBits
$cxor :: AllocationCreateFlagBits
-> AllocationCreateFlagBits -> AllocationCreateFlagBits
.|. :: AllocationCreateFlagBits
-> AllocationCreateFlagBits -> AllocationCreateFlagBits
$c.|. :: AllocationCreateFlagBits
-> AllocationCreateFlagBits -> AllocationCreateFlagBits
.&. :: AllocationCreateFlagBits
-> AllocationCreateFlagBits -> AllocationCreateFlagBits
$c.&. :: AllocationCreateFlagBits
-> AllocationCreateFlagBits -> AllocationCreateFlagBits
Bits, Bits AllocationCreateFlagBits
AllocationCreateFlagBits -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: AllocationCreateFlagBits -> Int
$ccountTrailingZeros :: AllocationCreateFlagBits -> Int
countLeadingZeros :: AllocationCreateFlagBits -> Int
$ccountLeadingZeros :: AllocationCreateFlagBits -> Int
finiteBitSize :: AllocationCreateFlagBits -> Int
$cfiniteBitSize :: AllocationCreateFlagBits -> Int
FiniteBits)
pattern $bALLOCATION_CREATE_DEDICATED_MEMORY_BIT :: AllocationCreateFlagBits
$mALLOCATION_CREATE_DEDICATED_MEMORY_BIT :: forall {r}.
AllocationCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATION_CREATE_DEDICATED_MEMORY_BIT = AllocationCreateFlagBits 0x00000001
pattern $bALLOCATION_CREATE_NEVER_ALLOCATE_BIT :: AllocationCreateFlagBits
$mALLOCATION_CREATE_NEVER_ALLOCATE_BIT :: forall {r}.
AllocationCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATION_CREATE_NEVER_ALLOCATE_BIT = AllocationCreateFlagBits 0x00000002
pattern $bALLOCATION_CREATE_MAPPED_BIT :: AllocationCreateFlagBits
$mALLOCATION_CREATE_MAPPED_BIT :: forall {r}.
AllocationCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATION_CREATE_MAPPED_BIT = AllocationCreateFlagBits 0x00000004
pattern $bALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT :: AllocationCreateFlagBits
$mALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT :: forall {r}.
AllocationCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT = AllocationCreateFlagBits 0x00000020
pattern $bALLOCATION_CREATE_UPPER_ADDRESS_BIT :: AllocationCreateFlagBits
$mALLOCATION_CREATE_UPPER_ADDRESS_BIT :: forall {r}.
AllocationCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATION_CREATE_UPPER_ADDRESS_BIT = AllocationCreateFlagBits 0x00000040
pattern $bALLOCATION_CREATE_DONT_BIND_BIT :: AllocationCreateFlagBits
$mALLOCATION_CREATE_DONT_BIND_BIT :: forall {r}.
AllocationCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATION_CREATE_DONT_BIND_BIT = AllocationCreateFlagBits 0x00000080
pattern $bALLOCATION_CREATE_WITHIN_BUDGET_BIT :: AllocationCreateFlagBits
$mALLOCATION_CREATE_WITHIN_BUDGET_BIT :: forall {r}.
AllocationCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATION_CREATE_WITHIN_BUDGET_BIT = AllocationCreateFlagBits 0x00000100
pattern $bALLOCATION_CREATE_CAN_ALIAS_BIT :: AllocationCreateFlagBits
$mALLOCATION_CREATE_CAN_ALIAS_BIT :: forall {r}.
AllocationCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATION_CREATE_CAN_ALIAS_BIT = AllocationCreateFlagBits 0x00000200
pattern $bALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT :: AllocationCreateFlagBits
$mALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT :: forall {r}.
AllocationCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT = AllocationCreateFlagBits 0x00000400
pattern $bALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT :: AllocationCreateFlagBits
$mALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT :: forall {r}.
AllocationCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT = AllocationCreateFlagBits 0x00000800
pattern $bALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT :: AllocationCreateFlagBits
$mALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT :: forall {r}.
AllocationCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT = AllocationCreateFlagBits 0x00001000
pattern $bALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT :: AllocationCreateFlagBits
$mALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT :: forall {r}.
AllocationCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT = AllocationCreateFlagBits 0x00010000
pattern $bALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT :: AllocationCreateFlagBits
$mALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT :: forall {r}.
AllocationCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT = AllocationCreateFlagBits 0x00020000
pattern $bALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT :: AllocationCreateFlagBits
$mALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT :: forall {r}.
AllocationCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT = AllocationCreateFlagBits 0x00040000
pattern $bALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT :: AllocationCreateFlagBits
$mALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT :: forall {r}.
AllocationCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT = AllocationCreateFlagBits 0x00010000
pattern $bALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT :: AllocationCreateFlagBits
$mALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT :: forall {r}.
AllocationCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT = AllocationCreateFlagBits 0x00020000
pattern $bALLOCATION_CREATE_STRATEGY_MASK :: AllocationCreateFlagBits
$mALLOCATION_CREATE_STRATEGY_MASK :: forall {r}.
AllocationCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
ALLOCATION_CREATE_STRATEGY_MASK = AllocationCreateFlagBits 0x00070000
conNameAllocationCreateFlagBits :: String
conNameAllocationCreateFlagBits :: String
conNameAllocationCreateFlagBits = String
"AllocationCreateFlagBits"
enumPrefixAllocationCreateFlagBits :: String
enumPrefixAllocationCreateFlagBits :: String
enumPrefixAllocationCreateFlagBits = String
"ALLOCATION_CREATE_"
showTableAllocationCreateFlagBits :: [(AllocationCreateFlagBits, String)]
showTableAllocationCreateFlagBits :: [(AllocationCreateFlagBits, String)]
showTableAllocationCreateFlagBits =
[
( AllocationCreateFlagBits
ALLOCATION_CREATE_DEDICATED_MEMORY_BIT
, String
"DEDICATED_MEMORY_BIT"
)
,
( AllocationCreateFlagBits
ALLOCATION_CREATE_NEVER_ALLOCATE_BIT
, String
"NEVER_ALLOCATE_BIT"
)
,
( AllocationCreateFlagBits
ALLOCATION_CREATE_MAPPED_BIT
, String
"MAPPED_BIT"
)
,
( AllocationCreateFlagBits
ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT
, String
"USER_DATA_COPY_STRING_BIT"
)
,
( AllocationCreateFlagBits
ALLOCATION_CREATE_UPPER_ADDRESS_BIT
, String
"UPPER_ADDRESS_BIT"
)
,
( AllocationCreateFlagBits
ALLOCATION_CREATE_DONT_BIND_BIT
, String
"DONT_BIND_BIT"
)
,
( AllocationCreateFlagBits
ALLOCATION_CREATE_WITHIN_BUDGET_BIT
, String
"WITHIN_BUDGET_BIT"
)
,
( AllocationCreateFlagBits
ALLOCATION_CREATE_CAN_ALIAS_BIT
, String
"CAN_ALIAS_BIT"
)
,
( AllocationCreateFlagBits
ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT
, String
"HOST_ACCESS_SEQUENTIAL_WRITE_BIT"
)
,
( AllocationCreateFlagBits
ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT
, String
"HOST_ACCESS_RANDOM_BIT"
)
,
( AllocationCreateFlagBits
ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT
, String
"HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT"
)
,
( AllocationCreateFlagBits
ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT
, String
"STRATEGY_MIN_MEMORY_BIT"
)
,
( AllocationCreateFlagBits
ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT
, String
"STRATEGY_MIN_TIME_BIT"
)
,
( AllocationCreateFlagBits
ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT
, String
"STRATEGY_MIN_OFFSET_BIT"
)
,
( AllocationCreateFlagBits
ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT
, String
"STRATEGY_BEST_FIT_BIT"
)
,
( AllocationCreateFlagBits
ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT
, String
"STRATEGY_FIRST_FIT_BIT"
)
,
( AllocationCreateFlagBits
ALLOCATION_CREATE_STRATEGY_MASK
, String
"STRATEGY_MASK"
)
]
instance Show AllocationCreateFlagBits where
showsPrec :: Int -> AllocationCreateFlagBits -> ShowS
showsPrec =
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixAllocationCreateFlagBits
[(AllocationCreateFlagBits, String)]
showTableAllocationCreateFlagBits
String
conNameAllocationCreateFlagBits
(\(AllocationCreateFlagBits Flags
x) -> Flags
x)
(\Flags
x -> String -> ShowS
showString String
"0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex Flags
x)
instance Read AllocationCreateFlagBits where
readPrec :: ReadPrec AllocationCreateFlagBits
readPrec =
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixAllocationCreateFlagBits
[(AllocationCreateFlagBits, String)]
showTableAllocationCreateFlagBits
String
conNameAllocationCreateFlagBits
Flags -> AllocationCreateFlagBits
AllocationCreateFlagBits
type PoolCreateFlags = PoolCreateFlagBits
newtype PoolCreateFlagBits = PoolCreateFlagBits Flags
deriving newtype (PoolCreateFlagBits -> PoolCreateFlagBits -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PoolCreateFlagBits -> PoolCreateFlagBits -> Bool
$c/= :: PoolCreateFlagBits -> PoolCreateFlagBits -> Bool
== :: PoolCreateFlagBits -> PoolCreateFlagBits -> Bool
$c== :: PoolCreateFlagBits -> PoolCreateFlagBits -> Bool
Eq, Eq PoolCreateFlagBits
PoolCreateFlagBits -> PoolCreateFlagBits -> Bool
PoolCreateFlagBits -> PoolCreateFlagBits -> Ordering
PoolCreateFlagBits -> PoolCreateFlagBits -> PoolCreateFlagBits
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: PoolCreateFlagBits -> PoolCreateFlagBits -> PoolCreateFlagBits
$cmin :: PoolCreateFlagBits -> PoolCreateFlagBits -> PoolCreateFlagBits
max :: PoolCreateFlagBits -> PoolCreateFlagBits -> PoolCreateFlagBits
$cmax :: PoolCreateFlagBits -> PoolCreateFlagBits -> PoolCreateFlagBits
>= :: PoolCreateFlagBits -> PoolCreateFlagBits -> Bool
$c>= :: PoolCreateFlagBits -> PoolCreateFlagBits -> Bool
> :: PoolCreateFlagBits -> PoolCreateFlagBits -> Bool
$c> :: PoolCreateFlagBits -> PoolCreateFlagBits -> Bool
<= :: PoolCreateFlagBits -> PoolCreateFlagBits -> Bool
$c<= :: PoolCreateFlagBits -> PoolCreateFlagBits -> Bool
< :: PoolCreateFlagBits -> PoolCreateFlagBits -> Bool
$c< :: PoolCreateFlagBits -> PoolCreateFlagBits -> Bool
compare :: PoolCreateFlagBits -> PoolCreateFlagBits -> Ordering
$ccompare :: PoolCreateFlagBits -> PoolCreateFlagBits -> Ordering
Ord, Ptr PoolCreateFlagBits -> IO PoolCreateFlagBits
Ptr PoolCreateFlagBits -> Int -> IO PoolCreateFlagBits
Ptr PoolCreateFlagBits -> Int -> PoolCreateFlagBits -> IO ()
Ptr PoolCreateFlagBits -> PoolCreateFlagBits -> IO ()
PoolCreateFlagBits -> Int
forall b. Ptr b -> Int -> IO PoolCreateFlagBits
forall b. Ptr b -> Int -> PoolCreateFlagBits -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr PoolCreateFlagBits -> PoolCreateFlagBits -> IO ()
$cpoke :: Ptr PoolCreateFlagBits -> PoolCreateFlagBits -> IO ()
peek :: Ptr PoolCreateFlagBits -> IO PoolCreateFlagBits
$cpeek :: Ptr PoolCreateFlagBits -> IO PoolCreateFlagBits
pokeByteOff :: forall b. Ptr b -> Int -> PoolCreateFlagBits -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> PoolCreateFlagBits -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO PoolCreateFlagBits
$cpeekByteOff :: forall b. Ptr b -> Int -> IO PoolCreateFlagBits
pokeElemOff :: Ptr PoolCreateFlagBits -> Int -> PoolCreateFlagBits -> IO ()
$cpokeElemOff :: Ptr PoolCreateFlagBits -> Int -> PoolCreateFlagBits -> IO ()
peekElemOff :: Ptr PoolCreateFlagBits -> Int -> IO PoolCreateFlagBits
$cpeekElemOff :: Ptr PoolCreateFlagBits -> Int -> IO PoolCreateFlagBits
alignment :: PoolCreateFlagBits -> Int
$calignment :: PoolCreateFlagBits -> Int
sizeOf :: PoolCreateFlagBits -> Int
$csizeOf :: PoolCreateFlagBits -> Int
Storable, PoolCreateFlagBits
forall a. a -> Zero a
zero :: PoolCreateFlagBits
$czero :: PoolCreateFlagBits
Zero, Eq PoolCreateFlagBits
PoolCreateFlagBits
Int -> PoolCreateFlagBits
PoolCreateFlagBits -> Bool
PoolCreateFlagBits -> Int
PoolCreateFlagBits -> Maybe Int
PoolCreateFlagBits -> PoolCreateFlagBits
PoolCreateFlagBits -> Int -> Bool
PoolCreateFlagBits -> Int -> PoolCreateFlagBits
PoolCreateFlagBits -> PoolCreateFlagBits -> PoolCreateFlagBits
forall a.
Eq a
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: PoolCreateFlagBits -> Int
$cpopCount :: PoolCreateFlagBits -> Int
rotateR :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
$crotateR :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
rotateL :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
$crotateL :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
unsafeShiftR :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
$cunsafeShiftR :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
shiftR :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
$cshiftR :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
unsafeShiftL :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
$cunsafeShiftL :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
shiftL :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
$cshiftL :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
isSigned :: PoolCreateFlagBits -> Bool
$cisSigned :: PoolCreateFlagBits -> Bool
bitSize :: PoolCreateFlagBits -> Int
$cbitSize :: PoolCreateFlagBits -> Int
bitSizeMaybe :: PoolCreateFlagBits -> Maybe Int
$cbitSizeMaybe :: PoolCreateFlagBits -> Maybe Int
testBit :: PoolCreateFlagBits -> Int -> Bool
$ctestBit :: PoolCreateFlagBits -> Int -> Bool
complementBit :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
$ccomplementBit :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
clearBit :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
$cclearBit :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
setBit :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
$csetBit :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
bit :: Int -> PoolCreateFlagBits
$cbit :: Int -> PoolCreateFlagBits
zeroBits :: PoolCreateFlagBits
$czeroBits :: PoolCreateFlagBits
rotate :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
$crotate :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
shift :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
$cshift :: PoolCreateFlagBits -> Int -> PoolCreateFlagBits
complement :: PoolCreateFlagBits -> PoolCreateFlagBits
$ccomplement :: PoolCreateFlagBits -> PoolCreateFlagBits
xor :: PoolCreateFlagBits -> PoolCreateFlagBits -> PoolCreateFlagBits
$cxor :: PoolCreateFlagBits -> PoolCreateFlagBits -> PoolCreateFlagBits
.|. :: PoolCreateFlagBits -> PoolCreateFlagBits -> PoolCreateFlagBits
$c.|. :: PoolCreateFlagBits -> PoolCreateFlagBits -> PoolCreateFlagBits
.&. :: PoolCreateFlagBits -> PoolCreateFlagBits -> PoolCreateFlagBits
$c.&. :: PoolCreateFlagBits -> PoolCreateFlagBits -> PoolCreateFlagBits
Bits, Bits PoolCreateFlagBits
PoolCreateFlagBits -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: PoolCreateFlagBits -> Int
$ccountTrailingZeros :: PoolCreateFlagBits -> Int
countLeadingZeros :: PoolCreateFlagBits -> Int
$ccountLeadingZeros :: PoolCreateFlagBits -> Int
finiteBitSize :: PoolCreateFlagBits -> Int
$cfiniteBitSize :: PoolCreateFlagBits -> Int
FiniteBits)
pattern $bPOOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT :: PoolCreateFlagBits
$mPOOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT :: forall {r}. PoolCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT = PoolCreateFlagBits 0x00000002
pattern $bPOOL_CREATE_LINEAR_ALGORITHM_BIT :: PoolCreateFlagBits
$mPOOL_CREATE_LINEAR_ALGORITHM_BIT :: forall {r}. PoolCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
POOL_CREATE_LINEAR_ALGORITHM_BIT = PoolCreateFlagBits 0x00000004
pattern $bPOOL_CREATE_ALGORITHM_MASK :: PoolCreateFlagBits
$mPOOL_CREATE_ALGORITHM_MASK :: forall {r}. PoolCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
POOL_CREATE_ALGORITHM_MASK = PoolCreateFlagBits 0x00000004
conNamePoolCreateFlagBits :: String
conNamePoolCreateFlagBits :: String
conNamePoolCreateFlagBits = String
"PoolCreateFlagBits"
enumPrefixPoolCreateFlagBits :: String
enumPrefixPoolCreateFlagBits :: String
enumPrefixPoolCreateFlagBits = String
"POOL_CREATE_"
showTablePoolCreateFlagBits :: [(PoolCreateFlagBits, String)]
showTablePoolCreateFlagBits :: [(PoolCreateFlagBits, String)]
showTablePoolCreateFlagBits =
[
( PoolCreateFlagBits
POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT
, String
"IGNORE_BUFFER_IMAGE_GRANULARITY_BIT"
)
,
( PoolCreateFlagBits
POOL_CREATE_LINEAR_ALGORITHM_BIT
, String
"LINEAR_ALGORITHM_BIT"
)
, (PoolCreateFlagBits
POOL_CREATE_ALGORITHM_MASK, String
"ALGORITHM_MASK")
]
instance Show PoolCreateFlagBits where
showsPrec :: Int -> PoolCreateFlagBits -> ShowS
showsPrec =
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixPoolCreateFlagBits
[(PoolCreateFlagBits, String)]
showTablePoolCreateFlagBits
String
conNamePoolCreateFlagBits
(\(PoolCreateFlagBits Flags
x) -> Flags
x)
(\Flags
x -> String -> ShowS
showString String
"0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex Flags
x)
instance Read PoolCreateFlagBits where
readPrec :: ReadPrec PoolCreateFlagBits
readPrec =
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixPoolCreateFlagBits
[(PoolCreateFlagBits, String)]
showTablePoolCreateFlagBits
String
conNamePoolCreateFlagBits
Flags -> PoolCreateFlagBits
PoolCreateFlagBits
type DefragmentationFlags = DefragmentationFlagBits
newtype DefragmentationFlagBits = DefragmentationFlagBits Flags
deriving newtype (DefragmentationFlagBits -> DefragmentationFlagBits -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DefragmentationFlagBits -> DefragmentationFlagBits -> Bool
$c/= :: DefragmentationFlagBits -> DefragmentationFlagBits -> Bool
== :: DefragmentationFlagBits -> DefragmentationFlagBits -> Bool
$c== :: DefragmentationFlagBits -> DefragmentationFlagBits -> Bool
Eq, Eq DefragmentationFlagBits
DefragmentationFlagBits -> DefragmentationFlagBits -> Bool
DefragmentationFlagBits -> DefragmentationFlagBits -> Ordering
DefragmentationFlagBits
-> DefragmentationFlagBits -> DefragmentationFlagBits
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: DefragmentationFlagBits
-> DefragmentationFlagBits -> DefragmentationFlagBits
$cmin :: DefragmentationFlagBits
-> DefragmentationFlagBits -> DefragmentationFlagBits
max :: DefragmentationFlagBits
-> DefragmentationFlagBits -> DefragmentationFlagBits
$cmax :: DefragmentationFlagBits
-> DefragmentationFlagBits -> DefragmentationFlagBits
>= :: DefragmentationFlagBits -> DefragmentationFlagBits -> Bool
$c>= :: DefragmentationFlagBits -> DefragmentationFlagBits -> Bool
> :: DefragmentationFlagBits -> DefragmentationFlagBits -> Bool
$c> :: DefragmentationFlagBits -> DefragmentationFlagBits -> Bool
<= :: DefragmentationFlagBits -> DefragmentationFlagBits -> Bool
$c<= :: DefragmentationFlagBits -> DefragmentationFlagBits -> Bool
< :: DefragmentationFlagBits -> DefragmentationFlagBits -> Bool
$c< :: DefragmentationFlagBits -> DefragmentationFlagBits -> Bool
compare :: DefragmentationFlagBits -> DefragmentationFlagBits -> Ordering
$ccompare :: DefragmentationFlagBits -> DefragmentationFlagBits -> Ordering
Ord, Ptr DefragmentationFlagBits -> IO DefragmentationFlagBits
Ptr DefragmentationFlagBits -> Int -> IO DefragmentationFlagBits
Ptr DefragmentationFlagBits
-> Int -> DefragmentationFlagBits -> IO ()
Ptr DefragmentationFlagBits -> DefragmentationFlagBits -> IO ()
DefragmentationFlagBits -> Int
forall b. Ptr b -> Int -> IO DefragmentationFlagBits
forall b. Ptr b -> Int -> DefragmentationFlagBits -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr DefragmentationFlagBits -> DefragmentationFlagBits -> IO ()
$cpoke :: Ptr DefragmentationFlagBits -> DefragmentationFlagBits -> IO ()
peek :: Ptr DefragmentationFlagBits -> IO DefragmentationFlagBits
$cpeek :: Ptr DefragmentationFlagBits -> IO DefragmentationFlagBits
pokeByteOff :: forall b. Ptr b -> Int -> DefragmentationFlagBits -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> DefragmentationFlagBits -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO DefragmentationFlagBits
$cpeekByteOff :: forall b. Ptr b -> Int -> IO DefragmentationFlagBits
pokeElemOff :: Ptr DefragmentationFlagBits
-> Int -> DefragmentationFlagBits -> IO ()
$cpokeElemOff :: Ptr DefragmentationFlagBits
-> Int -> DefragmentationFlagBits -> IO ()
peekElemOff :: Ptr DefragmentationFlagBits -> Int -> IO DefragmentationFlagBits
$cpeekElemOff :: Ptr DefragmentationFlagBits -> Int -> IO DefragmentationFlagBits
alignment :: DefragmentationFlagBits -> Int
$calignment :: DefragmentationFlagBits -> Int
sizeOf :: DefragmentationFlagBits -> Int
$csizeOf :: DefragmentationFlagBits -> Int
Storable, DefragmentationFlagBits
forall a. a -> Zero a
zero :: DefragmentationFlagBits
$czero :: DefragmentationFlagBits
Zero, Eq DefragmentationFlagBits
DefragmentationFlagBits
Int -> DefragmentationFlagBits
DefragmentationFlagBits -> Bool
DefragmentationFlagBits -> Int
DefragmentationFlagBits -> Maybe Int
DefragmentationFlagBits -> DefragmentationFlagBits
DefragmentationFlagBits -> Int -> Bool
DefragmentationFlagBits -> Int -> DefragmentationFlagBits
DefragmentationFlagBits
-> DefragmentationFlagBits -> DefragmentationFlagBits
forall a.
Eq a
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: DefragmentationFlagBits -> Int
$cpopCount :: DefragmentationFlagBits -> Int
rotateR :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
$crotateR :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
rotateL :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
$crotateL :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
unsafeShiftR :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
$cunsafeShiftR :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
shiftR :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
$cshiftR :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
unsafeShiftL :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
$cunsafeShiftL :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
shiftL :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
$cshiftL :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
isSigned :: DefragmentationFlagBits -> Bool
$cisSigned :: DefragmentationFlagBits -> Bool
bitSize :: DefragmentationFlagBits -> Int
$cbitSize :: DefragmentationFlagBits -> Int
bitSizeMaybe :: DefragmentationFlagBits -> Maybe Int
$cbitSizeMaybe :: DefragmentationFlagBits -> Maybe Int
testBit :: DefragmentationFlagBits -> Int -> Bool
$ctestBit :: DefragmentationFlagBits -> Int -> Bool
complementBit :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
$ccomplementBit :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
clearBit :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
$cclearBit :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
setBit :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
$csetBit :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
bit :: Int -> DefragmentationFlagBits
$cbit :: Int -> DefragmentationFlagBits
zeroBits :: DefragmentationFlagBits
$czeroBits :: DefragmentationFlagBits
rotate :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
$crotate :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
shift :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
$cshift :: DefragmentationFlagBits -> Int -> DefragmentationFlagBits
complement :: DefragmentationFlagBits -> DefragmentationFlagBits
$ccomplement :: DefragmentationFlagBits -> DefragmentationFlagBits
xor :: DefragmentationFlagBits
-> DefragmentationFlagBits -> DefragmentationFlagBits
$cxor :: DefragmentationFlagBits
-> DefragmentationFlagBits -> DefragmentationFlagBits
.|. :: DefragmentationFlagBits
-> DefragmentationFlagBits -> DefragmentationFlagBits
$c.|. :: DefragmentationFlagBits
-> DefragmentationFlagBits -> DefragmentationFlagBits
.&. :: DefragmentationFlagBits
-> DefragmentationFlagBits -> DefragmentationFlagBits
$c.&. :: DefragmentationFlagBits
-> DefragmentationFlagBits -> DefragmentationFlagBits
Bits, Bits DefragmentationFlagBits
DefragmentationFlagBits -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: DefragmentationFlagBits -> Int
$ccountTrailingZeros :: DefragmentationFlagBits -> Int
countLeadingZeros :: DefragmentationFlagBits -> Int
$ccountLeadingZeros :: DefragmentationFlagBits -> Int
finiteBitSize :: DefragmentationFlagBits -> Int
$cfiniteBitSize :: DefragmentationFlagBits -> Int
FiniteBits)
pattern $bDEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT :: DefragmentationFlagBits
$mDEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT :: forall {r}.
DefragmentationFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT = DefragmentationFlagBits 0x00000001
pattern $bDEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT :: DefragmentationFlagBits
$mDEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT :: forall {r}.
DefragmentationFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT = DefragmentationFlagBits 0x00000002
pattern $bDEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT :: DefragmentationFlagBits
$mDEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT :: forall {r}.
DefragmentationFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT = DefragmentationFlagBits 0x00000004
pattern $bDEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT :: DefragmentationFlagBits
$mDEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT :: forall {r}.
DefragmentationFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT = DefragmentationFlagBits 0x00000008
pattern $bDEFRAGMENTATION_FLAG_ALGORITHM_MASK :: DefragmentationFlagBits
$mDEFRAGMENTATION_FLAG_ALGORITHM_MASK :: forall {r}.
DefragmentationFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
DEFRAGMENTATION_FLAG_ALGORITHM_MASK = DefragmentationFlagBits 0x0000000f
conNameDefragmentationFlagBits :: String
conNameDefragmentationFlagBits :: String
conNameDefragmentationFlagBits = String
"DefragmentationFlagBits"
enumPrefixDefragmentationFlagBits :: String
enumPrefixDefragmentationFlagBits :: String
enumPrefixDefragmentationFlagBits = String
"DEFRAGMENTATION_FLAG_ALGORITHM_"
showTableDefragmentationFlagBits :: [(DefragmentationFlagBits, String)]
showTableDefragmentationFlagBits :: [(DefragmentationFlagBits, String)]
showTableDefragmentationFlagBits =
[
( DefragmentationFlagBits
DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT
, String
"FAST_BIT"
)
,
( DefragmentationFlagBits
DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT
, String
"BALANCED_BIT"
)
,
( DefragmentationFlagBits
DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT
, String
"FULL_BIT"
)
,
( DefragmentationFlagBits
DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT
, String
"EXTENSIVE_BIT"
)
,
( DefragmentationFlagBits
DEFRAGMENTATION_FLAG_ALGORITHM_MASK
, String
"MASK"
)
]
instance Show DefragmentationFlagBits where
showsPrec :: Int -> DefragmentationFlagBits -> ShowS
showsPrec =
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixDefragmentationFlagBits
[(DefragmentationFlagBits, String)]
showTableDefragmentationFlagBits
String
conNameDefragmentationFlagBits
(\(DefragmentationFlagBits Flags
x) -> Flags
x)
(\Flags
x -> String -> ShowS
showString String
"0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex Flags
x)
instance Read DefragmentationFlagBits where
readPrec :: ReadPrec DefragmentationFlagBits
readPrec =
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixDefragmentationFlagBits
[(DefragmentationFlagBits, String)]
showTableDefragmentationFlagBits
String
conNameDefragmentationFlagBits
Flags -> DefragmentationFlagBits
DefragmentationFlagBits
newtype DefragmentationMoveOperation = DefragmentationMoveOperation Int32
deriving newtype (DefragmentationMoveOperation
-> DefragmentationMoveOperation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> Bool
$c/= :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> Bool
== :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> Bool
$c== :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> Bool
Eq, Eq DefragmentationMoveOperation
DefragmentationMoveOperation
-> DefragmentationMoveOperation -> Bool
DefragmentationMoveOperation
-> DefragmentationMoveOperation -> Ordering
DefragmentationMoveOperation
-> DefragmentationMoveOperation -> DefragmentationMoveOperation
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> DefragmentationMoveOperation
$cmin :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> DefragmentationMoveOperation
max :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> DefragmentationMoveOperation
$cmax :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> DefragmentationMoveOperation
>= :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> Bool
$c>= :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> Bool
> :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> Bool
$c> :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> Bool
<= :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> Bool
$c<= :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> Bool
< :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> Bool
$c< :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> Bool
compare :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> Ordering
$ccompare :: DefragmentationMoveOperation
-> DefragmentationMoveOperation -> Ordering
Ord, Ptr DefragmentationMoveOperation -> IO DefragmentationMoveOperation
Ptr DefragmentationMoveOperation
-> Int -> IO DefragmentationMoveOperation
Ptr DefragmentationMoveOperation
-> Int -> DefragmentationMoveOperation -> IO ()
Ptr DefragmentationMoveOperation
-> DefragmentationMoveOperation -> IO ()
DefragmentationMoveOperation -> Int
forall b. Ptr b -> Int -> IO DefragmentationMoveOperation
forall b. Ptr b -> Int -> DefragmentationMoveOperation -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr DefragmentationMoveOperation
-> DefragmentationMoveOperation -> IO ()
$cpoke :: Ptr DefragmentationMoveOperation
-> DefragmentationMoveOperation -> IO ()
peek :: Ptr DefragmentationMoveOperation -> IO DefragmentationMoveOperation
$cpeek :: Ptr DefragmentationMoveOperation -> IO DefragmentationMoveOperation
pokeByteOff :: forall b. Ptr b -> Int -> DefragmentationMoveOperation -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> DefragmentationMoveOperation -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO DefragmentationMoveOperation
$cpeekByteOff :: forall b. Ptr b -> Int -> IO DefragmentationMoveOperation
pokeElemOff :: Ptr DefragmentationMoveOperation
-> Int -> DefragmentationMoveOperation -> IO ()
$cpokeElemOff :: Ptr DefragmentationMoveOperation
-> Int -> DefragmentationMoveOperation -> IO ()
peekElemOff :: Ptr DefragmentationMoveOperation
-> Int -> IO DefragmentationMoveOperation
$cpeekElemOff :: Ptr DefragmentationMoveOperation
-> Int -> IO DefragmentationMoveOperation
alignment :: DefragmentationMoveOperation -> Int
$calignment :: DefragmentationMoveOperation -> Int
sizeOf :: DefragmentationMoveOperation -> Int
$csizeOf :: DefragmentationMoveOperation -> Int
Storable, DefragmentationMoveOperation
forall a. a -> Zero a
zero :: DefragmentationMoveOperation
$czero :: DefragmentationMoveOperation
Zero)
pattern $bDEFRAGMENTATION_MOVE_OPERATION_COPY :: DefragmentationMoveOperation
$mDEFRAGMENTATION_MOVE_OPERATION_COPY :: forall {r}.
DefragmentationMoveOperation -> ((# #) -> r) -> ((# #) -> r) -> r
DEFRAGMENTATION_MOVE_OPERATION_COPY = DefragmentationMoveOperation 0
pattern $bDEFRAGMENTATION_MOVE_OPERATION_IGNORE :: DefragmentationMoveOperation
$mDEFRAGMENTATION_MOVE_OPERATION_IGNORE :: forall {r}.
DefragmentationMoveOperation -> ((# #) -> r) -> ((# #) -> r) -> r
DEFRAGMENTATION_MOVE_OPERATION_IGNORE = DefragmentationMoveOperation 1
pattern $bDEFRAGMENTATION_MOVE_OPERATION_DESTROY :: DefragmentationMoveOperation
$mDEFRAGMENTATION_MOVE_OPERATION_DESTROY :: forall {r}.
DefragmentationMoveOperation -> ((# #) -> r) -> ((# #) -> r) -> r
DEFRAGMENTATION_MOVE_OPERATION_DESTROY = DefragmentationMoveOperation 2
{-# COMPLETE
DEFRAGMENTATION_MOVE_OPERATION_COPY
, DEFRAGMENTATION_MOVE_OPERATION_IGNORE
, DEFRAGMENTATION_MOVE_OPERATION_DESTROY ::
DefragmentationMoveOperation
#-}
conNameDefragmentationMoveOperation :: String
conNameDefragmentationMoveOperation :: String
conNameDefragmentationMoveOperation = String
"DefragmentationMoveOperation"
enumPrefixDefragmentationMoveOperation :: String
enumPrefixDefragmentationMoveOperation :: String
enumPrefixDefragmentationMoveOperation = String
"DEFRAGMENTATION_MOVE_OPERATION_"
showTableDefragmentationMoveOperation :: [(DefragmentationMoveOperation, String)]
showTableDefragmentationMoveOperation :: [(DefragmentationMoveOperation, String)]
showTableDefragmentationMoveOperation =
[
( DefragmentationMoveOperation
DEFRAGMENTATION_MOVE_OPERATION_COPY
, String
"COPY"
)
,
( DefragmentationMoveOperation
DEFRAGMENTATION_MOVE_OPERATION_IGNORE
, String
"IGNORE"
)
,
( DefragmentationMoveOperation
DEFRAGMENTATION_MOVE_OPERATION_DESTROY
, String
"DESTROY"
)
]
instance Show DefragmentationMoveOperation where
showsPrec :: Int -> DefragmentationMoveOperation -> ShowS
showsPrec =
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixDefragmentationMoveOperation
[(DefragmentationMoveOperation, String)]
showTableDefragmentationMoveOperation
String
conNameDefragmentationMoveOperation
(\(DefragmentationMoveOperation Int32
x) -> Int32
x)
(forall a. Show a => Int -> a -> ShowS
showsPrec Int
11)
instance Read DefragmentationMoveOperation where
readPrec :: ReadPrec DefragmentationMoveOperation
readPrec =
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixDefragmentationMoveOperation
[(DefragmentationMoveOperation, String)]
showTableDefragmentationMoveOperation
String
conNameDefragmentationMoveOperation
Int32 -> DefragmentationMoveOperation
DefragmentationMoveOperation
type VirtualBlockCreateFlags = VirtualBlockCreateFlagBits
newtype VirtualBlockCreateFlagBits = VirtualBlockCreateFlagBits Flags
deriving newtype (VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits -> Bool
$c/= :: VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits -> Bool
== :: VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits -> Bool
$c== :: VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits -> Bool
Eq, Eq VirtualBlockCreateFlagBits
VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits -> Bool
VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> Ordering
VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits
$cmin :: VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits
max :: VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits
$cmax :: VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits
>= :: VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits -> Bool
$c>= :: VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits -> Bool
> :: VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits -> Bool
$c> :: VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits -> Bool
<= :: VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits -> Bool
$c<= :: VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits -> Bool
< :: VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits -> Bool
$c< :: VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits -> Bool
compare :: VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> Ordering
$ccompare :: VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> Ordering
Ord, Ptr VirtualBlockCreateFlagBits -> IO VirtualBlockCreateFlagBits
Ptr VirtualBlockCreateFlagBits
-> Int -> IO VirtualBlockCreateFlagBits
Ptr VirtualBlockCreateFlagBits
-> Int -> VirtualBlockCreateFlagBits -> IO ()
Ptr VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> IO ()
VirtualBlockCreateFlagBits -> Int
forall b. Ptr b -> Int -> IO VirtualBlockCreateFlagBits
forall b. Ptr b -> Int -> VirtualBlockCreateFlagBits -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> IO ()
$cpoke :: Ptr VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> IO ()
peek :: Ptr VirtualBlockCreateFlagBits -> IO VirtualBlockCreateFlagBits
$cpeek :: Ptr VirtualBlockCreateFlagBits -> IO VirtualBlockCreateFlagBits
pokeByteOff :: forall b. Ptr b -> Int -> VirtualBlockCreateFlagBits -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> VirtualBlockCreateFlagBits -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO VirtualBlockCreateFlagBits
$cpeekByteOff :: forall b. Ptr b -> Int -> IO VirtualBlockCreateFlagBits
pokeElemOff :: Ptr VirtualBlockCreateFlagBits
-> Int -> VirtualBlockCreateFlagBits -> IO ()
$cpokeElemOff :: Ptr VirtualBlockCreateFlagBits
-> Int -> VirtualBlockCreateFlagBits -> IO ()
peekElemOff :: Ptr VirtualBlockCreateFlagBits
-> Int -> IO VirtualBlockCreateFlagBits
$cpeekElemOff :: Ptr VirtualBlockCreateFlagBits
-> Int -> IO VirtualBlockCreateFlagBits
alignment :: VirtualBlockCreateFlagBits -> Int
$calignment :: VirtualBlockCreateFlagBits -> Int
sizeOf :: VirtualBlockCreateFlagBits -> Int
$csizeOf :: VirtualBlockCreateFlagBits -> Int
Storable, VirtualBlockCreateFlagBits
forall a. a -> Zero a
zero :: VirtualBlockCreateFlagBits
$czero :: VirtualBlockCreateFlagBits
Zero, Eq VirtualBlockCreateFlagBits
VirtualBlockCreateFlagBits
Int -> VirtualBlockCreateFlagBits
VirtualBlockCreateFlagBits -> Bool
VirtualBlockCreateFlagBits -> Int
VirtualBlockCreateFlagBits -> Maybe Int
VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits
VirtualBlockCreateFlagBits -> Int -> Bool
VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits
forall a.
Eq a
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: VirtualBlockCreateFlagBits -> Int
$cpopCount :: VirtualBlockCreateFlagBits -> Int
rotateR :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
$crotateR :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
rotateL :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
$crotateL :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
unsafeShiftR :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
$cunsafeShiftR :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
shiftR :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
$cshiftR :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
unsafeShiftL :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
$cunsafeShiftL :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
shiftL :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
$cshiftL :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
isSigned :: VirtualBlockCreateFlagBits -> Bool
$cisSigned :: VirtualBlockCreateFlagBits -> Bool
bitSize :: VirtualBlockCreateFlagBits -> Int
$cbitSize :: VirtualBlockCreateFlagBits -> Int
bitSizeMaybe :: VirtualBlockCreateFlagBits -> Maybe Int
$cbitSizeMaybe :: VirtualBlockCreateFlagBits -> Maybe Int
testBit :: VirtualBlockCreateFlagBits -> Int -> Bool
$ctestBit :: VirtualBlockCreateFlagBits -> Int -> Bool
complementBit :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
$ccomplementBit :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
clearBit :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
$cclearBit :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
setBit :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
$csetBit :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
bit :: Int -> VirtualBlockCreateFlagBits
$cbit :: Int -> VirtualBlockCreateFlagBits
zeroBits :: VirtualBlockCreateFlagBits
$czeroBits :: VirtualBlockCreateFlagBits
rotate :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
$crotate :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
shift :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
$cshift :: VirtualBlockCreateFlagBits -> Int -> VirtualBlockCreateFlagBits
complement :: VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits
$ccomplement :: VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits
xor :: VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits
$cxor :: VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits
.|. :: VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits
$c.|. :: VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits
.&. :: VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits
$c.&. :: VirtualBlockCreateFlagBits
-> VirtualBlockCreateFlagBits -> VirtualBlockCreateFlagBits
Bits, Bits VirtualBlockCreateFlagBits
VirtualBlockCreateFlagBits -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: VirtualBlockCreateFlagBits -> Int
$ccountTrailingZeros :: VirtualBlockCreateFlagBits -> Int
countLeadingZeros :: VirtualBlockCreateFlagBits -> Int
$ccountLeadingZeros :: VirtualBlockCreateFlagBits -> Int
finiteBitSize :: VirtualBlockCreateFlagBits -> Int
$cfiniteBitSize :: VirtualBlockCreateFlagBits -> Int
FiniteBits)
pattern $bVIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT :: VirtualBlockCreateFlagBits
$mVIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT :: forall {r}.
VirtualBlockCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT = VirtualBlockCreateFlagBits 0x00000001
pattern $bVIRTUAL_BLOCK_CREATE_ALGORITHM_MASK :: VirtualBlockCreateFlagBits
$mVIRTUAL_BLOCK_CREATE_ALGORITHM_MASK :: forall {r}.
VirtualBlockCreateFlagBits -> ((# #) -> r) -> ((# #) -> r) -> r
VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK = VirtualBlockCreateFlagBits 0x00000001
conNameVirtualBlockCreateFlagBits :: String
conNameVirtualBlockCreateFlagBits :: String
conNameVirtualBlockCreateFlagBits = String
"VirtualBlockCreateFlagBits"
enumPrefixVirtualBlockCreateFlagBits :: String
enumPrefixVirtualBlockCreateFlagBits :: String
enumPrefixVirtualBlockCreateFlagBits = String
"VIRTUAL_BLOCK_CREATE_"
showTableVirtualBlockCreateFlagBits :: [(VirtualBlockCreateFlagBits, String)]
showTableVirtualBlockCreateFlagBits :: [(VirtualBlockCreateFlagBits, String)]
showTableVirtualBlockCreateFlagBits =
[
( VirtualBlockCreateFlagBits
VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT
, String
"LINEAR_ALGORITHM_BIT"
)
,
( VirtualBlockCreateFlagBits
VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK
, String
"ALGORITHM_MASK"
)
]
instance Show VirtualBlockCreateFlagBits where
showsPrec :: Int -> VirtualBlockCreateFlagBits -> ShowS
showsPrec =
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixVirtualBlockCreateFlagBits
[(VirtualBlockCreateFlagBits, String)]
showTableVirtualBlockCreateFlagBits
String
conNameVirtualBlockCreateFlagBits
(\(VirtualBlockCreateFlagBits Flags
x) -> Flags
x)
(\Flags
x -> String -> ShowS
showString String
"0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex Flags
x)
instance Read VirtualBlockCreateFlagBits where
readPrec :: ReadPrec VirtualBlockCreateFlagBits
readPrec =
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixVirtualBlockCreateFlagBits
[(VirtualBlockCreateFlagBits, String)]
showTableVirtualBlockCreateFlagBits
String
conNameVirtualBlockCreateFlagBits
Flags -> VirtualBlockCreateFlagBits
VirtualBlockCreateFlagBits
type VirtualAllocationCreateFlags = VirtualAllocationCreateFlagBits
newtype VirtualAllocationCreateFlagBits = VirtualAllocationCreateFlagBits Flags
deriving newtype (VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> Bool
$c/= :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> Bool
== :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> Bool
$c== :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> Bool
Eq, Eq VirtualAllocationCreateFlagBits
VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> Bool
VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> Ordering
VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
$cmin :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
max :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
$cmax :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
>= :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> Bool
$c>= :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> Bool
> :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> Bool
$c> :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> Bool
<= :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> Bool
$c<= :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> Bool
< :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> Bool
$c< :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> Bool
compare :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> Ordering
$ccompare :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> Ordering
Ord, Ptr VirtualAllocationCreateFlagBits
-> IO VirtualAllocationCreateFlagBits
Ptr VirtualAllocationCreateFlagBits
-> Int -> IO VirtualAllocationCreateFlagBits
Ptr VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits -> IO ()
Ptr VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> IO ()
VirtualAllocationCreateFlagBits -> Int
forall b. Ptr b -> Int -> IO VirtualAllocationCreateFlagBits
forall b. Ptr b -> Int -> VirtualAllocationCreateFlagBits -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> IO ()
$cpoke :: Ptr VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits -> IO ()
peek :: Ptr VirtualAllocationCreateFlagBits
-> IO VirtualAllocationCreateFlagBits
$cpeek :: Ptr VirtualAllocationCreateFlagBits
-> IO VirtualAllocationCreateFlagBits
pokeByteOff :: forall b. Ptr b -> Int -> VirtualAllocationCreateFlagBits -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> VirtualAllocationCreateFlagBits -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO VirtualAllocationCreateFlagBits
$cpeekByteOff :: forall b. Ptr b -> Int -> IO VirtualAllocationCreateFlagBits
pokeElemOff :: Ptr VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits -> IO ()
$cpokeElemOff :: Ptr VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits -> IO ()
peekElemOff :: Ptr VirtualAllocationCreateFlagBits
-> Int -> IO VirtualAllocationCreateFlagBits
$cpeekElemOff :: Ptr VirtualAllocationCreateFlagBits
-> Int -> IO VirtualAllocationCreateFlagBits
alignment :: VirtualAllocationCreateFlagBits -> Int
$calignment :: VirtualAllocationCreateFlagBits -> Int
sizeOf :: VirtualAllocationCreateFlagBits -> Int
$csizeOf :: VirtualAllocationCreateFlagBits -> Int
Storable, VirtualAllocationCreateFlagBits
forall a. a -> Zero a
zero :: VirtualAllocationCreateFlagBits
$czero :: VirtualAllocationCreateFlagBits
Zero, Eq VirtualAllocationCreateFlagBits
VirtualAllocationCreateFlagBits
Int -> VirtualAllocationCreateFlagBits
VirtualAllocationCreateFlagBits -> Bool
VirtualAllocationCreateFlagBits -> Int
VirtualAllocationCreateFlagBits -> Maybe Int
VirtualAllocationCreateFlagBits -> VirtualAllocationCreateFlagBits
VirtualAllocationCreateFlagBits -> Int -> Bool
VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
forall a.
Eq a
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: VirtualAllocationCreateFlagBits -> Int
$cpopCount :: VirtualAllocationCreateFlagBits -> Int
rotateR :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
$crotateR :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
rotateL :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
$crotateL :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
unsafeShiftR :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
$cunsafeShiftR :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
shiftR :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
$cshiftR :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
unsafeShiftL :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
$cunsafeShiftL :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
shiftL :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
$cshiftL :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
isSigned :: VirtualAllocationCreateFlagBits -> Bool
$cisSigned :: VirtualAllocationCreateFlagBits -> Bool
bitSize :: VirtualAllocationCreateFlagBits -> Int
$cbitSize :: VirtualAllocationCreateFlagBits -> Int
bitSizeMaybe :: VirtualAllocationCreateFlagBits -> Maybe Int
$cbitSizeMaybe :: VirtualAllocationCreateFlagBits -> Maybe Int
testBit :: VirtualAllocationCreateFlagBits -> Int -> Bool
$ctestBit :: VirtualAllocationCreateFlagBits -> Int -> Bool
complementBit :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
$ccomplementBit :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
clearBit :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
$cclearBit :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
setBit :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
$csetBit :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
bit :: Int -> VirtualAllocationCreateFlagBits
$cbit :: Int -> VirtualAllocationCreateFlagBits
zeroBits :: VirtualAllocationCreateFlagBits
$czeroBits :: VirtualAllocationCreateFlagBits
rotate :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
$crotate :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
shift :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
$cshift :: VirtualAllocationCreateFlagBits
-> Int -> VirtualAllocationCreateFlagBits
complement :: VirtualAllocationCreateFlagBits -> VirtualAllocationCreateFlagBits
$ccomplement :: VirtualAllocationCreateFlagBits -> VirtualAllocationCreateFlagBits
xor :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
$cxor :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
.|. :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
$c.|. :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
.&. :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
$c.&. :: VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
-> VirtualAllocationCreateFlagBits
Bits, Bits VirtualAllocationCreateFlagBits
VirtualAllocationCreateFlagBits -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: VirtualAllocationCreateFlagBits -> Int
$ccountTrailingZeros :: VirtualAllocationCreateFlagBits -> Int
countLeadingZeros :: VirtualAllocationCreateFlagBits -> Int
$ccountLeadingZeros :: VirtualAllocationCreateFlagBits -> Int
finiteBitSize :: VirtualAllocationCreateFlagBits -> Int
$cfiniteBitSize :: VirtualAllocationCreateFlagBits -> Int
FiniteBits)
pattern $bVIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT :: VirtualAllocationCreateFlagBits
$mVIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT :: forall {r}.
VirtualAllocationCreateFlagBits
-> ((# #) -> r) -> ((# #) -> r) -> r
VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT = VirtualAllocationCreateFlagBits 0x00000040
pattern $bVIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT :: VirtualAllocationCreateFlagBits
$mVIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT :: forall {r}.
VirtualAllocationCreateFlagBits
-> ((# #) -> r) -> ((# #) -> r) -> r
VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT = VirtualAllocationCreateFlagBits 0x00010000
pattern $bVIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT :: VirtualAllocationCreateFlagBits
$mVIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT :: forall {r}.
VirtualAllocationCreateFlagBits
-> ((# #) -> r) -> ((# #) -> r) -> r
VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT = VirtualAllocationCreateFlagBits 0x00020000
pattern $bVIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT :: VirtualAllocationCreateFlagBits
$mVIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT :: forall {r}.
VirtualAllocationCreateFlagBits
-> ((# #) -> r) -> ((# #) -> r) -> r
VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT = VirtualAllocationCreateFlagBits 0x00040000
pattern $bVIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK :: VirtualAllocationCreateFlagBits
$mVIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK :: forall {r}.
VirtualAllocationCreateFlagBits
-> ((# #) -> r) -> ((# #) -> r) -> r
VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK = VirtualAllocationCreateFlagBits 0x00070000
conNameVirtualAllocationCreateFlagBits :: String
conNameVirtualAllocationCreateFlagBits :: String
conNameVirtualAllocationCreateFlagBits = String
"VirtualAllocationCreateFlagBits"
enumPrefixVirtualAllocationCreateFlagBits :: String
enumPrefixVirtualAllocationCreateFlagBits :: String
enumPrefixVirtualAllocationCreateFlagBits = String
"VIRTUAL_ALLOCATION_CREATE_"
showTableVirtualAllocationCreateFlagBits :: [(VirtualAllocationCreateFlagBits, String)]
showTableVirtualAllocationCreateFlagBits :: [(VirtualAllocationCreateFlagBits, String)]
showTableVirtualAllocationCreateFlagBits =
[
( VirtualAllocationCreateFlagBits
VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT
, String
"UPPER_ADDRESS_BIT"
)
,
( VirtualAllocationCreateFlagBits
VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT
, String
"STRATEGY_MIN_MEMORY_BIT"
)
,
( VirtualAllocationCreateFlagBits
VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT
, String
"STRATEGY_MIN_TIME_BIT"
)
,
( VirtualAllocationCreateFlagBits
VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT
, String
"STRATEGY_MIN_OFFSET_BIT"
)
,
( VirtualAllocationCreateFlagBits
VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK
, String
"STRATEGY_MASK"
)
]
instance Show VirtualAllocationCreateFlagBits where
showsPrec :: Int -> VirtualAllocationCreateFlagBits -> ShowS
showsPrec =
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixVirtualAllocationCreateFlagBits
[(VirtualAllocationCreateFlagBits, String)]
showTableVirtualAllocationCreateFlagBits
String
conNameVirtualAllocationCreateFlagBits
(\(VirtualAllocationCreateFlagBits Flags
x) -> Flags
x)
(\Flags
x -> String -> ShowS
showString String
"0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex Flags
x)
instance Read VirtualAllocationCreateFlagBits where
readPrec :: ReadPrec VirtualAllocationCreateFlagBits
readPrec =
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixVirtualAllocationCreateFlagBits
[(VirtualAllocationCreateFlagBits, String)]
showTableVirtualAllocationCreateFlagBits
String
conNameVirtualAllocationCreateFlagBits
Flags -> VirtualAllocationCreateFlagBits
VirtualAllocationCreateFlagBits
newtype Allocator = Allocator Word64
deriving newtype (Allocator -> Allocator -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Allocator -> Allocator -> Bool
$c/= :: Allocator -> Allocator -> Bool
== :: Allocator -> Allocator -> Bool
$c== :: Allocator -> Allocator -> Bool
Eq, Eq Allocator
Allocator -> Allocator -> Bool
Allocator -> Allocator -> Ordering
Allocator -> Allocator -> Allocator
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Allocator -> Allocator -> Allocator
$cmin :: Allocator -> Allocator -> Allocator
max :: Allocator -> Allocator -> Allocator
$cmax :: Allocator -> Allocator -> Allocator
>= :: Allocator -> Allocator -> Bool
$c>= :: Allocator -> Allocator -> Bool
> :: Allocator -> Allocator -> Bool
$c> :: Allocator -> Allocator -> Bool
<= :: Allocator -> Allocator -> Bool
$c<= :: Allocator -> Allocator -> Bool
< :: Allocator -> Allocator -> Bool
$c< :: Allocator -> Allocator -> Bool
compare :: Allocator -> Allocator -> Ordering
$ccompare :: Allocator -> Allocator -> Ordering
Ord, Ptr Allocator -> IO Allocator
Ptr Allocator -> Int -> IO Allocator
Ptr Allocator -> Int -> Allocator -> IO ()
Ptr Allocator -> Allocator -> IO ()
Allocator -> Int
forall b. Ptr b -> Int -> IO Allocator
forall b. Ptr b -> Int -> Allocator -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr Allocator -> Allocator -> IO ()
$cpoke :: Ptr Allocator -> Allocator -> IO ()
peek :: Ptr Allocator -> IO Allocator
$cpeek :: Ptr Allocator -> IO Allocator
pokeByteOff :: forall b. Ptr b -> Int -> Allocator -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> Allocator -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO Allocator
$cpeekByteOff :: forall b. Ptr b -> Int -> IO Allocator
pokeElemOff :: Ptr Allocator -> Int -> Allocator -> IO ()
$cpokeElemOff :: Ptr Allocator -> Int -> Allocator -> IO ()
peekElemOff :: Ptr Allocator -> Int -> IO Allocator
$cpeekElemOff :: Ptr Allocator -> Int -> IO Allocator
alignment :: Allocator -> Int
$calignment :: Allocator -> Int
sizeOf :: Allocator -> Int
$csizeOf :: Allocator -> Int
Storable, Allocator
forall a. a -> Zero a
zero :: Allocator
$czero :: Allocator
Zero)
deriving anyclass (Eq Allocator
Zero Allocator
forall a. Eq a -> Zero a -> IsHandle a
IsHandle)
instance Show Allocator where
showsPrec :: Int -> Allocator -> ShowS
showsPrec Int
p (Allocator "offset" ::: DeviceSize
x) = Bool -> ShowS -> ShowS
showParen (Int
p forall a. Ord a => a -> a -> Bool
>= Int
11) (String -> ShowS
showString String
"Allocator 0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex "offset" ::: DeviceSize
x)
newtype Pool = Pool Word64
deriving newtype (Pool -> Pool -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Pool -> Pool -> Bool
$c/= :: Pool -> Pool -> Bool
== :: Pool -> Pool -> Bool
$c== :: Pool -> Pool -> Bool
Eq, Eq Pool
Pool -> Pool -> Bool
Pool -> Pool -> Ordering
Pool -> Pool -> Pool
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Pool -> Pool -> Pool
$cmin :: Pool -> Pool -> Pool
max :: Pool -> Pool -> Pool
$cmax :: Pool -> Pool -> Pool
>= :: Pool -> Pool -> Bool
$c>= :: Pool -> Pool -> Bool
> :: Pool -> Pool -> Bool
$c> :: Pool -> Pool -> Bool
<= :: Pool -> Pool -> Bool
$c<= :: Pool -> Pool -> Bool
< :: Pool -> Pool -> Bool
$c< :: Pool -> Pool -> Bool
compare :: Pool -> Pool -> Ordering
$ccompare :: Pool -> Pool -> Ordering
Ord, Ptr Pool -> IO Pool
Ptr Pool -> Int -> IO Pool
Ptr Pool -> Int -> Pool -> IO ()
Ptr Pool -> Pool -> IO ()
Pool -> Int
forall b. Ptr b -> Int -> IO Pool
forall b. Ptr b -> Int -> Pool -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr Pool -> Pool -> IO ()
$cpoke :: Ptr Pool -> Pool -> IO ()
peek :: Ptr Pool -> IO Pool
$cpeek :: Ptr Pool -> IO Pool
pokeByteOff :: forall b. Ptr b -> Int -> Pool -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> Pool -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO Pool
$cpeekByteOff :: forall b. Ptr b -> Int -> IO Pool
pokeElemOff :: Ptr Pool -> Int -> Pool -> IO ()
$cpokeElemOff :: Ptr Pool -> Int -> Pool -> IO ()
peekElemOff :: Ptr Pool -> Int -> IO Pool
$cpeekElemOff :: Ptr Pool -> Int -> IO Pool
alignment :: Pool -> Int
$calignment :: Pool -> Int
sizeOf :: Pool -> Int
$csizeOf :: Pool -> Int
Storable, Pool
forall a. a -> Zero a
zero :: Pool
$czero :: Pool
Zero)
deriving anyclass (Eq Pool
Zero Pool
forall a. Eq a -> Zero a -> IsHandle a
IsHandle)
instance Show Pool where
showsPrec :: Int -> Pool -> ShowS
showsPrec Int
p (Pool "offset" ::: DeviceSize
x) = Bool -> ShowS -> ShowS
showParen (Int
p forall a. Ord a => a -> a -> Bool
>= Int
11) (String -> ShowS
showString String
"Pool 0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex "offset" ::: DeviceSize
x)
newtype Allocation = Allocation Word64
deriving newtype (Allocation -> Allocation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Allocation -> Allocation -> Bool
$c/= :: Allocation -> Allocation -> Bool
== :: Allocation -> Allocation -> Bool
$c== :: Allocation -> Allocation -> Bool
Eq, Eq Allocation
Allocation -> Allocation -> Bool
Allocation -> Allocation -> Ordering
Allocation -> Allocation -> Allocation
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Allocation -> Allocation -> Allocation
$cmin :: Allocation -> Allocation -> Allocation
max :: Allocation -> Allocation -> Allocation
$cmax :: Allocation -> Allocation -> Allocation
>= :: Allocation -> Allocation -> Bool
$c>= :: Allocation -> Allocation -> Bool
> :: Allocation -> Allocation -> Bool
$c> :: Allocation -> Allocation -> Bool
<= :: Allocation -> Allocation -> Bool
$c<= :: Allocation -> Allocation -> Bool
< :: Allocation -> Allocation -> Bool
$c< :: Allocation -> Allocation -> Bool
compare :: Allocation -> Allocation -> Ordering
$ccompare :: Allocation -> Allocation -> Ordering
Ord, Ptr Allocation -> IO Allocation
Ptr Allocation -> Int -> IO Allocation
Ptr Allocation -> Int -> Allocation -> IO ()
Ptr Allocation -> Allocation -> IO ()
Allocation -> Int
forall b. Ptr b -> Int -> IO Allocation
forall b. Ptr b -> Int -> Allocation -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr Allocation -> Allocation -> IO ()
$cpoke :: Ptr Allocation -> Allocation -> IO ()
peek :: Ptr Allocation -> IO Allocation
$cpeek :: Ptr Allocation -> IO Allocation
pokeByteOff :: forall b. Ptr b -> Int -> Allocation -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> Allocation -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO Allocation
$cpeekByteOff :: forall b. Ptr b -> Int -> IO Allocation
pokeElemOff :: Ptr Allocation -> Int -> Allocation -> IO ()
$cpokeElemOff :: Ptr Allocation -> Int -> Allocation -> IO ()
peekElemOff :: Ptr Allocation -> Int -> IO Allocation
$cpeekElemOff :: Ptr Allocation -> Int -> IO Allocation
alignment :: Allocation -> Int
$calignment :: Allocation -> Int
sizeOf :: Allocation -> Int
$csizeOf :: Allocation -> Int
Storable, Allocation
forall a. a -> Zero a
zero :: Allocation
$czero :: Allocation
Zero)
deriving anyclass (Eq Allocation
Zero Allocation
forall a. Eq a -> Zero a -> IsHandle a
IsHandle)
instance Show Allocation where
showsPrec :: Int -> Allocation -> ShowS
showsPrec Int
p (Allocation "offset" ::: DeviceSize
x) = Bool -> ShowS -> ShowS
showParen (Int
p forall a. Ord a => a -> a -> Bool
>= Int
11) (String -> ShowS
showString String
"Allocation 0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex "offset" ::: DeviceSize
x)
newtype DefragmentationContext = DefragmentationContext Word64
deriving newtype (DefragmentationContext -> DefragmentationContext -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DefragmentationContext -> DefragmentationContext -> Bool
$c/= :: DefragmentationContext -> DefragmentationContext -> Bool
== :: DefragmentationContext -> DefragmentationContext -> Bool
$c== :: DefragmentationContext -> DefragmentationContext -> Bool
Eq, Eq DefragmentationContext
DefragmentationContext -> DefragmentationContext -> Bool
DefragmentationContext -> DefragmentationContext -> Ordering
DefragmentationContext
-> DefragmentationContext -> DefragmentationContext
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: DefragmentationContext
-> DefragmentationContext -> DefragmentationContext
$cmin :: DefragmentationContext
-> DefragmentationContext -> DefragmentationContext
max :: DefragmentationContext
-> DefragmentationContext -> DefragmentationContext
$cmax :: DefragmentationContext
-> DefragmentationContext -> DefragmentationContext
>= :: DefragmentationContext -> DefragmentationContext -> Bool
$c>= :: DefragmentationContext -> DefragmentationContext -> Bool
> :: DefragmentationContext -> DefragmentationContext -> Bool
$c> :: DefragmentationContext -> DefragmentationContext -> Bool
<= :: DefragmentationContext -> DefragmentationContext -> Bool
$c<= :: DefragmentationContext -> DefragmentationContext -> Bool
< :: DefragmentationContext -> DefragmentationContext -> Bool
$c< :: DefragmentationContext -> DefragmentationContext -> Bool
compare :: DefragmentationContext -> DefragmentationContext -> Ordering
$ccompare :: DefragmentationContext -> DefragmentationContext -> Ordering
Ord, Ptr DefragmentationContext -> IO DefragmentationContext
Ptr DefragmentationContext -> Int -> IO DefragmentationContext
Ptr DefragmentationContext
-> Int -> DefragmentationContext -> IO ()
Ptr DefragmentationContext -> DefragmentationContext -> IO ()
DefragmentationContext -> Int
forall b. Ptr b -> Int -> IO DefragmentationContext
forall b. Ptr b -> Int -> DefragmentationContext -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr DefragmentationContext -> DefragmentationContext -> IO ()
$cpoke :: Ptr DefragmentationContext -> DefragmentationContext -> IO ()
peek :: Ptr DefragmentationContext -> IO DefragmentationContext
$cpeek :: Ptr DefragmentationContext -> IO DefragmentationContext
pokeByteOff :: forall b. Ptr b -> Int -> DefragmentationContext -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> DefragmentationContext -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO DefragmentationContext
$cpeekByteOff :: forall b. Ptr b -> Int -> IO DefragmentationContext
pokeElemOff :: Ptr DefragmentationContext
-> Int -> DefragmentationContext -> IO ()
$cpokeElemOff :: Ptr DefragmentationContext
-> Int -> DefragmentationContext -> IO ()
peekElemOff :: Ptr DefragmentationContext -> Int -> IO DefragmentationContext
$cpeekElemOff :: Ptr DefragmentationContext -> Int -> IO DefragmentationContext
alignment :: DefragmentationContext -> Int
$calignment :: DefragmentationContext -> Int
sizeOf :: DefragmentationContext -> Int
$csizeOf :: DefragmentationContext -> Int
Storable, DefragmentationContext
forall a. a -> Zero a
zero :: DefragmentationContext
$czero :: DefragmentationContext
Zero)
deriving anyclass (Eq DefragmentationContext
Zero DefragmentationContext
forall a. Eq a -> Zero a -> IsHandle a
IsHandle)
instance Show DefragmentationContext where
showsPrec :: Int -> DefragmentationContext -> ShowS
showsPrec Int
p (DefragmentationContext "offset" ::: DeviceSize
x) = Bool -> ShowS -> ShowS
showParen (Int
p forall a. Ord a => a -> a -> Bool
>= Int
11) (String -> ShowS
showString String
"DefragmentationContext 0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex "offset" ::: DeviceSize
x)
newtype VirtualAllocation = VirtualAllocation Word64
deriving newtype (VirtualAllocation -> VirtualAllocation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VirtualAllocation -> VirtualAllocation -> Bool
$c/= :: VirtualAllocation -> VirtualAllocation -> Bool
== :: VirtualAllocation -> VirtualAllocation -> Bool
$c== :: VirtualAllocation -> VirtualAllocation -> Bool
Eq, Eq VirtualAllocation
VirtualAllocation -> VirtualAllocation -> Bool
VirtualAllocation -> VirtualAllocation -> Ordering
VirtualAllocation -> VirtualAllocation -> VirtualAllocation
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: VirtualAllocation -> VirtualAllocation -> VirtualAllocation
$cmin :: VirtualAllocation -> VirtualAllocation -> VirtualAllocation
max :: VirtualAllocation -> VirtualAllocation -> VirtualAllocation
$cmax :: VirtualAllocation -> VirtualAllocation -> VirtualAllocation
>= :: VirtualAllocation -> VirtualAllocation -> Bool
$c>= :: VirtualAllocation -> VirtualAllocation -> Bool
> :: VirtualAllocation -> VirtualAllocation -> Bool
$c> :: VirtualAllocation -> VirtualAllocation -> Bool
<= :: VirtualAllocation -> VirtualAllocation -> Bool
$c<= :: VirtualAllocation -> VirtualAllocation -> Bool
< :: VirtualAllocation -> VirtualAllocation -> Bool
$c< :: VirtualAllocation -> VirtualAllocation -> Bool
compare :: VirtualAllocation -> VirtualAllocation -> Ordering
$ccompare :: VirtualAllocation -> VirtualAllocation -> Ordering
Ord, Ptr VirtualAllocation -> IO VirtualAllocation
Ptr VirtualAllocation -> Int -> IO VirtualAllocation
Ptr VirtualAllocation -> Int -> VirtualAllocation -> IO ()
Ptr VirtualAllocation -> VirtualAllocation -> IO ()
VirtualAllocation -> Int
forall b. Ptr b -> Int -> IO VirtualAllocation
forall b. Ptr b -> Int -> VirtualAllocation -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr VirtualAllocation -> VirtualAllocation -> IO ()
$cpoke :: Ptr VirtualAllocation -> VirtualAllocation -> IO ()
peek :: Ptr VirtualAllocation -> IO VirtualAllocation
$cpeek :: Ptr VirtualAllocation -> IO VirtualAllocation
pokeByteOff :: forall b. Ptr b -> Int -> VirtualAllocation -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> VirtualAllocation -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO VirtualAllocation
$cpeekByteOff :: forall b. Ptr b -> Int -> IO VirtualAllocation
pokeElemOff :: Ptr VirtualAllocation -> Int -> VirtualAllocation -> IO ()
$cpokeElemOff :: Ptr VirtualAllocation -> Int -> VirtualAllocation -> IO ()
peekElemOff :: Ptr VirtualAllocation -> Int -> IO VirtualAllocation
$cpeekElemOff :: Ptr VirtualAllocation -> Int -> IO VirtualAllocation
alignment :: VirtualAllocation -> Int
$calignment :: VirtualAllocation -> Int
sizeOf :: VirtualAllocation -> Int
$csizeOf :: VirtualAllocation -> Int
Storable, VirtualAllocation
forall a. a -> Zero a
zero :: VirtualAllocation
$czero :: VirtualAllocation
Zero)
deriving anyclass (Eq VirtualAllocation
Zero VirtualAllocation
forall a. Eq a -> Zero a -> IsHandle a
IsHandle)
instance Show VirtualAllocation where
showsPrec :: Int -> VirtualAllocation -> ShowS
showsPrec Int
p (VirtualAllocation "offset" ::: DeviceSize
x) = Bool -> ShowS -> ShowS
showParen (Int
p forall a. Ord a => a -> a -> Bool
>= Int
11) (String -> ShowS
showString String
"VirtualAllocation 0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex "offset" ::: DeviceSize
x)
newtype VirtualBlock = VirtualBlock Word64
deriving newtype (VirtualBlock -> VirtualBlock -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VirtualBlock -> VirtualBlock -> Bool
$c/= :: VirtualBlock -> VirtualBlock -> Bool
== :: VirtualBlock -> VirtualBlock -> Bool
$c== :: VirtualBlock -> VirtualBlock -> Bool
Eq, Eq VirtualBlock
VirtualBlock -> VirtualBlock -> Bool
VirtualBlock -> VirtualBlock -> Ordering
VirtualBlock -> VirtualBlock -> VirtualBlock
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: VirtualBlock -> VirtualBlock -> VirtualBlock
$cmin :: VirtualBlock -> VirtualBlock -> VirtualBlock
max :: VirtualBlock -> VirtualBlock -> VirtualBlock
$cmax :: VirtualBlock -> VirtualBlock -> VirtualBlock
>= :: VirtualBlock -> VirtualBlock -> Bool
$c>= :: VirtualBlock -> VirtualBlock -> Bool
> :: VirtualBlock -> VirtualBlock -> Bool
$c> :: VirtualBlock -> VirtualBlock -> Bool
<= :: VirtualBlock -> VirtualBlock -> Bool
$c<= :: VirtualBlock -> VirtualBlock -> Bool
< :: VirtualBlock -> VirtualBlock -> Bool
$c< :: VirtualBlock -> VirtualBlock -> Bool
compare :: VirtualBlock -> VirtualBlock -> Ordering
$ccompare :: VirtualBlock -> VirtualBlock -> Ordering
Ord, Ptr VirtualBlock -> IO VirtualBlock
Ptr VirtualBlock -> Int -> IO VirtualBlock
Ptr VirtualBlock -> Int -> VirtualBlock -> IO ()
Ptr VirtualBlock -> VirtualBlock -> IO ()
VirtualBlock -> Int
forall b. Ptr b -> Int -> IO VirtualBlock
forall b. Ptr b -> Int -> VirtualBlock -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr VirtualBlock -> VirtualBlock -> IO ()
$cpoke :: Ptr VirtualBlock -> VirtualBlock -> IO ()
peek :: Ptr VirtualBlock -> IO VirtualBlock
$cpeek :: Ptr VirtualBlock -> IO VirtualBlock
pokeByteOff :: forall b. Ptr b -> Int -> VirtualBlock -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> VirtualBlock -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO VirtualBlock
$cpeekByteOff :: forall b. Ptr b -> Int -> IO VirtualBlock
pokeElemOff :: Ptr VirtualBlock -> Int -> VirtualBlock -> IO ()
$cpokeElemOff :: Ptr VirtualBlock -> Int -> VirtualBlock -> IO ()
peekElemOff :: Ptr VirtualBlock -> Int -> IO VirtualBlock
$cpeekElemOff :: Ptr VirtualBlock -> Int -> IO VirtualBlock
alignment :: VirtualBlock -> Int
$calignment :: VirtualBlock -> Int
sizeOf :: VirtualBlock -> Int
$csizeOf :: VirtualBlock -> Int
Storable, VirtualBlock
forall a. a -> Zero a
zero :: VirtualBlock
$czero :: VirtualBlock
Zero)
deriving anyclass (Eq VirtualBlock
Zero VirtualBlock
forall a. Eq a -> Zero a -> IsHandle a
IsHandle)
instance Show VirtualBlock where
showsPrec :: Int -> VirtualBlock -> ShowS
showsPrec Int
p (VirtualBlock "offset" ::: DeviceSize
x) = Bool -> ShowS -> ShowS
showParen (Int
p forall a. Ord a => a -> a -> Bool
>= Int
11) (String -> ShowS
showString String
"VirtualBlock 0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex "offset" ::: DeviceSize
x)
type FN_vmaAllocateDeviceMemoryFunction = Allocator -> ("memoryType" ::: Word32) -> DeviceMemory -> DeviceSize -> ("pUserData" ::: Ptr ()) -> IO ()
type PFN_vmaAllocateDeviceMemoryFunction = FunPtr FN_vmaAllocateDeviceMemoryFunction
type FN_vmaFreeDeviceMemoryFunction = Allocator -> ("memoryType" ::: Word32) -> DeviceMemory -> DeviceSize -> ("pUserData" ::: Ptr ()) -> IO ()
type PFN_vmaFreeDeviceMemoryFunction = FunPtr FN_vmaFreeDeviceMemoryFunction
data DeviceMemoryCallbacks = DeviceMemoryCallbacks
{
DeviceMemoryCallbacks -> PFN_vmaAllocateDeviceMemoryFunction
pfnAllocate :: PFN_vmaAllocateDeviceMemoryFunction
,
DeviceMemoryCallbacks -> PFN_vmaAllocateDeviceMemoryFunction
pfnFree :: PFN_vmaFreeDeviceMemoryFunction
,
DeviceMemoryCallbacks -> "userData" ::: Ptr ()
userData :: Ptr ()
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DeviceMemoryCallbacks)
#endif
deriving instance Show DeviceMemoryCallbacks
instance ToCStruct DeviceMemoryCallbacks where
withCStruct :: forall b.
DeviceMemoryCallbacks
-> (Ptr DeviceMemoryCallbacks -> IO b) -> IO b
withCStruct DeviceMemoryCallbacks
x Ptr DeviceMemoryCallbacks -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr DeviceMemoryCallbacks
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceMemoryCallbacks
p DeviceMemoryCallbacks
x (Ptr DeviceMemoryCallbacks -> IO b
f Ptr DeviceMemoryCallbacks
p)
pokeCStruct :: forall b.
Ptr DeviceMemoryCallbacks -> DeviceMemoryCallbacks -> IO b -> IO b
pokeCStruct Ptr DeviceMemoryCallbacks
p DeviceMemoryCallbacks{"userData" ::: Ptr ()
PFN_vmaAllocateDeviceMemoryFunction
userData :: "userData" ::: Ptr ()
pfnFree :: PFN_vmaAllocateDeviceMemoryFunction
pfnAllocate :: PFN_vmaAllocateDeviceMemoryFunction
$sel:userData:DeviceMemoryCallbacks :: DeviceMemoryCallbacks -> "userData" ::: Ptr ()
$sel:pfnFree:DeviceMemoryCallbacks :: DeviceMemoryCallbacks -> PFN_vmaAllocateDeviceMemoryFunction
$sel:pfnAllocate:DeviceMemoryCallbacks :: DeviceMemoryCallbacks -> PFN_vmaAllocateDeviceMemoryFunction
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceMemoryCallbacks
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr PFN_vmaAllocateDeviceMemoryFunction)) (PFN_vmaAllocateDeviceMemoryFunction
pfnAllocate)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceMemoryCallbacks
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr PFN_vmaFreeDeviceMemoryFunction)) (PFN_vmaAllocateDeviceMemoryFunction
pfnFree)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceMemoryCallbacks
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr ()))) ("userData" ::: Ptr ()
userData)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr DeviceMemoryCallbacks -> IO b -> IO b
pokeZeroCStruct Ptr DeviceMemoryCallbacks
_ IO b
f = IO b
f
instance FromCStruct DeviceMemoryCallbacks where
peekCStruct :: Ptr DeviceMemoryCallbacks -> IO DeviceMemoryCallbacks
peekCStruct Ptr DeviceMemoryCallbacks
p = do
PFN_vmaAllocateDeviceMemoryFunction
pfnAllocate <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vmaAllocateDeviceMemoryFunction ((Ptr DeviceMemoryCallbacks
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr PFN_vmaAllocateDeviceMemoryFunction))
PFN_vmaAllocateDeviceMemoryFunction
pfnFree <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vmaFreeDeviceMemoryFunction ((Ptr DeviceMemoryCallbacks
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr PFN_vmaFreeDeviceMemoryFunction))
"userData" ::: Ptr ()
pUserData <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr DeviceMemoryCallbacks
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr ())))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ PFN_vmaAllocateDeviceMemoryFunction
-> PFN_vmaAllocateDeviceMemoryFunction
-> ("userData" ::: Ptr ())
-> DeviceMemoryCallbacks
DeviceMemoryCallbacks
PFN_vmaAllocateDeviceMemoryFunction
pfnAllocate PFN_vmaAllocateDeviceMemoryFunction
pfnFree "userData" ::: Ptr ()
pUserData
instance Storable DeviceMemoryCallbacks where
sizeOf :: DeviceMemoryCallbacks -> Int
sizeOf ~DeviceMemoryCallbacks
_ = Int
24
alignment :: DeviceMemoryCallbacks -> Int
alignment ~DeviceMemoryCallbacks
_ = Int
8
peek :: Ptr DeviceMemoryCallbacks -> IO DeviceMemoryCallbacks
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr DeviceMemoryCallbacks -> DeviceMemoryCallbacks -> IO ()
poke Ptr DeviceMemoryCallbacks
ptr DeviceMemoryCallbacks
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceMemoryCallbacks
ptr DeviceMemoryCallbacks
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero DeviceMemoryCallbacks where
zero :: DeviceMemoryCallbacks
zero = PFN_vmaAllocateDeviceMemoryFunction
-> PFN_vmaAllocateDeviceMemoryFunction
-> ("userData" ::: Ptr ())
-> DeviceMemoryCallbacks
DeviceMemoryCallbacks
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data VulkanFunctions = VulkanFunctions
{
VulkanFunctions -> PFN_vkGetInstanceProcAddr
vkGetInstanceProcAddr :: PFN_vkGetInstanceProcAddr
,
VulkanFunctions -> PFN_vkGetDeviceProcAddr
vkGetDeviceProcAddr :: PFN_vkGetDeviceProcAddr
,
VulkanFunctions -> PFN_vkGetPhysicalDeviceProperties
vkGetPhysicalDeviceProperties :: PFN_vkGetPhysicalDeviceProperties
,
VulkanFunctions -> PFN_vkGetPhysicalDeviceMemoryProperties
vkGetPhysicalDeviceMemoryProperties :: PFN_vkGetPhysicalDeviceMemoryProperties
,
VulkanFunctions -> PFN_vkAllocateMemory
vkAllocateMemory :: PFN_vkAllocateMemory
,
VulkanFunctions -> PFN_vkFreeMemory
vkFreeMemory :: PFN_vkFreeMemory
,
VulkanFunctions -> PFN_vkMapMemory
vkMapMemory :: PFN_vkMapMemory
,
VulkanFunctions -> PFN_vkUnmapMemory
vkUnmapMemory :: PFN_vkUnmapMemory
,
VulkanFunctions -> PFN_vkFlushMappedMemoryRanges
vkFlushMappedMemoryRanges :: PFN_vkFlushMappedMemoryRanges
,
VulkanFunctions -> PFN_vkFlushMappedMemoryRanges
vkInvalidateMappedMemoryRanges :: PFN_vkInvalidateMappedMemoryRanges
,
VulkanFunctions -> PFN_vkBindBufferMemory
vkBindBufferMemory :: PFN_vkBindBufferMemory
,
VulkanFunctions -> PFN_vkBindImageMemory
vkBindImageMemory :: PFN_vkBindImageMemory
,
VulkanFunctions -> PFN_vkGetBufferMemoryRequirements
vkGetBufferMemoryRequirements :: PFN_vkGetBufferMemoryRequirements
,
VulkanFunctions -> PFN_vkGetImageMemoryRequirements
vkGetImageMemoryRequirements :: PFN_vkGetImageMemoryRequirements
,
VulkanFunctions -> PFN_vkCreateBuffer
vkCreateBuffer :: PFN_vkCreateBuffer
,
VulkanFunctions -> PFN_vkDestroyBuffer
vkDestroyBuffer :: PFN_vkDestroyBuffer
,
VulkanFunctions -> PFN_vkCreateImage
vkCreateImage :: PFN_vkCreateImage
,
VulkanFunctions -> PFN_vkDestroyImage
vkDestroyImage :: PFN_vkDestroyImage
,
VulkanFunctions -> PFN_vkCmdCopyBuffer
vkCmdCopyBuffer :: PFN_vkCmdCopyBuffer
,
VulkanFunctions -> PFN_vkGetBufferMemoryRequirements2KHR
vkGetBufferMemoryRequirements2KHR :: PFN_vkGetBufferMemoryRequirements2KHR
,
VulkanFunctions -> PFN_vkGetImageMemoryRequirements2KHR
vkGetImageMemoryRequirements2KHR :: PFN_vkGetImageMemoryRequirements2KHR
,
VulkanFunctions -> PFN_vkBindBufferMemory2KHR
vkBindBufferMemory2KHR :: PFN_vkBindBufferMemory2KHR
,
VulkanFunctions -> PFN_vkBindImageMemory2KHR
vkBindImageMemory2KHR :: PFN_vkBindImageMemory2KHR
,
VulkanFunctions -> PFN_vkGetPhysicalDeviceMemoryProperties2KHR
vkGetPhysicalDeviceMemoryProperties2KHR :: PFN_vkGetPhysicalDeviceMemoryProperties2KHR
,
VulkanFunctions -> PFN_vkGetDeviceBufferMemoryRequirements
vkGetDeviceBufferMemoryRequirements :: PFN_vkGetDeviceBufferMemoryRequirements
,
VulkanFunctions -> PFN_vkGetDeviceImageMemoryRequirements
vkGetDeviceImageMemoryRequirements :: PFN_vkGetDeviceImageMemoryRequirements
}
deriving (Typeable, VulkanFunctions -> VulkanFunctions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VulkanFunctions -> VulkanFunctions -> Bool
$c/= :: VulkanFunctions -> VulkanFunctions -> Bool
== :: VulkanFunctions -> VulkanFunctions -> Bool
$c== :: VulkanFunctions -> VulkanFunctions -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (VulkanFunctions)
#endif
deriving instance Show VulkanFunctions
instance ToCStruct VulkanFunctions where
withCStruct :: forall b. VulkanFunctions -> (Ptr VulkanFunctions -> IO b) -> IO b
withCStruct VulkanFunctions
x Ptr VulkanFunctions -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
208 forall a b. (a -> b) -> a -> b
$ \Ptr VulkanFunctions
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr VulkanFunctions
p VulkanFunctions
x (Ptr VulkanFunctions -> IO b
f Ptr VulkanFunctions
p)
pokeCStruct :: forall b. Ptr VulkanFunctions -> VulkanFunctions -> IO b -> IO b
pokeCStruct Ptr VulkanFunctions
p VulkanFunctions{PFN_vkCmdCopyBuffer
PFN_vkBindBufferMemory2KHR
PFN_vkBindImageMemory2KHR
PFN_vkFlushMappedMemoryRanges
PFN_vkGetDeviceProcAddr
PFN_vkGetImageMemoryRequirements2KHR
PFN_vkAllocateMemory
PFN_vkCreateImage
PFN_vkCreateBuffer
PFN_vkGetDeviceBufferMemoryRequirements
PFN_vkGetDeviceImageMemoryRequirements
PFN_vkGetBufferMemoryRequirements2KHR
PFN_vkGetBufferMemoryRequirements
PFN_vkDestroyBuffer
PFN_vkBindBufferMemory
PFN_vkUnmapMemory
PFN_vkMapMemory
PFN_vkFreeMemory
PFN_vkGetImageMemoryRequirements
PFN_vkDestroyImage
PFN_vkBindImageMemory
PFN_vkGetInstanceProcAddr
PFN_vkGetPhysicalDeviceMemoryProperties2KHR
PFN_vkGetPhysicalDeviceMemoryProperties
PFN_vkGetPhysicalDeviceProperties
vkGetDeviceImageMemoryRequirements :: PFN_vkGetDeviceImageMemoryRequirements
vkGetDeviceBufferMemoryRequirements :: PFN_vkGetDeviceBufferMemoryRequirements
vkGetPhysicalDeviceMemoryProperties2KHR :: PFN_vkGetPhysicalDeviceMemoryProperties2KHR
vkBindImageMemory2KHR :: PFN_vkBindImageMemory2KHR
vkBindBufferMemory2KHR :: PFN_vkBindBufferMemory2KHR
vkGetImageMemoryRequirements2KHR :: PFN_vkGetImageMemoryRequirements2KHR
vkGetBufferMemoryRequirements2KHR :: PFN_vkGetBufferMemoryRequirements2KHR
vkCmdCopyBuffer :: PFN_vkCmdCopyBuffer
vkDestroyImage :: PFN_vkDestroyImage
vkCreateImage :: PFN_vkCreateImage
vkDestroyBuffer :: PFN_vkDestroyBuffer
vkCreateBuffer :: PFN_vkCreateBuffer
vkGetImageMemoryRequirements :: PFN_vkGetImageMemoryRequirements
vkGetBufferMemoryRequirements :: PFN_vkGetBufferMemoryRequirements
vkBindImageMemory :: PFN_vkBindImageMemory
vkBindBufferMemory :: PFN_vkBindBufferMemory
vkInvalidateMappedMemoryRanges :: PFN_vkFlushMappedMemoryRanges
vkFlushMappedMemoryRanges :: PFN_vkFlushMappedMemoryRanges
vkUnmapMemory :: PFN_vkUnmapMemory
vkMapMemory :: PFN_vkMapMemory
vkFreeMemory :: PFN_vkFreeMemory
vkAllocateMemory :: PFN_vkAllocateMemory
vkGetPhysicalDeviceMemoryProperties :: PFN_vkGetPhysicalDeviceMemoryProperties
vkGetPhysicalDeviceProperties :: PFN_vkGetPhysicalDeviceProperties
vkGetDeviceProcAddr :: PFN_vkGetDeviceProcAddr
vkGetInstanceProcAddr :: PFN_vkGetInstanceProcAddr
$sel:vkGetDeviceImageMemoryRequirements:VulkanFunctions :: VulkanFunctions -> PFN_vkGetDeviceImageMemoryRequirements
$sel:vkGetDeviceBufferMemoryRequirements:VulkanFunctions :: VulkanFunctions -> PFN_vkGetDeviceBufferMemoryRequirements
$sel:vkGetPhysicalDeviceMemoryProperties2KHR:VulkanFunctions :: VulkanFunctions -> PFN_vkGetPhysicalDeviceMemoryProperties2KHR
$sel:vkBindImageMemory2KHR:VulkanFunctions :: VulkanFunctions -> PFN_vkBindImageMemory2KHR
$sel:vkBindBufferMemory2KHR:VulkanFunctions :: VulkanFunctions -> PFN_vkBindBufferMemory2KHR
$sel:vkGetImageMemoryRequirements2KHR:VulkanFunctions :: VulkanFunctions -> PFN_vkGetImageMemoryRequirements2KHR
$sel:vkGetBufferMemoryRequirements2KHR:VulkanFunctions :: VulkanFunctions -> PFN_vkGetBufferMemoryRequirements2KHR
$sel:vkCmdCopyBuffer:VulkanFunctions :: VulkanFunctions -> PFN_vkCmdCopyBuffer
$sel:vkDestroyImage:VulkanFunctions :: VulkanFunctions -> PFN_vkDestroyImage
$sel:vkCreateImage:VulkanFunctions :: VulkanFunctions -> PFN_vkCreateImage
$sel:vkDestroyBuffer:VulkanFunctions :: VulkanFunctions -> PFN_vkDestroyBuffer
$sel:vkCreateBuffer:VulkanFunctions :: VulkanFunctions -> PFN_vkCreateBuffer
$sel:vkGetImageMemoryRequirements:VulkanFunctions :: VulkanFunctions -> PFN_vkGetImageMemoryRequirements
$sel:vkGetBufferMemoryRequirements:VulkanFunctions :: VulkanFunctions -> PFN_vkGetBufferMemoryRequirements
$sel:vkBindImageMemory:VulkanFunctions :: VulkanFunctions -> PFN_vkBindImageMemory
$sel:vkBindBufferMemory:VulkanFunctions :: VulkanFunctions -> PFN_vkBindBufferMemory
$sel:vkInvalidateMappedMemoryRanges:VulkanFunctions :: VulkanFunctions -> PFN_vkFlushMappedMemoryRanges
$sel:vkFlushMappedMemoryRanges:VulkanFunctions :: VulkanFunctions -> PFN_vkFlushMappedMemoryRanges
$sel:vkUnmapMemory:VulkanFunctions :: VulkanFunctions -> PFN_vkUnmapMemory
$sel:vkMapMemory:VulkanFunctions :: VulkanFunctions -> PFN_vkMapMemory
$sel:vkFreeMemory:VulkanFunctions :: VulkanFunctions -> PFN_vkFreeMemory
$sel:vkAllocateMemory:VulkanFunctions :: VulkanFunctions -> PFN_vkAllocateMemory
$sel:vkGetPhysicalDeviceMemoryProperties:VulkanFunctions :: VulkanFunctions -> PFN_vkGetPhysicalDeviceMemoryProperties
$sel:vkGetPhysicalDeviceProperties:VulkanFunctions :: VulkanFunctions -> PFN_vkGetPhysicalDeviceProperties
$sel:vkGetDeviceProcAddr:VulkanFunctions :: VulkanFunctions -> PFN_vkGetDeviceProcAddr
$sel:vkGetInstanceProcAddr:VulkanFunctions :: VulkanFunctions -> PFN_vkGetInstanceProcAddr
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr PFN_vkGetInstanceProcAddr)) (PFN_vkGetInstanceProcAddr
vkGetInstanceProcAddr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr PFN_vkGetDeviceProcAddr)) (PFN_vkGetDeviceProcAddr
vkGetDeviceProcAddr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PFN_vkGetPhysicalDeviceProperties)) (PFN_vkGetPhysicalDeviceProperties
vkGetPhysicalDeviceProperties)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr PFN_vkGetPhysicalDeviceMemoryProperties)) (PFN_vkGetPhysicalDeviceMemoryProperties
vkGetPhysicalDeviceMemoryProperties)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr PFN_vkAllocateMemory)) (PFN_vkAllocateMemory
vkAllocateMemory)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr PFN_vkFreeMemory)) (PFN_vkFreeMemory
vkFreeMemory)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr PFN_vkMapMemory)) (PFN_vkMapMemory
vkMapMemory)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr PFN_vkUnmapMemory)) (PFN_vkUnmapMemory
vkUnmapMemory)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr PFN_vkFlushMappedMemoryRanges)) (PFN_vkFlushMappedMemoryRanges
vkFlushMappedMemoryRanges)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr PFN_vkInvalidateMappedMemoryRanges)) (PFN_vkFlushMappedMemoryRanges
vkInvalidateMappedMemoryRanges)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr PFN_vkBindBufferMemory)) (PFN_vkBindBufferMemory
vkBindBufferMemory)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr PFN_vkBindImageMemory)) (PFN_vkBindImageMemory
vkBindImageMemory)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr PFN_vkGetBufferMemoryRequirements)) (PFN_vkGetBufferMemoryRequirements
vkGetBufferMemoryRequirements)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
104 :: Ptr PFN_vkGetImageMemoryRequirements)) (PFN_vkGetImageMemoryRequirements
vkGetImageMemoryRequirements)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
112 :: Ptr PFN_vkCreateBuffer)) (PFN_vkCreateBuffer
vkCreateBuffer)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
120 :: Ptr PFN_vkDestroyBuffer)) (PFN_vkDestroyBuffer
vkDestroyBuffer)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
128 :: Ptr PFN_vkCreateImage)) (PFN_vkCreateImage
vkCreateImage)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
136 :: Ptr PFN_vkDestroyImage)) (PFN_vkDestroyImage
vkDestroyImage)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
144 :: Ptr PFN_vkCmdCopyBuffer)) (PFN_vkCmdCopyBuffer
vkCmdCopyBuffer)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
152 :: Ptr PFN_vkGetBufferMemoryRequirements2KHR)) (PFN_vkGetBufferMemoryRequirements2KHR
vkGetBufferMemoryRequirements2KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
160 :: Ptr PFN_vkGetImageMemoryRequirements2KHR)) (PFN_vkGetImageMemoryRequirements2KHR
vkGetImageMemoryRequirements2KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
168 :: Ptr PFN_vkBindBufferMemory2KHR)) (PFN_vkBindBufferMemory2KHR
vkBindBufferMemory2KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
176 :: Ptr PFN_vkBindImageMemory2KHR)) (PFN_vkBindImageMemory2KHR
vkBindImageMemory2KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
184 :: Ptr PFN_vkGetPhysicalDeviceMemoryProperties2KHR)) (PFN_vkGetPhysicalDeviceMemoryProperties2KHR
vkGetPhysicalDeviceMemoryProperties2KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
192 :: Ptr PFN_vkGetDeviceBufferMemoryRequirements)) (PFN_vkGetDeviceBufferMemoryRequirements
vkGetDeviceBufferMemoryRequirements)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
200 :: Ptr PFN_vkGetDeviceImageMemoryRequirements)) (PFN_vkGetDeviceImageMemoryRequirements
vkGetDeviceImageMemoryRequirements)
IO b
f
cStructSize :: Int
cStructSize = Int
208
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr VulkanFunctions -> IO b -> IO b
pokeZeroCStruct Ptr VulkanFunctions
_ IO b
f = IO b
f
instance FromCStruct VulkanFunctions where
peekCStruct :: Ptr VulkanFunctions -> IO VulkanFunctions
peekCStruct Ptr VulkanFunctions
p = do
PFN_vkGetInstanceProcAddr
vkGetInstanceProcAddr <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkGetInstanceProcAddr ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr PFN_vkGetInstanceProcAddr))
PFN_vkGetDeviceProcAddr
vkGetDeviceProcAddr <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkGetDeviceProcAddr ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr PFN_vkGetDeviceProcAddr))
PFN_vkGetPhysicalDeviceProperties
vkGetPhysicalDeviceProperties <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkGetPhysicalDeviceProperties ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PFN_vkGetPhysicalDeviceProperties))
PFN_vkGetPhysicalDeviceMemoryProperties
vkGetPhysicalDeviceMemoryProperties <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkGetPhysicalDeviceMemoryProperties ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr PFN_vkGetPhysicalDeviceMemoryProperties))
PFN_vkAllocateMemory
vkAllocateMemory <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkAllocateMemory ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr PFN_vkAllocateMemory))
PFN_vkFreeMemory
vkFreeMemory <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkFreeMemory ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr PFN_vkFreeMemory))
PFN_vkMapMemory
vkMapMemory <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkMapMemory ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr PFN_vkMapMemory))
PFN_vkUnmapMemory
vkUnmapMemory <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkUnmapMemory ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr PFN_vkUnmapMemory))
PFN_vkFlushMappedMemoryRanges
vkFlushMappedMemoryRanges <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkFlushMappedMemoryRanges ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr PFN_vkFlushMappedMemoryRanges))
PFN_vkFlushMappedMemoryRanges
vkInvalidateMappedMemoryRanges <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkInvalidateMappedMemoryRanges ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr PFN_vkInvalidateMappedMemoryRanges))
PFN_vkBindBufferMemory
vkBindBufferMemory <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkBindBufferMemory ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr PFN_vkBindBufferMemory))
PFN_vkBindImageMemory
vkBindImageMemory <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkBindImageMemory ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr PFN_vkBindImageMemory))
PFN_vkGetBufferMemoryRequirements
vkGetBufferMemoryRequirements <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkGetBufferMemoryRequirements ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr PFN_vkGetBufferMemoryRequirements))
PFN_vkGetImageMemoryRequirements
vkGetImageMemoryRequirements <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkGetImageMemoryRequirements ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
104 :: Ptr PFN_vkGetImageMemoryRequirements))
PFN_vkCreateBuffer
vkCreateBuffer <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkCreateBuffer ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
112 :: Ptr PFN_vkCreateBuffer))
PFN_vkDestroyBuffer
vkDestroyBuffer <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkDestroyBuffer ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
120 :: Ptr PFN_vkDestroyBuffer))
PFN_vkCreateImage
vkCreateImage <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkCreateImage ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
128 :: Ptr PFN_vkCreateImage))
PFN_vkDestroyImage
vkDestroyImage <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkDestroyImage ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
136 :: Ptr PFN_vkDestroyImage))
PFN_vkCmdCopyBuffer
vkCmdCopyBuffer <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkCmdCopyBuffer ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
144 :: Ptr PFN_vkCmdCopyBuffer))
PFN_vkGetBufferMemoryRequirements2KHR
vkGetBufferMemoryRequirements2KHR <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkGetBufferMemoryRequirements2KHR ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
152 :: Ptr PFN_vkGetBufferMemoryRequirements2KHR))
PFN_vkGetImageMemoryRequirements2KHR
vkGetImageMemoryRequirements2KHR <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkGetImageMemoryRequirements2KHR ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
160 :: Ptr PFN_vkGetImageMemoryRequirements2KHR))
PFN_vkBindBufferMemory2KHR
vkBindBufferMemory2KHR <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkBindBufferMemory2KHR ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
168 :: Ptr PFN_vkBindBufferMemory2KHR))
PFN_vkBindImageMemory2KHR
vkBindImageMemory2KHR <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkBindImageMemory2KHR ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
176 :: Ptr PFN_vkBindImageMemory2KHR))
PFN_vkGetPhysicalDeviceMemoryProperties2KHR
vkGetPhysicalDeviceMemoryProperties2KHR <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkGetPhysicalDeviceMemoryProperties2KHR ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
184 :: Ptr PFN_vkGetPhysicalDeviceMemoryProperties2KHR))
PFN_vkGetDeviceBufferMemoryRequirements
vkGetDeviceBufferMemoryRequirements <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkGetDeviceBufferMemoryRequirements ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
192 :: Ptr PFN_vkGetDeviceBufferMemoryRequirements))
PFN_vkGetDeviceImageMemoryRequirements
vkGetDeviceImageMemoryRequirements <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vkGetDeviceImageMemoryRequirements ((Ptr VulkanFunctions
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
200 :: Ptr PFN_vkGetDeviceImageMemoryRequirements))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ PFN_vkGetInstanceProcAddr
-> PFN_vkGetDeviceProcAddr
-> PFN_vkGetPhysicalDeviceProperties
-> PFN_vkGetPhysicalDeviceMemoryProperties
-> PFN_vkAllocateMemory
-> PFN_vkFreeMemory
-> PFN_vkMapMemory
-> PFN_vkUnmapMemory
-> PFN_vkFlushMappedMemoryRanges
-> PFN_vkFlushMappedMemoryRanges
-> PFN_vkBindBufferMemory
-> PFN_vkBindImageMemory
-> PFN_vkGetBufferMemoryRequirements
-> PFN_vkGetImageMemoryRequirements
-> PFN_vkCreateBuffer
-> PFN_vkDestroyBuffer
-> PFN_vkCreateImage
-> PFN_vkDestroyImage
-> PFN_vkCmdCopyBuffer
-> PFN_vkGetBufferMemoryRequirements2KHR
-> PFN_vkGetImageMemoryRequirements2KHR
-> PFN_vkBindBufferMemory2KHR
-> PFN_vkBindImageMemory2KHR
-> PFN_vkGetPhysicalDeviceMemoryProperties2KHR
-> PFN_vkGetDeviceBufferMemoryRequirements
-> PFN_vkGetDeviceImageMemoryRequirements
-> VulkanFunctions
VulkanFunctions
PFN_vkGetInstanceProcAddr
vkGetInstanceProcAddr
PFN_vkGetDeviceProcAddr
vkGetDeviceProcAddr
PFN_vkGetPhysicalDeviceProperties
vkGetPhysicalDeviceProperties
PFN_vkGetPhysicalDeviceMemoryProperties
vkGetPhysicalDeviceMemoryProperties
PFN_vkAllocateMemory
vkAllocateMemory
PFN_vkFreeMemory
vkFreeMemory
PFN_vkMapMemory
vkMapMemory
PFN_vkUnmapMemory
vkUnmapMemory
PFN_vkFlushMappedMemoryRanges
vkFlushMappedMemoryRanges
PFN_vkFlushMappedMemoryRanges
vkInvalidateMappedMemoryRanges
PFN_vkBindBufferMemory
vkBindBufferMemory
PFN_vkBindImageMemory
vkBindImageMemory
PFN_vkGetBufferMemoryRequirements
vkGetBufferMemoryRequirements
PFN_vkGetImageMemoryRequirements
vkGetImageMemoryRequirements
PFN_vkCreateBuffer
vkCreateBuffer
PFN_vkDestroyBuffer
vkDestroyBuffer
PFN_vkCreateImage
vkCreateImage
PFN_vkDestroyImage
vkDestroyImage
PFN_vkCmdCopyBuffer
vkCmdCopyBuffer
PFN_vkGetBufferMemoryRequirements2KHR
vkGetBufferMemoryRequirements2KHR
PFN_vkGetImageMemoryRequirements2KHR
vkGetImageMemoryRequirements2KHR
PFN_vkBindBufferMemory2KHR
vkBindBufferMemory2KHR
PFN_vkBindImageMemory2KHR
vkBindImageMemory2KHR
PFN_vkGetPhysicalDeviceMemoryProperties2KHR
vkGetPhysicalDeviceMemoryProperties2KHR
PFN_vkGetDeviceBufferMemoryRequirements
vkGetDeviceBufferMemoryRequirements
PFN_vkGetDeviceImageMemoryRequirements
vkGetDeviceImageMemoryRequirements
instance Storable VulkanFunctions where
sizeOf :: VulkanFunctions -> Int
sizeOf ~VulkanFunctions
_ = Int
208
alignment :: VulkanFunctions -> Int
alignment ~VulkanFunctions
_ = Int
8
peek :: Ptr VulkanFunctions -> IO VulkanFunctions
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr VulkanFunctions -> VulkanFunctions -> IO ()
poke Ptr VulkanFunctions
ptr VulkanFunctions
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr VulkanFunctions
ptr VulkanFunctions
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero VulkanFunctions where
zero :: VulkanFunctions
zero = PFN_vkGetInstanceProcAddr
-> PFN_vkGetDeviceProcAddr
-> PFN_vkGetPhysicalDeviceProperties
-> PFN_vkGetPhysicalDeviceMemoryProperties
-> PFN_vkAllocateMemory
-> PFN_vkFreeMemory
-> PFN_vkMapMemory
-> PFN_vkUnmapMemory
-> PFN_vkFlushMappedMemoryRanges
-> PFN_vkFlushMappedMemoryRanges
-> PFN_vkBindBufferMemory
-> PFN_vkBindImageMemory
-> PFN_vkGetBufferMemoryRequirements
-> PFN_vkGetImageMemoryRequirements
-> PFN_vkCreateBuffer
-> PFN_vkDestroyBuffer
-> PFN_vkCreateImage
-> PFN_vkDestroyImage
-> PFN_vkCmdCopyBuffer
-> PFN_vkGetBufferMemoryRequirements2KHR
-> PFN_vkGetImageMemoryRequirements2KHR
-> PFN_vkBindBufferMemory2KHR
-> PFN_vkBindImageMemory2KHR
-> PFN_vkGetPhysicalDeviceMemoryProperties2KHR
-> PFN_vkGetDeviceBufferMemoryRequirements
-> PFN_vkGetDeviceImageMemoryRequirements
-> VulkanFunctions
VulkanFunctions
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data AllocatorCreateInfo = AllocatorCreateInfo
{
AllocatorCreateInfo -> AllocatorCreateFlagBits
flags :: AllocatorCreateFlags
,
AllocatorCreateInfo -> Ptr PhysicalDevice_T
physicalDevice :: Ptr PhysicalDevice_T
,
AllocatorCreateInfo -> Ptr Device_T
device :: Ptr Device_T
,
AllocatorCreateInfo -> "offset" ::: DeviceSize
preferredLargeHeapBlockSize :: DeviceSize
,
AllocatorCreateInfo -> Maybe AllocationCallbacks
allocationCallbacks :: Maybe AllocationCallbacks
,
AllocatorCreateInfo -> Maybe DeviceMemoryCallbacks
deviceMemoryCallbacks :: Maybe DeviceMemoryCallbacks
,
AllocatorCreateInfo -> Ptr ("offset" ::: DeviceSize)
heapSizeLimit :: Ptr DeviceSize
,
AllocatorCreateInfo -> Maybe VulkanFunctions
vulkanFunctions :: Maybe VulkanFunctions
,
AllocatorCreateInfo -> Ptr Instance_T
instance' :: Ptr Instance_T
,
AllocatorCreateInfo -> Flags
vulkanApiVersion :: Word32
,
AllocatorCreateInfo -> Ptr ExternalMemoryHandleTypeFlagsKHR
typeExternalMemoryHandleTypes :: Ptr ExternalMemoryHandleTypeFlagsKHR
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AllocatorCreateInfo)
#endif
deriving instance Show AllocatorCreateInfo
instance ToCStruct AllocatorCreateInfo where
withCStruct :: forall b.
AllocatorCreateInfo -> (Ptr AllocatorCreateInfo -> IO b) -> IO b
withCStruct AllocatorCreateInfo
x Ptr AllocatorCreateInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
88 forall a b. (a -> b) -> a -> b
$ \Ptr AllocatorCreateInfo
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr AllocatorCreateInfo
p AllocatorCreateInfo
x (Ptr AllocatorCreateInfo -> IO b
f Ptr AllocatorCreateInfo
p)
pokeCStruct :: forall b.
Ptr AllocatorCreateInfo -> AllocatorCreateInfo -> IO b -> IO b
pokeCStruct Ptr AllocatorCreateInfo
p AllocatorCreateInfo{Maybe AllocationCallbacks
Maybe VulkanFunctions
Maybe DeviceMemoryCallbacks
Flags
"offset" ::: DeviceSize
Ptr ("offset" ::: DeviceSize)
Ptr ExternalMemoryHandleTypeFlagsKHR
Ptr Device_T
Ptr Instance_T
Ptr PhysicalDevice_T
AllocatorCreateFlagBits
typeExternalMemoryHandleTypes :: Ptr ExternalMemoryHandleTypeFlagsKHR
vulkanApiVersion :: Flags
instance' :: Ptr Instance_T
vulkanFunctions :: Maybe VulkanFunctions
heapSizeLimit :: Ptr ("offset" ::: DeviceSize)
deviceMemoryCallbacks :: Maybe DeviceMemoryCallbacks
allocationCallbacks :: Maybe AllocationCallbacks
preferredLargeHeapBlockSize :: "offset" ::: DeviceSize
device :: Ptr Device_T
physicalDevice :: Ptr PhysicalDevice_T
flags :: AllocatorCreateFlagBits
$sel:typeExternalMemoryHandleTypes:AllocatorCreateInfo :: AllocatorCreateInfo -> Ptr ExternalMemoryHandleTypeFlagsKHR
$sel:vulkanApiVersion:AllocatorCreateInfo :: AllocatorCreateInfo -> Flags
$sel:instance':AllocatorCreateInfo :: AllocatorCreateInfo -> Ptr Instance_T
$sel:vulkanFunctions:AllocatorCreateInfo :: AllocatorCreateInfo -> Maybe VulkanFunctions
$sel:heapSizeLimit:AllocatorCreateInfo :: AllocatorCreateInfo -> Ptr ("offset" ::: DeviceSize)
$sel:deviceMemoryCallbacks:AllocatorCreateInfo :: AllocatorCreateInfo -> Maybe DeviceMemoryCallbacks
$sel:allocationCallbacks:AllocatorCreateInfo :: AllocatorCreateInfo -> Maybe AllocationCallbacks
$sel:preferredLargeHeapBlockSize:AllocatorCreateInfo :: AllocatorCreateInfo -> "offset" ::: DeviceSize
$sel:device:AllocatorCreateInfo :: AllocatorCreateInfo -> Ptr Device_T
$sel:physicalDevice:AllocatorCreateInfo :: AllocatorCreateInfo -> Ptr PhysicalDevice_T
$sel:flags:AllocatorCreateInfo :: AllocatorCreateInfo -> AllocatorCreateFlagBits
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
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 -> a -> IO ()
poke ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr AllocatorCreateFlags)) (AllocatorCreateFlagBits
flags)
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 -> a -> IO ()
poke ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr PhysicalDevice_T))) (Ptr PhysicalDevice_T
physicalDevice)
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 -> a -> IO ()
poke ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Device_T))) (Ptr Device_T
device)
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 -> a -> IO ()
poke ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
preferredLargeHeapBlockSize)
Ptr AllocationCallbacks
pAllocationCallbacks'' <- case (Maybe AllocationCallbacks
allocationCallbacks) of
Maybe AllocationCallbacks
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
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 -> a -> IO ()
poke ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr AllocationCallbacks))) Ptr AllocationCallbacks
pAllocationCallbacks''
Ptr DeviceMemoryCallbacks
pDeviceMemoryCallbacks'' <- case (Maybe DeviceMemoryCallbacks
deviceMemoryCallbacks) of
Maybe DeviceMemoryCallbacks
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just DeviceMemoryCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (DeviceMemoryCallbacks
j)
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 -> a -> IO ()
poke ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr DeviceMemoryCallbacks))) Ptr DeviceMemoryCallbacks
pDeviceMemoryCallbacks''
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 -> a -> IO ()
poke ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr DeviceSize))) (Ptr ("offset" ::: DeviceSize)
heapSizeLimit)
Ptr VulkanFunctions
pVulkanFunctions'' <- case (Maybe VulkanFunctions
vulkanFunctions) of
Maybe VulkanFunctions
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just VulkanFunctions
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (VulkanFunctions
j)
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 -> a -> IO ()
poke ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr (Ptr VulkanFunctions))) Ptr VulkanFunctions
pVulkanFunctions''
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 -> a -> IO ()
poke ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr (Ptr Instance_T))) (Ptr Instance_T
instance')
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 -> a -> IO ()
poke ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Word32)) (Flags
vulkanApiVersion)
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 -> a -> IO ()
poke ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr (Ptr ExternalMemoryHandleTypeFlagsKHR))) (Ptr ExternalMemoryHandleTypeFlagsKHR
typeExternalMemoryHandleTypes)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
88
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr AllocatorCreateInfo -> IO b -> IO b
pokeZeroCStruct Ptr AllocatorCreateInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr AllocatorCreateFlags)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr PhysicalDevice_T))) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Device_T))) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr (Ptr Instance_T))) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Word32)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct AllocatorCreateInfo where
peekCStruct :: Ptr AllocatorCreateInfo -> IO AllocatorCreateInfo
peekCStruct Ptr AllocatorCreateInfo
p = do
AllocatorCreateFlagBits
flags <- forall a. Storable a => Ptr a -> IO a
peek @AllocatorCreateFlags ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr AllocatorCreateFlags))
Ptr PhysicalDevice_T
physicalDevice <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr PhysicalDevice_T) ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr PhysicalDevice_T)))
Ptr Device_T
device <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Device_T) ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Device_T)))
"offset" ::: DeviceSize
preferredLargeHeapBlockSize <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize))
Ptr AllocationCallbacks
pAllocationCallbacks <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr AllocationCallbacks) ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr AllocationCallbacks)))
Maybe AllocationCallbacks
pAllocationCallbacks' <- forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr AllocationCallbacks
j -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @AllocationCallbacks (Ptr AllocationCallbacks
j)) Ptr AllocationCallbacks
pAllocationCallbacks
Ptr DeviceMemoryCallbacks
pDeviceMemoryCallbacks <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr DeviceMemoryCallbacks) ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr DeviceMemoryCallbacks)))
Maybe DeviceMemoryCallbacks
pDeviceMemoryCallbacks' <- forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr DeviceMemoryCallbacks
j -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DeviceMemoryCallbacks (Ptr DeviceMemoryCallbacks
j)) Ptr DeviceMemoryCallbacks
pDeviceMemoryCallbacks
Ptr ("offset" ::: DeviceSize)
pHeapSizeLimit <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr DeviceSize) ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr DeviceSize)))
Ptr VulkanFunctions
pVulkanFunctions <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr VulkanFunctions) ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr (Ptr VulkanFunctions)))
Maybe VulkanFunctions
pVulkanFunctions' <- forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr VulkanFunctions
j -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @VulkanFunctions (Ptr VulkanFunctions
j)) Ptr VulkanFunctions
pVulkanFunctions
Ptr Instance_T
instance' <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Instance_T) ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr (Ptr Instance_T)))
Flags
vulkanApiVersion <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Word32))
Ptr ExternalMemoryHandleTypeFlagsKHR
pTypeExternalMemoryHandleTypes <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ExternalMemoryHandleTypeFlagsKHR) ((Ptr AllocatorCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr (Ptr ExternalMemoryHandleTypeFlagsKHR)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ AllocatorCreateFlagBits
-> Ptr PhysicalDevice_T
-> Ptr Device_T
-> ("offset" ::: DeviceSize)
-> Maybe AllocationCallbacks
-> Maybe DeviceMemoryCallbacks
-> Ptr ("offset" ::: DeviceSize)
-> Maybe VulkanFunctions
-> Ptr Instance_T
-> Flags
-> Ptr ExternalMemoryHandleTypeFlagsKHR
-> AllocatorCreateInfo
AllocatorCreateInfo
AllocatorCreateFlagBits
flags
Ptr PhysicalDevice_T
physicalDevice
Ptr Device_T
device
"offset" ::: DeviceSize
preferredLargeHeapBlockSize
Maybe AllocationCallbacks
pAllocationCallbacks'
Maybe DeviceMemoryCallbacks
pDeviceMemoryCallbacks'
Ptr ("offset" ::: DeviceSize)
pHeapSizeLimit
Maybe VulkanFunctions
pVulkanFunctions'
Ptr Instance_T
instance'
Flags
vulkanApiVersion
Ptr ExternalMemoryHandleTypeFlagsKHR
pTypeExternalMemoryHandleTypes
instance Zero AllocatorCreateInfo where
zero :: AllocatorCreateInfo
zero = AllocatorCreateFlagBits
-> Ptr PhysicalDevice_T
-> Ptr Device_T
-> ("offset" ::: DeviceSize)
-> Maybe AllocationCallbacks
-> Maybe DeviceMemoryCallbacks
-> Ptr ("offset" ::: DeviceSize)
-> Maybe VulkanFunctions
-> Ptr Instance_T
-> Flags
-> Ptr ExternalMemoryHandleTypeFlagsKHR
-> AllocatorCreateInfo
AllocatorCreateInfo
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Maybe a
Nothing
forall a. Maybe a
Nothing
forall a. Zero a => a
zero
forall a. Maybe a
Nothing
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data AllocatorInfo = AllocatorInfo
{
AllocatorInfo -> Ptr Instance_T
instance' :: Ptr Instance_T
,
AllocatorInfo -> Ptr PhysicalDevice_T
physicalDevice :: Ptr PhysicalDevice_T
,
AllocatorInfo -> Ptr Device_T
device :: Ptr Device_T
}
deriving (Typeable, AllocatorInfo -> AllocatorInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AllocatorInfo -> AllocatorInfo -> Bool
$c/= :: AllocatorInfo -> AllocatorInfo -> Bool
== :: AllocatorInfo -> AllocatorInfo -> Bool
$c== :: AllocatorInfo -> AllocatorInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AllocatorInfo)
#endif
deriving instance Show AllocatorInfo
instance ToCStruct AllocatorInfo where
withCStruct :: forall b. AllocatorInfo -> (Ptr AllocatorInfo -> IO b) -> IO b
withCStruct AllocatorInfo
x Ptr AllocatorInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr AllocatorInfo
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr AllocatorInfo
p AllocatorInfo
x (Ptr AllocatorInfo -> IO b
f Ptr AllocatorInfo
p)
pokeCStruct :: forall b. Ptr AllocatorInfo -> AllocatorInfo -> IO b -> IO b
pokeCStruct Ptr AllocatorInfo
p AllocatorInfo{Ptr Device_T
Ptr Instance_T
Ptr PhysicalDevice_T
device :: Ptr Device_T
physicalDevice :: Ptr PhysicalDevice_T
instance' :: Ptr Instance_T
$sel:device:AllocatorInfo :: AllocatorInfo -> Ptr Device_T
$sel:physicalDevice:AllocatorInfo :: AllocatorInfo -> Ptr PhysicalDevice_T
$sel:instance':AllocatorInfo :: AllocatorInfo -> Ptr Instance_T
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocatorInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr (Ptr Instance_T))) (Ptr Instance_T
instance')
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocatorInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr PhysicalDevice_T))) (Ptr PhysicalDevice_T
physicalDevice)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocatorInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Device_T))) (Ptr Device_T
device)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr AllocatorInfo -> IO b -> IO b
pokeZeroCStruct Ptr AllocatorInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocatorInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr (Ptr Instance_T))) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocatorInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr PhysicalDevice_T))) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocatorInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Device_T))) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct AllocatorInfo where
peekCStruct :: Ptr AllocatorInfo -> IO AllocatorInfo
peekCStruct Ptr AllocatorInfo
p = do
Ptr Instance_T
instance' <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Instance_T) ((Ptr AllocatorInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr (Ptr Instance_T)))
Ptr PhysicalDevice_T
physicalDevice <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr PhysicalDevice_T) ((Ptr AllocatorInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr PhysicalDevice_T)))
Ptr Device_T
device <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Device_T) ((Ptr AllocatorInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr Device_T)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr Instance_T
-> Ptr PhysicalDevice_T -> Ptr Device_T -> AllocatorInfo
AllocatorInfo
Ptr Instance_T
instance' Ptr PhysicalDevice_T
physicalDevice Ptr Device_T
device
instance Storable AllocatorInfo where
sizeOf :: AllocatorInfo -> Int
sizeOf ~AllocatorInfo
_ = Int
24
alignment :: AllocatorInfo -> Int
alignment ~AllocatorInfo
_ = Int
8
peek :: Ptr AllocatorInfo -> IO AllocatorInfo
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr AllocatorInfo -> AllocatorInfo -> IO ()
poke Ptr AllocatorInfo
ptr AllocatorInfo
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr AllocatorInfo
ptr AllocatorInfo
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero AllocatorInfo where
zero :: AllocatorInfo
zero = Ptr Instance_T
-> Ptr PhysicalDevice_T -> Ptr Device_T -> AllocatorInfo
AllocatorInfo
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data Statistics = Statistics
{
Statistics -> Flags
blockCount :: Word32
,
Statistics -> Flags
allocationCount :: Word32
,
Statistics -> "offset" ::: DeviceSize
blockBytes :: DeviceSize
,
Statistics -> "offset" ::: DeviceSize
allocationBytes :: DeviceSize
}
deriving (Typeable, Statistics -> Statistics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Statistics -> Statistics -> Bool
$c/= :: Statistics -> Statistics -> Bool
== :: Statistics -> Statistics -> Bool
$c== :: Statistics -> Statistics -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (Statistics)
#endif
deriving instance Show Statistics
instance ToCStruct Statistics where
withCStruct :: forall b. Statistics -> (Ptr Statistics -> IO b) -> IO b
withCStruct Statistics
x Ptr Statistics -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr Statistics
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr Statistics
p Statistics
x (Ptr Statistics -> IO b
f Ptr Statistics
p)
pokeCStruct :: forall b. Ptr Statistics -> Statistics -> IO b -> IO b
pokeCStruct Ptr Statistics
p Statistics{Flags
"offset" ::: DeviceSize
allocationBytes :: "offset" ::: DeviceSize
blockBytes :: "offset" ::: DeviceSize
allocationCount :: Flags
blockCount :: Flags
$sel:allocationBytes:Statistics :: Statistics -> "offset" ::: DeviceSize
$sel:blockBytes:Statistics :: Statistics -> "offset" ::: DeviceSize
$sel:allocationCount:Statistics :: Statistics -> Flags
$sel:blockCount:Statistics :: Statistics -> Flags
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Statistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (Flags
blockCount)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Statistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) (Flags
allocationCount)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Statistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
blockBytes)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Statistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
allocationBytes)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr Statistics -> IO b -> IO b
pokeZeroCStruct Ptr Statistics
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Statistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Statistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Statistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr Statistics
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 Statistics where
peekCStruct :: Ptr Statistics -> IO Statistics
peekCStruct Ptr Statistics
p = do
Flags
blockCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr Statistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
Flags
allocationCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr Statistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr Word32))
"offset" ::: DeviceSize
blockBytes <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr Statistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceSize))
"offset" ::: DeviceSize
allocationBytes <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr Statistics
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
$ Flags
-> Flags
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> Statistics
Statistics
Flags
blockCount Flags
allocationCount "offset" ::: DeviceSize
blockBytes "offset" ::: DeviceSize
allocationBytes
instance Storable Statistics where
sizeOf :: Statistics -> Int
sizeOf ~Statistics
_ = Int
24
alignment :: Statistics -> Int
alignment ~Statistics
_ = Int
8
peek :: Ptr Statistics -> IO Statistics
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr Statistics -> Statistics -> IO ()
poke Ptr Statistics
ptr Statistics
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr Statistics
ptr Statistics
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero Statistics where
zero :: Statistics
zero = Flags
-> Flags
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> Statistics
Statistics
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data DetailedStatistics = DetailedStatistics
{
DetailedStatistics -> Statistics
statistics :: Statistics
,
DetailedStatistics -> Flags
unusedRangeCount :: Word32
,
DetailedStatistics -> "offset" ::: DeviceSize
allocationSizeMin :: DeviceSize
,
DetailedStatistics -> "offset" ::: DeviceSize
allocationSizeMax :: DeviceSize
,
DetailedStatistics -> "offset" ::: DeviceSize
unusedRangeSizeMin :: DeviceSize
,
DetailedStatistics -> "offset" ::: DeviceSize
unusedRangeSizeMax :: DeviceSize
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DetailedStatistics)
#endif
deriving instance Show DetailedStatistics
instance ToCStruct DetailedStatistics where
withCStruct :: forall b.
DetailedStatistics -> (Ptr DetailedStatistics -> IO b) -> IO b
withCStruct DetailedStatistics
x Ptr DetailedStatistics -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
64 forall a b. (a -> b) -> a -> b
$ \Ptr DetailedStatistics
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DetailedStatistics
p DetailedStatistics
x (Ptr DetailedStatistics -> IO b
f Ptr DetailedStatistics
p)
pokeCStruct :: forall b.
Ptr DetailedStatistics -> DetailedStatistics -> IO b -> IO b
pokeCStruct Ptr DetailedStatistics
p DetailedStatistics{Flags
"offset" ::: DeviceSize
Statistics
unusedRangeSizeMax :: "offset" ::: DeviceSize
unusedRangeSizeMin :: "offset" ::: DeviceSize
allocationSizeMax :: "offset" ::: DeviceSize
allocationSizeMin :: "offset" ::: DeviceSize
unusedRangeCount :: Flags
statistics :: Statistics
$sel:unusedRangeSizeMax:DetailedStatistics :: DetailedStatistics -> "offset" ::: DeviceSize
$sel:unusedRangeSizeMin:DetailedStatistics :: DetailedStatistics -> "offset" ::: DeviceSize
$sel:allocationSizeMax:DetailedStatistics :: DetailedStatistics -> "offset" ::: DeviceSize
$sel:allocationSizeMin:DetailedStatistics :: DetailedStatistics -> "offset" ::: DeviceSize
$sel:unusedRangeCount:DetailedStatistics :: DetailedStatistics -> Flags
$sel:statistics:DetailedStatistics :: DetailedStatistics -> Statistics
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Statistics)) (Statistics
statistics)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Flags
unusedRangeCount)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
allocationSizeMin)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
allocationSizeMax)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
unusedRangeSizeMin)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
unusedRangeSizeMax)
IO b
f
cStructSize :: Int
cStructSize = Int
64
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr DetailedStatistics -> IO b -> IO b
pokeZeroCStruct Ptr DetailedStatistics
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Statistics)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct DetailedStatistics where
peekCStruct :: Ptr DetailedStatistics -> IO DetailedStatistics
peekCStruct Ptr DetailedStatistics
p = do
Statistics
statistics <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Statistics ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Statistics))
Flags
unusedRangeCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
"offset" ::: DeviceSize
allocationSizeMin <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize))
"offset" ::: DeviceSize
allocationSizeMax <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr DeviceSize))
"offset" ::: DeviceSize
unusedRangeSizeMin <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr DeviceSize))
"offset" ::: DeviceSize
unusedRangeSizeMax <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr DetailedStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr DeviceSize))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Statistics
-> Flags
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> DetailedStatistics
DetailedStatistics
Statistics
statistics
Flags
unusedRangeCount
"offset" ::: DeviceSize
allocationSizeMin
"offset" ::: DeviceSize
allocationSizeMax
"offset" ::: DeviceSize
unusedRangeSizeMin
"offset" ::: DeviceSize
unusedRangeSizeMax
instance Storable DetailedStatistics where
sizeOf :: DetailedStatistics -> Int
sizeOf ~DetailedStatistics
_ = Int
64
alignment :: DetailedStatistics -> Int
alignment ~DetailedStatistics
_ = Int
8
peek :: Ptr DetailedStatistics -> IO DetailedStatistics
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr DetailedStatistics -> DetailedStatistics -> IO ()
poke Ptr DetailedStatistics
ptr DetailedStatistics
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DetailedStatistics
ptr DetailedStatistics
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero DetailedStatistics where
zero :: DetailedStatistics
zero = Statistics
-> Flags
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> DetailedStatistics
DetailedStatistics
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data TotalStatistics = TotalStatistics
{
TotalStatistics -> Vector DetailedStatistics
memoryType :: Vector DetailedStatistics
,
TotalStatistics -> Vector DetailedStatistics
memoryHeap :: Vector DetailedStatistics
,
TotalStatistics -> DetailedStatistics
total :: DetailedStatistics
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (TotalStatistics)
#endif
deriving instance Show TotalStatistics
instance ToCStruct TotalStatistics where
withCStruct :: forall b. TotalStatistics -> (Ptr TotalStatistics -> IO b) -> IO b
withCStruct TotalStatistics
x Ptr TotalStatistics -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
3136 forall a b. (a -> b) -> a -> b
$ \Ptr TotalStatistics
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr TotalStatistics
p TotalStatistics
x (Ptr TotalStatistics -> IO b
f Ptr TotalStatistics
p)
pokeCStruct :: forall b. Ptr TotalStatistics -> TotalStatistics -> IO b -> IO b
pokeCStruct Ptr TotalStatistics
p TotalStatistics{Vector DetailedStatistics
DetailedStatistics
total :: DetailedStatistics
memoryHeap :: Vector DetailedStatistics
memoryType :: Vector DetailedStatistics
$sel:total:TotalStatistics :: TotalStatistics -> DetailedStatistics
$sel:memoryHeap:TotalStatistics :: TotalStatistics -> Vector DetailedStatistics
$sel:memoryType:TotalStatistics :: TotalStatistics -> Vector DetailedStatistics
..} IO b
f = do
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ((forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector DetailedStatistics
memoryType)) forall a. Ord a => a -> a -> Bool
<= forall a. Integral a => a
MAX_MEMORY_TYPES) 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
"memoryType is too long, a maximum of MAX_MEMORY_TYPES elements are allowed" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i DetailedStatistics
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke ((forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr TotalStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr (FixedArray MAX_MEMORY_TYPES DetailedStatistics)))) forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
64 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DetailedStatistics) (DetailedStatistics
e)) (Vector DetailedStatistics
memoryType)
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ((forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector DetailedStatistics
memoryHeap)) forall a. Ord a => a -> a -> Bool
<= forall a. Integral a => a
MAX_MEMORY_HEAPS) 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
"memoryHeap is too long, a maximum of MAX_MEMORY_HEAPS elements are allowed" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i DetailedStatistics
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke ((forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr TotalStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
2048 :: Ptr (FixedArray MAX_MEMORY_HEAPS DetailedStatistics)))) forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
64 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DetailedStatistics) (DetailedStatistics
e)) (Vector DetailedStatistics
memoryHeap)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TotalStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
3072 :: Ptr DetailedStatistics)) (DetailedStatistics
total)
IO b
f
cStructSize :: Int
cStructSize = Int
3136
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr TotalStatistics -> IO b -> IO b
pokeZeroCStruct Ptr TotalStatistics
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TotalStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
3072 :: Ptr DetailedStatistics)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct TotalStatistics where
peekCStruct :: Ptr TotalStatistics -> IO TotalStatistics
peekCStruct Ptr TotalStatistics
p = do
Vector DetailedStatistics
memoryType <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a. Integral a => a
MAX_MEMORY_TYPES) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DetailedStatistics (((forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr @DetailedStatistics ((Ptr TotalStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr (FixedArray MAX_MEMORY_TYPES DetailedStatistics)))) forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
64 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DetailedStatistics)))
Vector DetailedStatistics
memoryHeap <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a. Integral a => a
MAX_MEMORY_HEAPS) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DetailedStatistics (((forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr @DetailedStatistics ((Ptr TotalStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
2048 :: Ptr (FixedArray MAX_MEMORY_HEAPS DetailedStatistics)))) forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
64 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DetailedStatistics)))
DetailedStatistics
total <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @DetailedStatistics ((Ptr TotalStatistics
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
3072 :: Ptr DetailedStatistics))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Vector DetailedStatistics
-> Vector DetailedStatistics
-> DetailedStatistics
-> TotalStatistics
TotalStatistics
Vector DetailedStatistics
memoryType Vector DetailedStatistics
memoryHeap DetailedStatistics
total
instance Storable TotalStatistics where
sizeOf :: TotalStatistics -> Int
sizeOf ~TotalStatistics
_ = Int
3136
alignment :: TotalStatistics -> Int
alignment ~TotalStatistics
_ = Int
8
peek :: Ptr TotalStatistics -> IO TotalStatistics
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr TotalStatistics -> TotalStatistics -> IO ()
poke Ptr TotalStatistics
ptr TotalStatistics
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr TotalStatistics
ptr TotalStatistics
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero TotalStatistics where
zero :: TotalStatistics
zero = Vector DetailedStatistics
-> Vector DetailedStatistics
-> DetailedStatistics
-> TotalStatistics
TotalStatistics
forall a. Monoid a => a
mempty
forall a. Monoid a => a
mempty
forall a. Zero a => a
zero
data Budget = Budget
{
Budget -> Statistics
statistics :: Statistics
,
Budget -> "offset" ::: DeviceSize
usage :: DeviceSize
,
Budget -> "offset" ::: DeviceSize
budget :: DeviceSize
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (Budget)
#endif
deriving instance Show Budget
instance ToCStruct Budget where
withCStruct :: forall b. Budget -> (("budgets" ::: Ptr Budget) -> IO b) -> IO b
withCStruct Budget
x ("budgets" ::: Ptr Budget) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 forall a b. (a -> b) -> a -> b
$ \"budgets" ::: Ptr Budget
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "budgets" ::: Ptr Budget
p Budget
x (("budgets" ::: Ptr Budget) -> IO b
f "budgets" ::: Ptr Budget
p)
pokeCStruct :: forall b. ("budgets" ::: Ptr Budget) -> Budget -> IO b -> IO b
pokeCStruct "budgets" ::: Ptr Budget
p Budget{"offset" ::: DeviceSize
Statistics
budget :: "offset" ::: DeviceSize
usage :: "offset" ::: DeviceSize
statistics :: Statistics
$sel:budget:Budget :: Budget -> "offset" ::: DeviceSize
$sel:usage:Budget :: Budget -> "offset" ::: DeviceSize
$sel:statistics:Budget :: Budget -> Statistics
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("budgets" ::: Ptr Budget
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Statistics)) (Statistics
statistics)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("budgets" ::: Ptr Budget
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
usage)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("budgets" ::: Ptr Budget
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
budget)
IO b
f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. ("budgets" ::: Ptr Budget) -> IO b -> IO b
pokeZeroCStruct "budgets" ::: Ptr Budget
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("budgets" ::: Ptr Budget
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Statistics)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("budgets" ::: Ptr Budget
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("budgets" ::: Ptr Budget
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct Budget where
peekCStruct :: ("budgets" ::: Ptr Budget) -> IO Budget
peekCStruct "budgets" ::: Ptr Budget
p = do
Statistics
statistics <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Statistics (("budgets" ::: Ptr Budget
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Statistics))
"offset" ::: DeviceSize
usage <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize (("budgets" ::: Ptr Budget
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize))
"offset" ::: DeviceSize
budget <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize (("budgets" ::: Ptr Budget
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Statistics
-> ("offset" ::: DeviceSize) -> ("offset" ::: DeviceSize) -> Budget
Budget
Statistics
statistics "offset" ::: DeviceSize
usage "offset" ::: DeviceSize
budget
instance Storable Budget where
sizeOf :: Budget -> Int
sizeOf ~Budget
_ = Int
40
alignment :: Budget -> Int
alignment ~Budget
_ = Int
8
peek :: ("budgets" ::: Ptr Budget) -> IO Budget
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("budgets" ::: Ptr Budget) -> Budget -> IO ()
poke "budgets" ::: Ptr Budget
ptr Budget
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "budgets" ::: Ptr Budget
ptr Budget
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero Budget where
zero :: Budget
zero = Statistics
-> ("offset" ::: DeviceSize) -> ("offset" ::: DeviceSize) -> Budget
Budget
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data AllocationCreateInfo = AllocationCreateInfo
{
AllocationCreateInfo -> AllocationCreateFlagBits
flags :: AllocationCreateFlags
,
AllocationCreateInfo -> MemoryUsage
usage :: MemoryUsage
,
AllocationCreateInfo -> MemoryPropertyFlags
requiredFlags :: MemoryPropertyFlags
,
AllocationCreateInfo -> MemoryPropertyFlags
preferredFlags :: MemoryPropertyFlags
,
AllocationCreateInfo -> Flags
memoryTypeBits :: Word32
,
AllocationCreateInfo -> Pool
pool :: Pool
,
AllocationCreateInfo -> "userData" ::: Ptr ()
userData :: Ptr ()
,
AllocationCreateInfo -> Float
priority :: Float
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AllocationCreateInfo)
#endif
deriving instance Show AllocationCreateInfo
instance ToCStruct AllocationCreateInfo where
withCStruct :: forall b.
AllocationCreateInfo -> (Ptr AllocationCreateInfo -> IO b) -> IO b
withCStruct AllocationCreateInfo
x Ptr AllocationCreateInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 forall a b. (a -> b) -> a -> b
$ \Ptr AllocationCreateInfo
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr AllocationCreateInfo
p AllocationCreateInfo
x (Ptr AllocationCreateInfo -> IO b
f Ptr AllocationCreateInfo
p)
pokeCStruct :: forall b.
Ptr AllocationCreateInfo -> AllocationCreateInfo -> IO b -> IO b
pokeCStruct Ptr AllocationCreateInfo
p AllocationCreateInfo{Float
Flags
"userData" ::: Ptr ()
MemoryPropertyFlags
Pool
AllocationCreateFlagBits
MemoryUsage
priority :: Float
userData :: "userData" ::: Ptr ()
pool :: Pool
memoryTypeBits :: Flags
preferredFlags :: MemoryPropertyFlags
requiredFlags :: MemoryPropertyFlags
usage :: MemoryUsage
flags :: AllocationCreateFlagBits
$sel:priority:AllocationCreateInfo :: AllocationCreateInfo -> Float
$sel:userData:AllocationCreateInfo :: AllocationCreateInfo -> "userData" ::: Ptr ()
$sel:pool:AllocationCreateInfo :: AllocationCreateInfo -> Pool
$sel:memoryTypeBits:AllocationCreateInfo :: AllocationCreateInfo -> Flags
$sel:preferredFlags:AllocationCreateInfo :: AllocationCreateInfo -> MemoryPropertyFlags
$sel:requiredFlags:AllocationCreateInfo :: AllocationCreateInfo -> MemoryPropertyFlags
$sel:usage:AllocationCreateInfo :: AllocationCreateInfo -> MemoryUsage
$sel:flags:AllocationCreateInfo :: AllocationCreateInfo -> AllocationCreateFlagBits
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr AllocationCreateFlags)) (AllocationCreateFlagBits
flags)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr MemoryUsage)) (MemoryUsage
usage)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr MemoryPropertyFlags)) (MemoryPropertyFlags
requiredFlags)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr MemoryPropertyFlags)) (MemoryPropertyFlags
preferredFlags)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Flags
memoryTypeBits)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Pool)) (Pool
pool)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr ()))) ("userData" ::: Ptr ()
userData)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
priority))
IO b
f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr AllocationCreateInfo -> IO b -> IO b
pokeZeroCStruct Ptr AllocationCreateInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr AllocationCreateFlags)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr MemoryUsage)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr MemoryPropertyFlags)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr MemoryPropertyFlags)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr CFloat)) (Float -> CFloat
CFloat (forall a. Zero a => a
zero))
IO b
f
instance FromCStruct AllocationCreateInfo where
peekCStruct :: Ptr AllocationCreateInfo -> IO AllocationCreateInfo
peekCStruct Ptr AllocationCreateInfo
p = do
AllocationCreateFlagBits
flags <- forall a. Storable a => Ptr a -> IO a
peek @AllocationCreateFlags ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr AllocationCreateFlags))
MemoryUsage
usage <- forall a. Storable a => Ptr a -> IO a
peek @MemoryUsage ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr MemoryUsage))
MemoryPropertyFlags
requiredFlags <- forall a. Storable a => Ptr a -> IO a
peek @MemoryPropertyFlags ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr MemoryPropertyFlags))
MemoryPropertyFlags
preferredFlags <- forall a. Storable a => Ptr a -> IO a
peek @MemoryPropertyFlags ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr MemoryPropertyFlags))
Flags
memoryTypeBits <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
Pool
pool <- forall a. Storable a => Ptr a -> IO a
peek @Pool ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Pool))
"userData" ::: Ptr ()
pUserData <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr ())))
CFloat
priority <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr AllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr CFloat))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ AllocationCreateFlagBits
-> MemoryUsage
-> MemoryPropertyFlags
-> MemoryPropertyFlags
-> Flags
-> Pool
-> ("userData" ::: Ptr ())
-> Float
-> AllocationCreateInfo
AllocationCreateInfo
AllocationCreateFlagBits
flags
MemoryUsage
usage
MemoryPropertyFlags
requiredFlags
MemoryPropertyFlags
preferredFlags
Flags
memoryTypeBits
Pool
pool
"userData" ::: Ptr ()
pUserData
(coerce :: forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
priority)
instance Storable AllocationCreateInfo where
sizeOf :: AllocationCreateInfo -> Int
sizeOf ~AllocationCreateInfo
_ = Int
48
alignment :: AllocationCreateInfo -> Int
alignment ~AllocationCreateInfo
_ = Int
8
peek :: Ptr AllocationCreateInfo -> IO AllocationCreateInfo
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr AllocationCreateInfo -> AllocationCreateInfo -> IO ()
poke Ptr AllocationCreateInfo
ptr AllocationCreateInfo
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr AllocationCreateInfo
ptr AllocationCreateInfo
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero AllocationCreateInfo where
zero :: AllocationCreateInfo
zero = AllocationCreateFlagBits
-> MemoryUsage
-> MemoryPropertyFlags
-> MemoryPropertyFlags
-> Flags
-> Pool
-> ("userData" ::: Ptr ())
-> Float
-> AllocationCreateInfo
AllocationCreateInfo
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data PoolCreateInfo = PoolCreateInfo
{
PoolCreateInfo -> Flags
memoryTypeIndex :: Word32
,
PoolCreateInfo -> PoolCreateFlagBits
flags :: PoolCreateFlags
,
PoolCreateInfo -> "offset" ::: DeviceSize
blockSize :: DeviceSize
,
PoolCreateInfo -> "offset" ::: DeviceSize
minBlockCount :: Word64
,
PoolCreateInfo -> "offset" ::: DeviceSize
maxBlockCount :: Word64
,
PoolCreateInfo -> Float
priority :: Float
,
PoolCreateInfo -> "offset" ::: DeviceSize
minAllocationAlignment :: DeviceSize
,
PoolCreateInfo -> "userData" ::: Ptr ()
memoryAllocateNext :: Ptr ()
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PoolCreateInfo)
#endif
deriving instance Show PoolCreateInfo
instance ToCStruct PoolCreateInfo where
withCStruct :: forall b. PoolCreateInfo -> (Ptr PoolCreateInfo -> IO b) -> IO b
withCStruct PoolCreateInfo
x Ptr PoolCreateInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 forall a b. (a -> b) -> a -> b
$ \Ptr PoolCreateInfo
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PoolCreateInfo
p PoolCreateInfo
x (Ptr PoolCreateInfo -> IO b
f Ptr PoolCreateInfo
p)
pokeCStruct :: forall b. Ptr PoolCreateInfo -> PoolCreateInfo -> IO b -> IO b
pokeCStruct Ptr PoolCreateInfo
p PoolCreateInfo{Float
Flags
"offset" ::: DeviceSize
"userData" ::: Ptr ()
PoolCreateFlagBits
memoryAllocateNext :: "userData" ::: Ptr ()
minAllocationAlignment :: "offset" ::: DeviceSize
priority :: Float
maxBlockCount :: "offset" ::: DeviceSize
minBlockCount :: "offset" ::: DeviceSize
blockSize :: "offset" ::: DeviceSize
flags :: PoolCreateFlagBits
memoryTypeIndex :: Flags
$sel:memoryAllocateNext:PoolCreateInfo :: PoolCreateInfo -> "userData" ::: Ptr ()
$sel:minAllocationAlignment:PoolCreateInfo :: PoolCreateInfo -> "offset" ::: DeviceSize
$sel:priority:PoolCreateInfo :: PoolCreateInfo -> Float
$sel:maxBlockCount:PoolCreateInfo :: PoolCreateInfo -> "offset" ::: DeviceSize
$sel:minBlockCount:PoolCreateInfo :: PoolCreateInfo -> "offset" ::: DeviceSize
$sel:blockSize:PoolCreateInfo :: PoolCreateInfo -> "offset" ::: DeviceSize
$sel:flags:PoolCreateInfo :: PoolCreateInfo -> PoolCreateFlagBits
$sel:memoryTypeIndex:PoolCreateInfo :: PoolCreateInfo -> Flags
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (Flags
memoryTypeIndex)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr PoolCreateFlags)) (PoolCreateFlagBits
flags)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
blockSize)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CSize)) (("offset" ::: DeviceSize) -> CSize
CSize ("offset" ::: DeviceSize
minBlockCount))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr CSize)) (("offset" ::: DeviceSize) -> CSize
CSize ("offset" ::: DeviceSize
maxBlockCount))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr CFloat)) (Float -> CFloat
CFloat (Float
priority))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
minAllocationAlignment)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr ()))) ("userData" ::: Ptr ()
memoryAllocateNext)
IO b
f
cStructSize :: Int
cStructSize = Int
56
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr PoolCreateInfo -> IO b -> IO b
pokeZeroCStruct Ptr PoolCreateInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr PoolCreateFlags)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CSize)) (("offset" ::: DeviceSize) -> CSize
CSize (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr CSize)) (("offset" ::: DeviceSize) -> CSize
CSize (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr CFloat)) (Float -> CFloat
CFloat (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct PoolCreateInfo where
peekCStruct :: Ptr PoolCreateInfo -> IO PoolCreateInfo
peekCStruct Ptr PoolCreateInfo
p = do
Flags
memoryTypeIndex <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
PoolCreateFlagBits
flags <- forall a. Storable a => Ptr a -> IO a
peek @PoolCreateFlags ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4 :: Ptr PoolCreateFlags))
"offset" ::: DeviceSize
blockSize <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceSize))
CSize
minBlockCount <- forall a. Storable a => Ptr a -> IO a
peek @CSize ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CSize))
CSize
maxBlockCount <- forall a. Storable a => Ptr a -> IO a
peek @CSize ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr CSize))
CFloat
priority <- forall a. Storable a => Ptr a -> IO a
peek @CFloat ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr CFloat))
"offset" ::: DeviceSize
minAllocationAlignment <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr DeviceSize))
"userData" ::: Ptr ()
pMemoryAllocateNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr PoolCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr ())))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Flags
-> PoolCreateFlagBits
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> Float
-> ("offset" ::: DeviceSize)
-> ("userData" ::: Ptr ())
-> PoolCreateInfo
PoolCreateInfo
Flags
memoryTypeIndex
PoolCreateFlagBits
flags
"offset" ::: DeviceSize
blockSize
(coerce :: forall a b. Coercible a b => a -> b
coerce @CSize @Word64 CSize
minBlockCount)
(coerce :: forall a b. Coercible a b => a -> b
coerce @CSize @Word64 CSize
maxBlockCount)
(coerce :: forall a b. Coercible a b => a -> b
coerce @CFloat @Float CFloat
priority)
"offset" ::: DeviceSize
minAllocationAlignment
"userData" ::: Ptr ()
pMemoryAllocateNext
instance Storable PoolCreateInfo where
sizeOf :: PoolCreateInfo -> Int
sizeOf ~PoolCreateInfo
_ = Int
56
alignment :: PoolCreateInfo -> Int
alignment ~PoolCreateInfo
_ = Int
8
peek :: Ptr PoolCreateInfo -> IO PoolCreateInfo
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PoolCreateInfo -> PoolCreateInfo -> IO ()
poke Ptr PoolCreateInfo
ptr PoolCreateInfo
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PoolCreateInfo
ptr PoolCreateInfo
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PoolCreateInfo where
zero :: PoolCreateInfo
zero = Flags
-> PoolCreateFlagBits
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> Float
-> ("offset" ::: DeviceSize)
-> ("userData" ::: Ptr ())
-> PoolCreateInfo
PoolCreateInfo
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data AllocationInfo = AllocationInfo
{
AllocationInfo -> Flags
memoryType :: Word32
,
AllocationInfo -> DeviceMemory
deviceMemory :: DeviceMemory
,
AllocationInfo -> "offset" ::: DeviceSize
offset :: DeviceSize
,
AllocationInfo -> "offset" ::: DeviceSize
size :: DeviceSize
,
AllocationInfo -> "userData" ::: Ptr ()
mappedData :: Ptr ()
,
AllocationInfo -> "userData" ::: Ptr ()
userData :: Ptr ()
,
AllocationInfo -> "name" ::: Maybe ByteString
name :: Maybe ByteString
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AllocationInfo)
#endif
deriving instance Show AllocationInfo
instance ToCStruct AllocationInfo where
withCStruct :: forall b. AllocationInfo -> (Ptr AllocationInfo -> IO b) -> IO b
withCStruct AllocationInfo
x Ptr AllocationInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 forall a b. (a -> b) -> a -> b
$ \Ptr AllocationInfo
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr AllocationInfo
p AllocationInfo
x (Ptr AllocationInfo -> IO b
f Ptr AllocationInfo
p)
pokeCStruct :: forall b. Ptr AllocationInfo -> AllocationInfo -> IO b -> IO b
pokeCStruct Ptr AllocationInfo
p AllocationInfo{"name" ::: Maybe ByteString
Flags
"offset" ::: DeviceSize
"userData" ::: Ptr ()
DeviceMemory
name :: "name" ::: Maybe ByteString
userData :: "userData" ::: Ptr ()
mappedData :: "userData" ::: Ptr ()
size :: "offset" ::: DeviceSize
offset :: "offset" ::: DeviceSize
deviceMemory :: DeviceMemory
memoryType :: Flags
$sel:name:AllocationInfo :: AllocationInfo -> "name" ::: Maybe ByteString
$sel:userData:AllocationInfo :: AllocationInfo -> "userData" ::: Ptr ()
$sel:mappedData:AllocationInfo :: AllocationInfo -> "userData" ::: Ptr ()
$sel:size:AllocationInfo :: AllocationInfo -> "offset" ::: DeviceSize
$sel:offset:AllocationInfo :: AllocationInfo -> "offset" ::: DeviceSize
$sel:deviceMemory:AllocationInfo :: AllocationInfo -> DeviceMemory
$sel:memoryType:AllocationInfo :: AllocationInfo -> Flags
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
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 -> a -> IO ()
poke ((Ptr AllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (Flags
memoryType)
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 -> a -> IO ()
poke ((Ptr AllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceMemory)) (DeviceMemory
deviceMemory)
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 -> a -> IO ()
poke ((Ptr AllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
offset)
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 -> a -> IO ()
poke ((Ptr AllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
size)
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 -> a -> IO ()
poke ((Ptr AllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr ()))) ("userData" ::: Ptr ()
mappedData)
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 -> a -> IO ()
poke ((Ptr AllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr ()))) ("userData" ::: Ptr ()
userData)
"name" ::: Ptr CChar
pName'' <- case ("name" ::: Maybe ByteString
name) of
"name" ::: Maybe ByteString
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just ByteString
j -> 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. ByteString -> (("name" ::: Ptr CChar) -> IO a) -> IO a
useAsCString (ByteString
j)
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 -> a -> IO ()
poke ((Ptr AllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr CChar))) "name" ::: Ptr CChar
pName''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
56
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr AllocationInfo -> IO b -> IO b
pokeZeroCStruct Ptr AllocationInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr AllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct AllocationInfo where
peekCStruct :: Ptr AllocationInfo -> IO AllocationInfo
peekCStruct Ptr AllocationInfo
p = do
Flags
memoryType <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr AllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
DeviceMemory
deviceMemory <- forall a. Storable a => Ptr a -> IO a
peek @DeviceMemory ((Ptr AllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceMemory))
"offset" ::: DeviceSize
offset <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr AllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize))
"offset" ::: DeviceSize
size <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr AllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize))
"userData" ::: Ptr ()
pMappedData <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr AllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr ())))
"userData" ::: Ptr ()
pUserData <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr AllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr ())))
"name" ::: Ptr CChar
pName <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr CChar) ((Ptr AllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr (Ptr CChar)))
"name" ::: Maybe ByteString
pName' <- forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\"name" ::: Ptr CChar
j -> ("name" ::: Ptr CChar) -> IO ByteString
packCString ("name" ::: Ptr CChar
j)) "name" ::: Ptr CChar
pName
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Flags
-> DeviceMemory
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> ("userData" ::: Ptr ())
-> ("userData" ::: Ptr ())
-> ("name" ::: Maybe ByteString)
-> AllocationInfo
AllocationInfo
Flags
memoryType DeviceMemory
deviceMemory "offset" ::: DeviceSize
offset "offset" ::: DeviceSize
size "userData" ::: Ptr ()
pMappedData "userData" ::: Ptr ()
pUserData "name" ::: Maybe ByteString
pName'
instance Zero AllocationInfo where
zero :: AllocationInfo
zero = Flags
-> DeviceMemory
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> ("userData" ::: Ptr ())
-> ("userData" ::: Ptr ())
-> ("name" ::: Maybe ByteString)
-> AllocationInfo
AllocationInfo
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Maybe a
Nothing
type FN_vmaCheckDefragmentationBreakFunction = ("pUserData" ::: Ptr ()) -> IO Bool32
type PFN_vmaCheckDefragmentationBreakFunction = FunPtr FN_vmaCheckDefragmentationBreakFunction
data DefragmentationInfo = DefragmentationInfo
{
DefragmentationInfo -> DefragmentationFlagBits
flags :: DefragmentationFlags
,
DefragmentationInfo -> Pool
pool :: Pool
,
DefragmentationInfo -> "offset" ::: DeviceSize
maxBytesPerPass :: DeviceSize
,
DefragmentationInfo -> Flags
maxAllocationsPerPass :: Word32
,
DefragmentationInfo -> PFN_vmaCheckDefragmentationBreakFunction
pfnBreakCallback :: PFN_vmaCheckDefragmentationBreakFunction
,
DefragmentationInfo -> "userData" ::: Ptr ()
breakCallbackUserData :: Ptr ()
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DefragmentationInfo)
#endif
deriving instance Show DefragmentationInfo
instance ToCStruct DefragmentationInfo where
withCStruct :: forall b.
DefragmentationInfo -> (Ptr DefragmentationInfo -> IO b) -> IO b
withCStruct DefragmentationInfo
x Ptr DefragmentationInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 forall a b. (a -> b) -> a -> b
$ \Ptr DefragmentationInfo
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DefragmentationInfo
p DefragmentationInfo
x (Ptr DefragmentationInfo -> IO b
f Ptr DefragmentationInfo
p)
pokeCStruct :: forall b.
Ptr DefragmentationInfo -> DefragmentationInfo -> IO b -> IO b
pokeCStruct Ptr DefragmentationInfo
p DefragmentationInfo{Flags
"offset" ::: DeviceSize
"userData" ::: Ptr ()
PFN_vmaCheckDefragmentationBreakFunction
Pool
DefragmentationFlagBits
breakCallbackUserData :: "userData" ::: Ptr ()
pfnBreakCallback :: PFN_vmaCheckDefragmentationBreakFunction
maxAllocationsPerPass :: Flags
maxBytesPerPass :: "offset" ::: DeviceSize
pool :: Pool
flags :: DefragmentationFlagBits
$sel:breakCallbackUserData:DefragmentationInfo :: DefragmentationInfo -> "userData" ::: Ptr ()
$sel:pfnBreakCallback:DefragmentationInfo :: DefragmentationInfo -> PFN_vmaCheckDefragmentationBreakFunction
$sel:maxAllocationsPerPass:DefragmentationInfo :: DefragmentationInfo -> Flags
$sel:maxBytesPerPass:DefragmentationInfo :: DefragmentationInfo -> "offset" ::: DeviceSize
$sel:pool:DefragmentationInfo :: DefragmentationInfo -> Pool
$sel:flags:DefragmentationInfo :: DefragmentationInfo -> DefragmentationFlagBits
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DefragmentationFlags)) (DefragmentationFlagBits
flags)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Pool)) (Pool
pool)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
maxBytesPerPass)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Flags
maxAllocationsPerPass)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr PFN_vmaCheckDefragmentationBreakFunction)) (PFN_vmaCheckDefragmentationBreakFunction
pfnBreakCallback)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr ()))) ("userData" ::: Ptr ()
breakCallbackUserData)
IO b
f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr DefragmentationInfo -> IO b -> IO b
pokeZeroCStruct Ptr DefragmentationInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DefragmentationFlags)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct DefragmentationInfo where
peekCStruct :: Ptr DefragmentationInfo -> IO DefragmentationInfo
peekCStruct Ptr DefragmentationInfo
p = do
DefragmentationFlagBits
flags <- forall a. Storable a => Ptr a -> IO a
peek @DefragmentationFlags ((Ptr DefragmentationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DefragmentationFlags))
Pool
pool <- forall a. Storable a => Ptr a -> IO a
peek @Pool ((Ptr DefragmentationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Pool))
"offset" ::: DeviceSize
maxBytesPerPass <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr DefragmentationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize))
Flags
maxAllocationsPerPass <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr DefragmentationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
PFN_vmaCheckDefragmentationBreakFunction
pfnBreakCallback <- forall a. Storable a => Ptr a -> IO a
peek @PFN_vmaCheckDefragmentationBreakFunction ((Ptr DefragmentationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr PFN_vmaCheckDefragmentationBreakFunction))
"userData" ::: Ptr ()
pBreakCallbackUserData <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr DefragmentationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr (Ptr ())))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ DefragmentationFlagBits
-> Pool
-> ("offset" ::: DeviceSize)
-> Flags
-> PFN_vmaCheckDefragmentationBreakFunction
-> ("userData" ::: Ptr ())
-> DefragmentationInfo
DefragmentationInfo
DefragmentationFlagBits
flags
Pool
pool
"offset" ::: DeviceSize
maxBytesPerPass
Flags
maxAllocationsPerPass
PFN_vmaCheckDefragmentationBreakFunction
pfnBreakCallback
"userData" ::: Ptr ()
pBreakCallbackUserData
instance Storable DefragmentationInfo where
sizeOf :: DefragmentationInfo -> Int
sizeOf ~DefragmentationInfo
_ = Int
48
alignment :: DefragmentationInfo -> Int
alignment ~DefragmentationInfo
_ = Int
8
peek :: Ptr DefragmentationInfo -> IO DefragmentationInfo
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr DefragmentationInfo -> DefragmentationInfo -> IO ()
poke Ptr DefragmentationInfo
ptr DefragmentationInfo
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DefragmentationInfo
ptr DefragmentationInfo
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero DefragmentationInfo where
zero :: DefragmentationInfo
zero = DefragmentationFlagBits
-> Pool
-> ("offset" ::: DeviceSize)
-> Flags
-> PFN_vmaCheckDefragmentationBreakFunction
-> ("userData" ::: Ptr ())
-> DefragmentationInfo
DefragmentationInfo
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data DefragmentationMove = DefragmentationMove
{
DefragmentationMove -> DefragmentationMoveOperation
operation :: DefragmentationMoveOperation
,
DefragmentationMove -> Allocation
srcAllocation :: Allocation
,
DefragmentationMove -> Allocation
dstTmpAllocation :: Allocation
}
deriving (Typeable, DefragmentationMove -> DefragmentationMove -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DefragmentationMove -> DefragmentationMove -> Bool
$c/= :: DefragmentationMove -> DefragmentationMove -> Bool
== :: DefragmentationMove -> DefragmentationMove -> Bool
$c== :: DefragmentationMove -> DefragmentationMove -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DefragmentationMove)
#endif
deriving instance Show DefragmentationMove
instance ToCStruct DefragmentationMove where
withCStruct :: forall b.
DefragmentationMove -> (Ptr DefragmentationMove -> IO b) -> IO b
withCStruct DefragmentationMove
x Ptr DefragmentationMove -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr DefragmentationMove
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DefragmentationMove
p DefragmentationMove
x (Ptr DefragmentationMove -> IO b
f Ptr DefragmentationMove
p)
pokeCStruct :: forall b.
Ptr DefragmentationMove -> DefragmentationMove -> IO b -> IO b
pokeCStruct Ptr DefragmentationMove
p DefragmentationMove{Allocation
DefragmentationMoveOperation
dstTmpAllocation :: Allocation
srcAllocation :: Allocation
operation :: DefragmentationMoveOperation
$sel:dstTmpAllocation:DefragmentationMove :: DefragmentationMove -> Allocation
$sel:srcAllocation:DefragmentationMove :: DefragmentationMove -> Allocation
$sel:operation:DefragmentationMove :: DefragmentationMove -> DefragmentationMoveOperation
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationMove
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DefragmentationMoveOperation)) (DefragmentationMoveOperation
operation)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationMove
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Allocation)) (Allocation
srcAllocation)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationMove
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Allocation)) (Allocation
dstTmpAllocation)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr DefragmentationMove -> IO b -> IO b
pokeZeroCStruct Ptr DefragmentationMove
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationMove
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DefragmentationMoveOperation)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationMove
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Allocation)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationMove
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Allocation)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct DefragmentationMove where
peekCStruct :: Ptr DefragmentationMove -> IO DefragmentationMove
peekCStruct Ptr DefragmentationMove
p = do
DefragmentationMoveOperation
operation <- forall a. Storable a => Ptr a -> IO a
peek @DefragmentationMoveOperation ((Ptr DefragmentationMove
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DefragmentationMoveOperation))
Allocation
srcAllocation <- forall a. Storable a => Ptr a -> IO a
peek @Allocation ((Ptr DefragmentationMove
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Allocation))
Allocation
dstTmpAllocation <- forall a. Storable a => Ptr a -> IO a
peek @Allocation ((Ptr DefragmentationMove
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Allocation))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ DefragmentationMoveOperation
-> Allocation -> Allocation -> DefragmentationMove
DefragmentationMove
DefragmentationMoveOperation
operation Allocation
srcAllocation Allocation
dstTmpAllocation
instance Storable DefragmentationMove where
sizeOf :: DefragmentationMove -> Int
sizeOf ~DefragmentationMove
_ = Int
24
alignment :: DefragmentationMove -> Int
alignment ~DefragmentationMove
_ = Int
8
peek :: Ptr DefragmentationMove -> IO DefragmentationMove
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr DefragmentationMove -> DefragmentationMove -> IO ()
poke Ptr DefragmentationMove
ptr DefragmentationMove
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DefragmentationMove
ptr DefragmentationMove
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero DefragmentationMove where
zero :: DefragmentationMove
zero = DefragmentationMoveOperation
-> Allocation -> Allocation -> DefragmentationMove
DefragmentationMove
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data DefragmentationPassMoveInfo = DefragmentationPassMoveInfo
{
DefragmentationPassMoveInfo -> Flags
moveCount :: Word32
,
DefragmentationPassMoveInfo -> Ptr DefragmentationMove
moves :: Ptr DefragmentationMove
}
deriving (Typeable, DefragmentationPassMoveInfo -> DefragmentationPassMoveInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DefragmentationPassMoveInfo -> DefragmentationPassMoveInfo -> Bool
$c/= :: DefragmentationPassMoveInfo -> DefragmentationPassMoveInfo -> Bool
== :: DefragmentationPassMoveInfo -> DefragmentationPassMoveInfo -> Bool
$c== :: DefragmentationPassMoveInfo -> DefragmentationPassMoveInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DefragmentationPassMoveInfo)
#endif
deriving instance Show DefragmentationPassMoveInfo
instance ToCStruct DefragmentationPassMoveInfo where
withCStruct :: forall b.
DefragmentationPassMoveInfo
-> (Ptr DefragmentationPassMoveInfo -> IO b) -> IO b
withCStruct DefragmentationPassMoveInfo
x Ptr DefragmentationPassMoveInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
16 forall a b. (a -> b) -> a -> b
$ \Ptr DefragmentationPassMoveInfo
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DefragmentationPassMoveInfo
p DefragmentationPassMoveInfo
x (Ptr DefragmentationPassMoveInfo -> IO b
f Ptr DefragmentationPassMoveInfo
p)
pokeCStruct :: forall b.
Ptr DefragmentationPassMoveInfo
-> DefragmentationPassMoveInfo -> IO b -> IO b
pokeCStruct Ptr DefragmentationPassMoveInfo
p DefragmentationPassMoveInfo{Flags
Ptr DefragmentationMove
moves :: Ptr DefragmentationMove
moveCount :: Flags
$sel:moves:DefragmentationPassMoveInfo :: DefragmentationPassMoveInfo -> Ptr DefragmentationMove
$sel:moveCount:DefragmentationPassMoveInfo :: DefragmentationPassMoveInfo -> Flags
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationPassMoveInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (Flags
moveCount)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationPassMoveInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr DefragmentationMove))) (Ptr DefragmentationMove
moves)
IO b
f
cStructSize :: Int
cStructSize = Int
16
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr DefragmentationPassMoveInfo -> IO b -> IO b
pokeZeroCStruct Ptr DefragmentationPassMoveInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationPassMoveInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct DefragmentationPassMoveInfo where
peekCStruct :: Ptr DefragmentationPassMoveInfo -> IO DefragmentationPassMoveInfo
peekCStruct Ptr DefragmentationPassMoveInfo
p = do
Flags
moveCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr DefragmentationPassMoveInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr Word32))
Ptr DefragmentationMove
pMoves <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr DefragmentationMove) ((Ptr DefragmentationPassMoveInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr DefragmentationMove)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Flags -> Ptr DefragmentationMove -> DefragmentationPassMoveInfo
DefragmentationPassMoveInfo
Flags
moveCount Ptr DefragmentationMove
pMoves
instance Storable DefragmentationPassMoveInfo where
sizeOf :: DefragmentationPassMoveInfo -> Int
sizeOf ~DefragmentationPassMoveInfo
_ = Int
16
alignment :: DefragmentationPassMoveInfo -> Int
alignment ~DefragmentationPassMoveInfo
_ = Int
8
peek :: Ptr DefragmentationPassMoveInfo -> IO DefragmentationPassMoveInfo
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr DefragmentationPassMoveInfo
-> DefragmentationPassMoveInfo -> IO ()
poke Ptr DefragmentationPassMoveInfo
ptr DefragmentationPassMoveInfo
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DefragmentationPassMoveInfo
ptr DefragmentationPassMoveInfo
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero DefragmentationPassMoveInfo where
zero :: DefragmentationPassMoveInfo
zero = Flags -> Ptr DefragmentationMove -> DefragmentationPassMoveInfo
DefragmentationPassMoveInfo
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data DefragmentationStats = DefragmentationStats
{
DefragmentationStats -> "offset" ::: DeviceSize
bytesMoved :: DeviceSize
,
DefragmentationStats -> "offset" ::: DeviceSize
bytesFreed :: DeviceSize
,
DefragmentationStats -> Flags
allocationsMoved :: Word32
,
DefragmentationStats -> Flags
deviceMemoryBlocksFreed :: Word32
}
deriving (Typeable, DefragmentationStats -> DefragmentationStats -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DefragmentationStats -> DefragmentationStats -> Bool
$c/= :: DefragmentationStats -> DefragmentationStats -> Bool
== :: DefragmentationStats -> DefragmentationStats -> Bool
$c== :: DefragmentationStats -> DefragmentationStats -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DefragmentationStats)
#endif
deriving instance Show DefragmentationStats
instance ToCStruct DefragmentationStats where
withCStruct :: forall b.
DefragmentationStats -> (Ptr DefragmentationStats -> IO b) -> IO b
withCStruct DefragmentationStats
x Ptr DefragmentationStats -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr DefragmentationStats
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DefragmentationStats
p DefragmentationStats
x (Ptr DefragmentationStats -> IO b
f Ptr DefragmentationStats
p)
pokeCStruct :: forall b.
Ptr DefragmentationStats -> DefragmentationStats -> IO b -> IO b
pokeCStruct Ptr DefragmentationStats
p DefragmentationStats{Flags
"offset" ::: DeviceSize
deviceMemoryBlocksFreed :: Flags
allocationsMoved :: Flags
bytesFreed :: "offset" ::: DeviceSize
bytesMoved :: "offset" ::: DeviceSize
$sel:deviceMemoryBlocksFreed:DefragmentationStats :: DefragmentationStats -> Flags
$sel:allocationsMoved:DefragmentationStats :: DefragmentationStats -> Flags
$sel:bytesFreed:DefragmentationStats :: DefragmentationStats -> "offset" ::: DeviceSize
$sel:bytesMoved:DefragmentationStats :: DefragmentationStats -> "offset" ::: DeviceSize
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationStats
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
bytesMoved)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationStats
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
bytesFreed)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationStats
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Flags
allocationsMoved)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationStats
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (Flags
deviceMemoryBlocksFreed)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr DefragmentationStats -> IO b -> IO b
pokeZeroCStruct Ptr DefragmentationStats
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationStats
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationStats
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationStats
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DefragmentationStats
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct DefragmentationStats where
peekCStruct :: Ptr DefragmentationStats -> IO DefragmentationStats
peekCStruct Ptr DefragmentationStats
p = do
"offset" ::: DeviceSize
bytesMoved <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr DefragmentationStats
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceSize))
"offset" ::: DeviceSize
bytesFreed <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr DefragmentationStats
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceSize))
Flags
allocationsMoved <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr DefragmentationStats
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
Flags
deviceMemoryBlocksFreed <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr DefragmentationStats
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> Flags
-> Flags
-> DefragmentationStats
DefragmentationStats
"offset" ::: DeviceSize
bytesMoved "offset" ::: DeviceSize
bytesFreed Flags
allocationsMoved Flags
deviceMemoryBlocksFreed
instance Storable DefragmentationStats where
sizeOf :: DefragmentationStats -> Int
sizeOf ~DefragmentationStats
_ = Int
24
alignment :: DefragmentationStats -> Int
alignment ~DefragmentationStats
_ = Int
8
peek :: Ptr DefragmentationStats -> IO DefragmentationStats
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr DefragmentationStats -> DefragmentationStats -> IO ()
poke Ptr DefragmentationStats
ptr DefragmentationStats
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DefragmentationStats
ptr DefragmentationStats
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero DefragmentationStats where
zero :: DefragmentationStats
zero = ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> Flags
-> Flags
-> DefragmentationStats
DefragmentationStats
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data VirtualBlockCreateInfo = VirtualBlockCreateInfo
{
VirtualBlockCreateInfo -> "offset" ::: DeviceSize
size :: DeviceSize
,
VirtualBlockCreateInfo -> VirtualBlockCreateFlagBits
flags :: VirtualBlockCreateFlags
,
VirtualBlockCreateInfo -> Maybe AllocationCallbacks
allocationCallbacks :: Maybe AllocationCallbacks
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (VirtualBlockCreateInfo)
#endif
deriving instance Show VirtualBlockCreateInfo
instance ToCStruct VirtualBlockCreateInfo where
withCStruct :: forall b.
VirtualBlockCreateInfo
-> (Ptr VirtualBlockCreateInfo -> IO b) -> IO b
withCStruct VirtualBlockCreateInfo
x Ptr VirtualBlockCreateInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr VirtualBlockCreateInfo
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr VirtualBlockCreateInfo
p VirtualBlockCreateInfo
x (Ptr VirtualBlockCreateInfo -> IO b
f Ptr VirtualBlockCreateInfo
p)
pokeCStruct :: forall b.
Ptr VirtualBlockCreateInfo
-> VirtualBlockCreateInfo -> IO b -> IO b
pokeCStruct Ptr VirtualBlockCreateInfo
p VirtualBlockCreateInfo{Maybe AllocationCallbacks
"offset" ::: DeviceSize
VirtualBlockCreateFlagBits
allocationCallbacks :: Maybe AllocationCallbacks
flags :: VirtualBlockCreateFlagBits
size :: "offset" ::: DeviceSize
$sel:allocationCallbacks:VirtualBlockCreateInfo :: VirtualBlockCreateInfo -> Maybe AllocationCallbacks
$sel:flags:VirtualBlockCreateInfo :: VirtualBlockCreateInfo -> VirtualBlockCreateFlagBits
$sel:size:VirtualBlockCreateInfo :: VirtualBlockCreateInfo -> "offset" ::: DeviceSize
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
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 -> a -> IO ()
poke ((Ptr VirtualBlockCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
size)
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 -> a -> IO ()
poke ((Ptr VirtualBlockCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr VirtualBlockCreateFlags)) (VirtualBlockCreateFlagBits
flags)
Ptr AllocationCallbacks
pAllocationCallbacks'' <- case (Maybe AllocationCallbacks
allocationCallbacks) of
Maybe AllocationCallbacks
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
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 -> a -> IO ()
poke ((Ptr VirtualBlockCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr AllocationCallbacks))) Ptr AllocationCallbacks
pAllocationCallbacks''
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr VirtualBlockCreateInfo -> IO b -> IO b
pokeZeroCStruct Ptr VirtualBlockCreateInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VirtualBlockCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VirtualBlockCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr VirtualBlockCreateFlags)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct VirtualBlockCreateInfo where
peekCStruct :: Ptr VirtualBlockCreateInfo -> IO VirtualBlockCreateInfo
peekCStruct Ptr VirtualBlockCreateInfo
p = do
"offset" ::: DeviceSize
size <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr VirtualBlockCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceSize))
VirtualBlockCreateFlagBits
flags <- forall a. Storable a => Ptr a -> IO a
peek @VirtualBlockCreateFlags ((Ptr VirtualBlockCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr VirtualBlockCreateFlags))
Ptr AllocationCallbacks
pAllocationCallbacks <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr AllocationCallbacks) ((Ptr VirtualBlockCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr AllocationCallbacks)))
Maybe AllocationCallbacks
pAllocationCallbacks' <- forall a b. (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
maybePeek (\Ptr AllocationCallbacks
j -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @AllocationCallbacks (Ptr AllocationCallbacks
j)) Ptr AllocationCallbacks
pAllocationCallbacks
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("offset" ::: DeviceSize)
-> VirtualBlockCreateFlagBits
-> Maybe AllocationCallbacks
-> VirtualBlockCreateInfo
VirtualBlockCreateInfo
"offset" ::: DeviceSize
size VirtualBlockCreateFlagBits
flags Maybe AllocationCallbacks
pAllocationCallbacks'
instance Zero VirtualBlockCreateInfo where
zero :: VirtualBlockCreateInfo
zero = ("offset" ::: DeviceSize)
-> VirtualBlockCreateFlagBits
-> Maybe AllocationCallbacks
-> VirtualBlockCreateInfo
VirtualBlockCreateInfo
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Maybe a
Nothing
data VirtualAllocationCreateInfo = VirtualAllocationCreateInfo
{
VirtualAllocationCreateInfo -> "offset" ::: DeviceSize
size :: DeviceSize
,
VirtualAllocationCreateInfo -> "offset" ::: DeviceSize
alignment :: DeviceSize
,
VirtualAllocationCreateInfo -> VirtualAllocationCreateFlagBits
flags :: VirtualAllocationCreateFlags
,
VirtualAllocationCreateInfo -> "userData" ::: Ptr ()
userData :: Ptr ()
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (VirtualAllocationCreateInfo)
#endif
deriving instance Show VirtualAllocationCreateInfo
instance ToCStruct VirtualAllocationCreateInfo where
withCStruct :: forall b.
VirtualAllocationCreateInfo
-> (Ptr VirtualAllocationCreateInfo -> IO b) -> IO b
withCStruct VirtualAllocationCreateInfo
x Ptr VirtualAllocationCreateInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr VirtualAllocationCreateInfo
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr VirtualAllocationCreateInfo
p VirtualAllocationCreateInfo
x (Ptr VirtualAllocationCreateInfo -> IO b
f Ptr VirtualAllocationCreateInfo
p)
pokeCStruct :: forall b.
Ptr VirtualAllocationCreateInfo
-> VirtualAllocationCreateInfo -> IO b -> IO b
pokeCStruct Ptr VirtualAllocationCreateInfo
p VirtualAllocationCreateInfo{"offset" ::: DeviceSize
"userData" ::: Ptr ()
VirtualAllocationCreateFlagBits
userData :: "userData" ::: Ptr ()
flags :: VirtualAllocationCreateFlagBits
alignment :: "offset" ::: DeviceSize
size :: "offset" ::: DeviceSize
$sel:userData:VirtualAllocationCreateInfo :: VirtualAllocationCreateInfo -> "userData" ::: Ptr ()
$sel:flags:VirtualAllocationCreateInfo :: VirtualAllocationCreateInfo -> VirtualAllocationCreateFlagBits
$sel:alignment:VirtualAllocationCreateInfo :: VirtualAllocationCreateInfo -> "offset" ::: DeviceSize
$sel:size:VirtualAllocationCreateInfo :: VirtualAllocationCreateInfo -> "offset" ::: DeviceSize
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VirtualAllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
size)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VirtualAllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
alignment)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VirtualAllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr VirtualAllocationCreateFlags)) (VirtualAllocationCreateFlagBits
flags)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VirtualAllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr ()))) ("userData" ::: Ptr ()
userData)
IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr VirtualAllocationCreateInfo -> IO b -> IO b
pokeZeroCStruct Ptr VirtualAllocationCreateInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VirtualAllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VirtualAllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VirtualAllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr VirtualAllocationCreateFlags)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct VirtualAllocationCreateInfo where
peekCStruct :: Ptr VirtualAllocationCreateInfo -> IO VirtualAllocationCreateInfo
peekCStruct Ptr VirtualAllocationCreateInfo
p = do
"offset" ::: DeviceSize
size <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr VirtualAllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceSize))
"offset" ::: DeviceSize
alignment <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr VirtualAllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceSize))
VirtualAllocationCreateFlagBits
flags <- forall a. Storable a => Ptr a -> IO a
peek @VirtualAllocationCreateFlags ((Ptr VirtualAllocationCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr VirtualAllocationCreateFlags))
"userData" ::: Ptr ()
pUserData <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr VirtualAllocationCreateInfo
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
$ ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> VirtualAllocationCreateFlagBits
-> ("userData" ::: Ptr ())
-> VirtualAllocationCreateInfo
VirtualAllocationCreateInfo
"offset" ::: DeviceSize
size "offset" ::: DeviceSize
alignment VirtualAllocationCreateFlagBits
flags "userData" ::: Ptr ()
pUserData
instance Storable VirtualAllocationCreateInfo where
sizeOf :: VirtualAllocationCreateInfo -> Int
sizeOf ~VirtualAllocationCreateInfo
_ = Int
32
alignment :: VirtualAllocationCreateInfo -> Int
alignment ~VirtualAllocationCreateInfo
_ = Int
8
peek :: Ptr VirtualAllocationCreateInfo -> IO VirtualAllocationCreateInfo
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr VirtualAllocationCreateInfo
-> VirtualAllocationCreateInfo -> IO ()
poke Ptr VirtualAllocationCreateInfo
ptr VirtualAllocationCreateInfo
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr VirtualAllocationCreateInfo
ptr VirtualAllocationCreateInfo
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero VirtualAllocationCreateInfo where
zero :: VirtualAllocationCreateInfo
zero = ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> VirtualAllocationCreateFlagBits
-> ("userData" ::: Ptr ())
-> VirtualAllocationCreateInfo
VirtualAllocationCreateInfo
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data VirtualAllocationInfo = VirtualAllocationInfo
{
VirtualAllocationInfo -> "offset" ::: DeviceSize
offset :: DeviceSize
,
VirtualAllocationInfo -> "offset" ::: DeviceSize
size :: DeviceSize
,
VirtualAllocationInfo -> "userData" ::: Ptr ()
userData :: Ptr ()
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (VirtualAllocationInfo)
#endif
deriving instance Show VirtualAllocationInfo
instance ToCStruct VirtualAllocationInfo where
withCStruct :: forall b.
VirtualAllocationInfo
-> (Ptr VirtualAllocationInfo -> IO b) -> IO b
withCStruct VirtualAllocationInfo
x Ptr VirtualAllocationInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr VirtualAllocationInfo
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr VirtualAllocationInfo
p VirtualAllocationInfo
x (Ptr VirtualAllocationInfo -> IO b
f Ptr VirtualAllocationInfo
p)
pokeCStruct :: forall b.
Ptr VirtualAllocationInfo -> VirtualAllocationInfo -> IO b -> IO b
pokeCStruct Ptr VirtualAllocationInfo
p VirtualAllocationInfo{"offset" ::: DeviceSize
"userData" ::: Ptr ()
userData :: "userData" ::: Ptr ()
size :: "offset" ::: DeviceSize
offset :: "offset" ::: DeviceSize
$sel:userData:VirtualAllocationInfo :: VirtualAllocationInfo -> "userData" ::: Ptr ()
$sel:size:VirtualAllocationInfo :: VirtualAllocationInfo -> "offset" ::: DeviceSize
$sel:offset:VirtualAllocationInfo :: VirtualAllocationInfo -> "offset" ::: DeviceSize
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VirtualAllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
offset)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VirtualAllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceSize)) ("offset" ::: DeviceSize
size)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VirtualAllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr ()))) ("userData" ::: Ptr ()
userData)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr VirtualAllocationInfo -> IO b -> IO b
pokeZeroCStruct Ptr VirtualAllocationInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VirtualAllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VirtualAllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceSize)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct VirtualAllocationInfo where
peekCStruct :: Ptr VirtualAllocationInfo -> IO VirtualAllocationInfo
peekCStruct Ptr VirtualAllocationInfo
p = do
"offset" ::: DeviceSize
offset <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr VirtualAllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceSize))
"offset" ::: DeviceSize
size <- forall a. Storable a => Ptr a -> IO a
peek @DeviceSize ((Ptr VirtualAllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceSize))
"userData" ::: Ptr ()
pUserData <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr VirtualAllocationInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr ())))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> ("userData" ::: Ptr ())
-> VirtualAllocationInfo
VirtualAllocationInfo
"offset" ::: DeviceSize
offset "offset" ::: DeviceSize
size "userData" ::: Ptr ()
pUserData
instance Storable VirtualAllocationInfo where
sizeOf :: VirtualAllocationInfo -> Int
sizeOf ~VirtualAllocationInfo
_ = Int
24
alignment :: VirtualAllocationInfo -> Int
alignment ~VirtualAllocationInfo
_ = Int
8
peek :: Ptr VirtualAllocationInfo -> IO VirtualAllocationInfo
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr VirtualAllocationInfo -> VirtualAllocationInfo -> IO ()
poke Ptr VirtualAllocationInfo
ptr VirtualAllocationInfo
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr VirtualAllocationInfo
ptr VirtualAllocationInfo
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero VirtualAllocationInfo where
zero :: VirtualAllocationInfo
zero = ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> ("userData" ::: Ptr ())
-> VirtualAllocationInfo
VirtualAllocationInfo
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero