VulkanMemoryAllocator 0.3 → 0.3.1
raw patch · 3 files changed
+496/−74 lines, 3 filesdep ~vulkanPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: vulkan
API changes (from Hackage documentation)
+ VulkanMemoryAllocator: instance GHC.Classes.Eq VulkanMemoryAllocator.AllocatorInfo
+ VulkanMemoryAllocator: instance GHC.Classes.Eq VulkanMemoryAllocator.Budget
+ VulkanMemoryAllocator: instance GHC.Classes.Eq VulkanMemoryAllocator.DefragmentationInfo
+ VulkanMemoryAllocator: instance GHC.Classes.Eq VulkanMemoryAllocator.DefragmentationPassInfo
+ VulkanMemoryAllocator: instance GHC.Classes.Eq VulkanMemoryAllocator.DefragmentationPassMoveInfo
+ VulkanMemoryAllocator: instance GHC.Classes.Eq VulkanMemoryAllocator.DefragmentationStats
+ VulkanMemoryAllocator: instance GHC.Classes.Eq VulkanMemoryAllocator.PoolCreateInfo
+ VulkanMemoryAllocator: instance GHC.Classes.Eq VulkanMemoryAllocator.PoolStats
+ VulkanMemoryAllocator: instance GHC.Classes.Eq VulkanMemoryAllocator.StatInfo
+ VulkanMemoryAllocator: instance GHC.Classes.Eq VulkanMemoryAllocator.VulkanFunctions
+ VulkanMemoryAllocator: instance GHC.Generics.Generic VulkanMemoryAllocator.AllocationCreateInfo
+ VulkanMemoryAllocator: instance GHC.Generics.Generic VulkanMemoryAllocator.AllocationInfo
+ VulkanMemoryAllocator: instance GHC.Generics.Generic VulkanMemoryAllocator.AllocatorCreateInfo
+ VulkanMemoryAllocator: instance GHC.Generics.Generic VulkanMemoryAllocator.AllocatorInfo
+ VulkanMemoryAllocator: instance GHC.Generics.Generic VulkanMemoryAllocator.Budget
+ VulkanMemoryAllocator: instance GHC.Generics.Generic VulkanMemoryAllocator.DefragmentationInfo
+ VulkanMemoryAllocator: instance GHC.Generics.Generic VulkanMemoryAllocator.DefragmentationInfo2
+ VulkanMemoryAllocator: instance GHC.Generics.Generic VulkanMemoryAllocator.DefragmentationPassInfo
+ VulkanMemoryAllocator: instance GHC.Generics.Generic VulkanMemoryAllocator.DefragmentationPassMoveInfo
+ VulkanMemoryAllocator: instance GHC.Generics.Generic VulkanMemoryAllocator.DefragmentationStats
+ VulkanMemoryAllocator: instance GHC.Generics.Generic VulkanMemoryAllocator.DeviceMemoryCallbacks
+ VulkanMemoryAllocator: instance GHC.Generics.Generic VulkanMemoryAllocator.PoolCreateInfo
+ VulkanMemoryAllocator: instance GHC.Generics.Generic VulkanMemoryAllocator.PoolStats
+ VulkanMemoryAllocator: instance GHC.Generics.Generic VulkanMemoryAllocator.RecordSettings
+ VulkanMemoryAllocator: instance GHC.Generics.Generic VulkanMemoryAllocator.StatInfo
+ VulkanMemoryAllocator: instance GHC.Generics.Generic VulkanMemoryAllocator.Stats
+ VulkanMemoryAllocator: instance GHC.Generics.Generic VulkanMemoryAllocator.VulkanFunctions
Files
- VulkanMemoryAllocator.cabal +11/−4
- changelog.md +4/−0
- src/VulkanMemoryAllocator.hs +481/−70
VulkanMemoryAllocator.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: cfb82651f2f38d4f208b4e34e5fc4409bccf0155b932fa4cc057e74965616d75+-- hash: d63790e67481a6422f7936270c7caa8f6245825d2a71741d5e26ea30e9ba5df1 name: VulkanMemoryAllocator-version: 0.3+version: 0.3.1 synopsis: Bindings to the VulkanMemoryAllocator library category: Graphics homepage: https://github.com/expipiplus1/vulkan#readme@@ -25,6 +25,11 @@ type: git location: https://github.com/expipiplus1/vulkan +flag generic-instances+ description: Derive Generic instances for all structs. Disabled by default because of code size and compile time impact.+ manual: True+ default: False+ flag safe-foreign-calls description: Do not mark foreign imports as 'unsafe'. This means that callbacks from VulkanMemoryAllocator to Haskell will work. If you are using these then make sure this flag is enabled. manual: True@@ -45,7 +50,7 @@ VulkanMemoryAllocator hs-source-dirs: src- default-extensions: AllowAmbiguousTypes CPP DataKinds DefaultSignatures DeriveAnyClass DerivingStrategies DuplicateRecordFields FlexibleContexts FlexibleInstances GADTs GeneralizedNewtypeDeriving InstanceSigs LambdaCase MagicHash NoMonomorphismRestriction OverloadedStrings PartialTypeSignatures PatternSynonyms PolyKinds QuantifiedConstraints RankNTypes RecordWildCards RoleAnnotations ScopedTypeVariables StandaloneDeriving Strict TypeApplications TypeFamilyDependencies TypeOperators TypeSynonymInstances UndecidableInstances ViewPatterns+ default-extensions: AllowAmbiguousTypes CPP DataKinds DefaultSignatures DeriveAnyClass DeriveGeneric DerivingStrategies DuplicateRecordFields FlexibleContexts FlexibleInstances GADTs GeneralizedNewtypeDeriving InstanceSigs LambdaCase MagicHash NoMonomorphismRestriction OverloadedStrings PartialTypeSignatures PatternSynonyms PolyKinds QuantifiedConstraints RankNTypes RecordWildCards RoleAnnotations ScopedTypeVariables StandaloneDeriving Strict TypeApplications TypeFamilyDependencies TypeOperators TypeSynonymInstances UndecidableInstances ViewPatterns ghc-options: -Wall -Wno-unticked-promoted-constructors -Wno-missing-pattern-synonym-signatures -Wno-unused-imports -Wno-missing-signatures -Wno-partial-type-signatures include-dirs: VulkanMemoryAllocator/src@@ -58,11 +63,13 @@ , bytestring , transformers , vector- , vulkan ==3.3.*+ , vulkan ==3.3.1.* if flag(safe-foreign-calls) cpp-options: -DSAFE_FOREIGN_CALLS if flag(vma-ndebug) cxx-options: -DNDEBUG if flag(vma-recording) cxx-options: -DVMA_RECORDING_ENABLED+ if flag(generic-instances)+ cpp-options: -DGENERIC_INSTANCES default-language: Haskell2010
changelog.md view
@@ -2,6 +2,10 @@ ## WIP +## [0.3.1] - 2020-05-18+ - Eq instances for some simple structs, #94+ - Add cabal flag for enable deriving Generic for structs, #99+ ## [0.3] - 2020-05-07 - Move package from `Vulkan.VulkanMemoryAllocator` to just `VulkanMemoryAllocator`, #60 - Make the continuation the last argument to 'bracket' functions, discussion
src/VulkanMemoryAllocator.hs view
@@ -171,6 +171,7 @@ import Vulkan (PhysicalDevice_T) import Vulkan (Result) import Vulkan.CStruct.Utils (FixedArray)+import Vulkan.CStruct.Extends (forgetExtensions) import Vulkan.CStruct.Utils (advancePtrBytes) import Vulkan.CStruct.Utils (lowerArrayPtr) import Vulkan.Core10.BaseType (bool32ToBool)@@ -238,6 +239,7 @@ 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)@@ -260,7 +262,11 @@ :: Ptr AllocatorCreateInfo -> Ptr Allocator -> IO Result -- | Creates Allocator object.-createAllocator :: forall io . MonadIO io => AllocatorCreateInfo -> io (Allocator)+createAllocator :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaCreateAllocator" "pCreateInfo"+ AllocatorCreateInfo+ -> io (Allocator) createAllocator createInfo = liftIO . evalContT $ do pCreateInfo <- ContT $ withCStruct (createInfo) pPAllocator <- ContT $ bracket (callocBytes @Allocator 8) free@@ -291,7 +297,11 @@ :: Allocator -> IO () -- | Destroys allocator object.-destroyAllocator :: forall io . MonadIO io => Allocator -> io ()+destroyAllocator :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaDestroyAllocator" "allocator"+ Allocator+ -> io () destroyAllocator allocator = liftIO $ do (ffiVmaDestroyAllocator) (allocator) pure $ ()@@ -310,7 +320,11 @@ -- It might be useful if you want to keep just the 'Allocator' handle and -- fetch other required handles to @VkPhysicalDevice@, @VkDevice@ etc. -- every time using this function.-getAllocatorInfo :: forall io . MonadIO io => Allocator -> io (AllocatorInfo)+getAllocatorInfo :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaGetAllocatorInfo" "allocator"+ Allocator+ -> io (AllocatorInfo) getAllocatorInfo allocator = liftIO . evalContT $ do pPAllocatorInfo <- ContT (withZeroCStruct @AllocatorInfo) lift $ (ffiVmaGetAllocatorInfo) (allocator) (pPAllocatorInfo)@@ -328,7 +342,11 @@ -- | PhysicalDeviceProperties are fetched from physicalDevice by the -- allocator. You can access it here, without fetching it again on your -- own.-getPhysicalDeviceProperties :: forall io . MonadIO io => Allocator -> io (Ptr PhysicalDeviceProperties)+getPhysicalDeviceProperties :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaGetPhysicalDeviceProperties" "allocator"+ Allocator+ -> io (Ptr PhysicalDeviceProperties) getPhysicalDeviceProperties allocator = liftIO . evalContT $ do pPpPhysicalDeviceProperties <- ContT $ bracket (callocBytes @(Ptr PhysicalDeviceProperties) 8) free lift $ (ffiVmaGetPhysicalDeviceProperties) (allocator) (pPpPhysicalDeviceProperties)@@ -346,7 +364,11 @@ -- | PhysicalDeviceMemoryProperties are fetched from physicalDevice by the -- allocator. You can access it here, without fetching it again on your -- own.-getMemoryProperties :: forall io . MonadIO io => Allocator -> io (Ptr PhysicalDeviceMemoryProperties)+getMemoryProperties :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaGetMemoryProperties" "allocator"+ Allocator+ -> io (Ptr PhysicalDeviceMemoryProperties) getMemoryProperties allocator = liftIO . evalContT $ do pPpPhysicalDeviceMemoryProperties <- ContT $ bracket (callocBytes @(Ptr PhysicalDeviceMemoryProperties) 8) free lift $ (ffiVmaGetMemoryProperties) (allocator) (pPpPhysicalDeviceMemoryProperties)@@ -365,7 +387,13 @@ -- -- This is just a convenience function. Same information can be obtained -- using 'getMemoryProperties'.-getMemoryTypeProperties :: forall io . MonadIO io => Allocator -> ("memoryTypeIndex" ::: Word32) -> io (MemoryPropertyFlags)+getMemoryTypeProperties :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaGetMemoryTypeProperties" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaGetMemoryTypeProperties" "memoryTypeIndex"+ ("memoryTypeIndex" ::: Word32)+ -> io (MemoryPropertyFlags) getMemoryTypeProperties allocator memoryTypeIndex = liftIO . evalContT $ do pPFlags <- ContT $ bracket (callocBytes @MemoryPropertyFlags 4) free lift $ (ffiVmaGetMemoryTypeProperties) (allocator) (memoryTypeIndex) (pPFlags)@@ -387,7 +415,13 @@ -- 'ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT' flags to inform the -- allocator when a new frame begins. Allocations queried using -- 'getAllocationInfo' cannot become lost in the current frame.-setCurrentFrameIndex :: forall io . MonadIO io => Allocator -> ("frameIndex" ::: Word32) -> io ()+setCurrentFrameIndex :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaSetCurrentFrameIndex" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaSetCurrentFrameIndex" "frameIndex"+ ("frameIndex" ::: Word32)+ -> io () setCurrentFrameIndex allocator frameIndex = liftIO $ do (ffiVmaSetCurrentFrameIndex) (allocator) (frameIndex) pure $ ()@@ -409,7 +443,11 @@ -- -- Note that when using allocator from multiple threads, returned -- information may immediately become outdated.-calculateStats :: forall io . MonadIO io => Allocator -> io (Stats)+calculateStats :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaCalculateStats" "allocator"+ Allocator+ -> io (Stats) calculateStats allocator = liftIO . evalContT $ do pPStats <- ContT (withZeroCStruct @Stats) lift $ (ffiVmaCalculateStats) (allocator) (pPStats)@@ -440,7 +478,11 @@ -- -- Note that when using allocator from multiple threads, returned -- information may immediately become outdated.-getBudget :: forall io . MonadIO io => Allocator -> io (Budget)+getBudget :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaGetBudget" "allocator"+ Allocator+ -> io (Budget) getBudget allocator = liftIO . evalContT $ do pPBudget <- ContT (withZeroCStruct @Budget) lift $ (ffiVmaGetBudget) (allocator) (pPBudget)@@ -463,7 +505,13 @@ -- | out | ppStatsString | Must be freed using 'freeStatsString' | -- | | | function. | -- +-----------+---------------+-----------------------------------------------+-buildStatsString :: forall io . MonadIO io => Allocator -> ("detailedMap" ::: Bool) -> io (("statsString" ::: Ptr CChar))+buildStatsString :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaBuildStatsString" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaBuildStatsString" "detailedMap"+ ("detailedMap" ::: Bool)+ -> io (("statsString" ::: Ptr CChar)) buildStatsString allocator detailedMap = liftIO . evalContT $ do pPpStatsString <- ContT $ bracket (callocBytes @(Ptr CChar) 8) free lift $ (ffiVmaBuildStatsString) (allocator) (pPpStatsString) (boolToBool32 (detailedMap))@@ -479,7 +527,13 @@ :: Allocator -> Ptr CChar -> IO () -freeStatsString :: forall io . MonadIO io => Allocator -> ("statsString" ::: Ptr CChar) -> io ()+freeStatsString :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaFreeStatsString" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaFreeStatsString" "pStatsString"+ ("statsString" ::: Ptr CChar)+ -> io () freeStatsString allocator statsString = liftIO $ do (ffiVmaFreeStatsString) (allocator) (statsString) pure $ ()@@ -514,7 +568,15 @@ -- the specific type of resource you want to use it for. Please check -- parameters of your resource, like image layout (OPTIMAL versus LINEAR) -- or mip level count.-findMemoryTypeIndex :: forall io . MonadIO io => Allocator -> ("memoryTypeBits" ::: Word32) -> AllocationCreateInfo -> io (("memoryTypeIndex" ::: Word32))+findMemoryTypeIndex :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaFindMemoryTypeIndex" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaFindMemoryTypeIndex" "memoryTypeBits"+ ("memoryTypeBits" ::: Word32)+ -> -- No documentation found for Nested "vmaFindMemoryTypeIndex" "pAllocationCreateInfo"+ AllocationCreateInfo+ -> io (("memoryTypeIndex" ::: Word32)) findMemoryTypeIndex allocator memoryTypeBits allocationCreateInfo = liftIO . evalContT $ do pAllocationCreateInfo <- ContT $ withCStruct (allocationCreateInfo) pPMemoryTypeIndex <- ContT $ bracket (callocBytes @Word32 4) free@@ -529,7 +591,7 @@ unsafe #endif "vmaFindMemoryTypeIndexForBufferInfo" ffiVmaFindMemoryTypeIndexForBufferInfo- :: Allocator -> Ptr (BufferCreateInfo a) -> Ptr AllocationCreateInfo -> Ptr Word32 -> IO Result+ :: Allocator -> Ptr (SomeStruct BufferCreateInfo) -> Ptr AllocationCreateInfo -> Ptr Word32 -> IO Result -- | Helps to find memoryTypeIndex, given VkBufferCreateInfo and -- 'AllocationCreateInfo'.@@ -546,12 +608,20 @@ -- - 'findMemoryTypeIndex' -- -- - @vkDestroyBuffer@-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)+ => -- No documentation found for Nested "vmaFindMemoryTypeIndexForBufferInfo" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaFindMemoryTypeIndexForBufferInfo" "pBufferCreateInfo"+ (BufferCreateInfo a)+ -> -- No documentation found for Nested "vmaFindMemoryTypeIndexForBufferInfo" "pAllocationCreateInfo"+ AllocationCreateInfo+ -> io (("memoryTypeIndex" ::: Word32)) findMemoryTypeIndexForBufferInfo allocator bufferCreateInfo allocationCreateInfo = liftIO . evalContT $ do pBufferCreateInfo <- ContT $ withCStruct (bufferCreateInfo) pAllocationCreateInfo <- ContT $ withCStruct (allocationCreateInfo) pPMemoryTypeIndex <- ContT $ bracket (callocBytes @Word32 4) free- r <- lift $ (ffiVmaFindMemoryTypeIndexForBufferInfo) (allocator) pBufferCreateInfo pAllocationCreateInfo (pPMemoryTypeIndex)+ r <- lift $ (ffiVmaFindMemoryTypeIndexForBufferInfo) (allocator) (forgetExtensions pBufferCreateInfo) pAllocationCreateInfo (pPMemoryTypeIndex) lift $ when (r < SUCCESS) (throwIO (VulkanException r)) pMemoryTypeIndex <- lift $ peek @Word32 pPMemoryTypeIndex pure $ (pMemoryTypeIndex)@@ -562,7 +632,7 @@ unsafe #endif "vmaFindMemoryTypeIndexForImageInfo" ffiVmaFindMemoryTypeIndexForImageInfo- :: Allocator -> Ptr (ImageCreateInfo a) -> Ptr AllocationCreateInfo -> Ptr Word32 -> IO Result+ :: Allocator -> Ptr (SomeStruct ImageCreateInfo) -> Ptr AllocationCreateInfo -> Ptr Word32 -> IO Result -- | Helps to find memoryTypeIndex, given VkImageCreateInfo and -- 'AllocationCreateInfo'.@@ -579,12 +649,20 @@ -- - 'findMemoryTypeIndex' -- -- - @vkDestroyImage@-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)+ => -- No documentation found for Nested "vmaFindMemoryTypeIndexForImageInfo" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaFindMemoryTypeIndexForImageInfo" "pImageCreateInfo"+ (ImageCreateInfo a)+ -> -- No documentation found for Nested "vmaFindMemoryTypeIndexForImageInfo" "pAllocationCreateInfo"+ AllocationCreateInfo+ -> io (("memoryTypeIndex" ::: Word32)) findMemoryTypeIndexForImageInfo allocator imageCreateInfo allocationCreateInfo = liftIO . evalContT $ do pImageCreateInfo <- ContT $ withCStruct (imageCreateInfo) pAllocationCreateInfo <- ContT $ withCStruct (allocationCreateInfo) pPMemoryTypeIndex <- ContT $ bracket (callocBytes @Word32 4) free- r <- lift $ (ffiVmaFindMemoryTypeIndexForImageInfo) (allocator) pImageCreateInfo pAllocationCreateInfo (pPMemoryTypeIndex)+ r <- lift $ (ffiVmaFindMemoryTypeIndexForImageInfo) (allocator) (forgetExtensions pImageCreateInfo) pAllocationCreateInfo (pPMemoryTypeIndex) lift $ when (r < SUCCESS) (throwIO (VulkanException r)) pMemoryTypeIndex <- lift $ peek @Word32 pPMemoryTypeIndex pure $ (pMemoryTypeIndex)@@ -608,7 +686,13 @@ -- +-----------+-------------+-----------------------------------------------+ -- | out | pPool | Handle to created pool. | -- +-----------+-------------+-----------------------------------------------+-createPool :: forall io . MonadIO io => Allocator -> PoolCreateInfo -> io (Pool)+createPool :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaCreatePool" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaCreatePool" "pCreateInfo"+ PoolCreateInfo+ -> io (Pool) createPool allocator createInfo = liftIO . evalContT $ do pCreateInfo <- ContT $ withCStruct (createInfo) pPPool <- ContT $ bracket (callocBytes @Pool 8) free@@ -639,7 +723,13 @@ :: Allocator -> Pool -> IO () -- | Destroys 'Pool' object and frees Vulkan device memory.-destroyPool :: forall io . MonadIO io => Allocator -> Pool -> io ()+destroyPool :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaDestroyPool" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaDestroyPool" "pool"+ Pool+ -> io () destroyPool allocator pool = liftIO $ do (ffiVmaDestroyPool) (allocator) (pool) pure $ ()@@ -663,7 +753,13 @@ -- +-----------+------------+-----------------------------------------------+ -- | out | pPoolStats | Statistics of specified pool. | -- +-----------+------------+-----------------------------------------------+-getPoolStats :: forall io . MonadIO io => Allocator -> Pool -> io (PoolStats)+getPoolStats :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaGetPoolStats" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaGetPoolStats" "pool"+ Pool+ -> io (PoolStats) getPoolStats allocator pool = liftIO . evalContT $ do pPPoolStats <- ContT (withZeroCStruct @PoolStats) lift $ (ffiVmaGetPoolStats) (allocator) (pool) (pPPoolStats)@@ -692,7 +788,13 @@ -- | | | Optional - pass null if you don\'t need this | -- | | | information. | -- +-----------+----------------------+-----------------------------------------------+-makePoolAllocationsLost :: forall io . MonadIO io => Allocator -> Pool -> io (("lostAllocationCount" ::: Word64))+makePoolAllocationsLost :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaMakePoolAllocationsLost" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaMakePoolAllocationsLost" "pool"+ Pool+ -> io (("lostAllocationCount" ::: Word64)) makePoolAllocationsLost allocator pool = liftIO . evalContT $ do pPLostAllocationCount <- ContT $ bracket (callocBytes @CSize 8) free lift $ (ffiVmaMakePoolAllocationsLost) (allocator) (pool) (pPLostAllocationCount)@@ -728,7 +830,13 @@ -- allocations. @VMA_ASSERT@ is also fired in that case. -- -- - Other value: Error returned by Vulkan, e.g. memory mapping failure.-checkPoolCorruption :: forall io . MonadIO io => Allocator -> Pool -> io ()+checkPoolCorruption :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaCheckPoolCorruption" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaCheckPoolCorruption" "pool"+ Pool+ -> io () checkPoolCorruption allocator pool = liftIO $ do r <- (ffiVmaCheckPoolCorruption) (allocator) (pool) when (r < SUCCESS) (throwIO (VulkanException r))@@ -747,7 +855,13 @@ -- null-terminated string containing name of the pool that was previously -- set. The pointer becomes invalid when the pool is destroyed or its name -- is changed using 'setPoolName'.-getPoolName :: forall io . MonadIO io => Allocator -> Pool -> io (("name" ::: Ptr CChar))+getPoolName :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaGetPoolName" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaGetPoolName" "pool"+ Pool+ -> io (("name" ::: Ptr CChar)) getPoolName allocator pool = liftIO . evalContT $ do pPpName <- ContT $ bracket (callocBytes @(Ptr CChar) 8) free lift $ (ffiVmaGetPoolName) (allocator) (pool) (pPpName)@@ -767,7 +881,15 @@ -- @pName@ can be either null or pointer to a null-terminated string with -- new name for the pool. Function makes internal copy of the string, so it -- can be changed or freed immediately after this call.-setPoolName :: forall io . MonadIO io => Allocator -> Pool -> ("name" ::: Maybe ByteString) -> io ()+setPoolName :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaSetPoolName" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaSetPoolName" "pool"+ Pool+ -> -- No documentation found for Nested "vmaSetPoolName" "pName"+ ("name" ::: Maybe ByteString)+ -> io () setPoolName allocator pool name = liftIO . evalContT $ do pName <- case (name) of Nothing -> pure nullPtr@@ -800,7 +922,15 @@ -- It is recommended to use 'allocateMemoryForBuffer', -- 'allocateMemoryForImage', 'createBuffer', 'createImage' instead whenever -- possible.-allocateMemory :: forall io . MonadIO io => Allocator -> ("vkMemoryRequirements" ::: MemoryRequirements) -> AllocationCreateInfo -> io (Allocation, AllocationInfo)+allocateMemory :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaAllocateMemory" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaAllocateMemory" "pVkMemoryRequirements"+ ("vkMemoryRequirements" ::: MemoryRequirements)+ -> -- No documentation found for Nested "vmaAllocateMemory" "pCreateInfo"+ AllocationCreateInfo+ -> io (Allocation, AllocationInfo) allocateMemory allocator vkMemoryRequirements createInfo = liftIO . evalContT $ do pVkMemoryRequirements <- ContT $ withCStruct (vkMemoryRequirements) pCreateInfo <- ContT $ withCStruct (createInfo)@@ -868,7 +998,15 @@ -- allocations already made within this function call are also freed, so -- that when returned result is not @VK_SUCCESS@, @pAllocation@ array is -- always entirely filled with @VK_NULL_HANDLE@.-allocateMemoryPages :: forall io . MonadIO io => Allocator -> ("vkMemoryRequirements" ::: Vector MemoryRequirements) -> ("createInfo" ::: Vector AllocationCreateInfo) -> io (("allocations" ::: Vector Allocation), ("allocationInfo" ::: Vector AllocationInfo))+allocateMemoryPages :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaAllocateMemoryPages" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaAllocateMemoryPages" "pVkMemoryRequirements"+ ("vkMemoryRequirements" ::: Vector MemoryRequirements)+ -> -- No documentation found for Nested "vmaAllocateMemoryPages" "pCreateInfo"+ ("createInfo" ::: Vector AllocationCreateInfo)+ -> io (("allocations" ::: Vector Allocation), ("allocationInfo" ::: Vector AllocationInfo)) allocateMemoryPages allocator vkMemoryRequirements createInfo = liftIO . evalContT $ do pPVkMemoryRequirements <- ContT $ allocaBytesAligned @MemoryRequirements ((Data.Vector.length (vkMemoryRequirements)) * 24) 8 Data.Vector.imapM_ (\i e -> ContT $ pokeCStruct (pPVkMemoryRequirements `plusPtr` (24 * (i)) :: Ptr MemoryRequirements) (e) . ($ ())) (vkMemoryRequirements)@@ -918,7 +1056,15 @@ -- +-----------+-----------------+-----------------------------------------------+ -- -- You should free the memory using 'freeMemory'.-allocateMemoryForBuffer :: forall io . MonadIO io => Allocator -> Buffer -> AllocationCreateInfo -> io (Allocation, AllocationInfo)+allocateMemoryForBuffer :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaAllocateMemoryForBuffer" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaAllocateMemoryForBuffer" "buffer"+ Buffer+ -> -- No documentation found for Nested "vmaAllocateMemoryForBuffer" "pCreateInfo"+ AllocationCreateInfo+ -> io (Allocation, AllocationInfo) allocateMemoryForBuffer allocator buffer createInfo = liftIO . evalContT $ do pCreateInfo <- ContT $ withCStruct (createInfo) pPAllocation <- ContT $ bracket (callocBytes @Allocation 8) free@@ -951,7 +1097,15 @@ :: Allocator -> Image -> Ptr AllocationCreateInfo -> Ptr Allocation -> Ptr AllocationInfo -> IO Result -- | Function similar to 'allocateMemoryForBuffer'.-allocateMemoryForImage :: forall io . MonadIO io => Allocator -> Image -> AllocationCreateInfo -> io (Allocation, AllocationInfo)+allocateMemoryForImage :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaAllocateMemoryForImage" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaAllocateMemoryForImage" "image"+ Image+ -> -- No documentation found for Nested "vmaAllocateMemoryForImage" "pCreateInfo"+ AllocationCreateInfo+ -> io (Allocation, AllocationInfo) allocateMemoryForImage allocator image createInfo = liftIO . evalContT $ do pCreateInfo <- ContT $ withCStruct (createInfo) pPAllocation <- ContT $ bracket (callocBytes @Allocation 8) free@@ -988,7 +1142,13 @@ -- -- Passing @VK_NULL_HANDLE@ as @allocation@ is valid. Such function call is -- just skipped.-freeMemory :: forall io . MonadIO io => Allocator -> Allocation -> io ()+freeMemory :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaFreeMemory" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaFreeMemory" "allocation"+ Allocation+ -> io () freeMemory allocator allocation = liftIO $ do (ffiVmaFreeMemory) (allocator) (allocation) pure $ ()@@ -1013,7 +1173,13 @@ -- Allocations in @pAllocations@ array can come from any memory pools and -- types. Passing @VK_NULL_HANDLE@ as elements of @pAllocations@ array is -- valid. Such entries are just skipped.-freeMemoryPages :: forall io . MonadIO io => Allocator -> ("allocations" ::: Vector Allocation) -> io ()+freeMemoryPages :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaFreeMemoryPages" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaFreeMemoryPages" "pAllocations"+ ("allocations" ::: Vector Allocation)+ -> io () freeMemoryPages allocator allocations = liftIO . evalContT $ do pPAllocations <- ContT $ allocaBytesAligned @Allocation ((Data.Vector.length (allocations)) * 8) 8 lift $ Data.Vector.imapM_ (\i e -> poke (pPAllocations `plusPtr` (8 * (i)) :: Ptr Allocation) (e)) (allocations)@@ -1037,7 +1203,15 @@ -- only if @newSize@ equals current allocation\'s size. Otherwise returns -- @VK_ERROR_OUT_OF_POOL_MEMORY@, indicating that allocation\'s size could -- not be changed.-resizeAllocation :: forall io . MonadIO io => Allocator -> Allocation -> ("newSize" ::: DeviceSize) -> io ()+resizeAllocation :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaResizeAllocation" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaResizeAllocation" "allocation"+ Allocation+ -> -- No documentation found for Nested "vmaResizeAllocation" "newSize"+ ("newSize" ::: DeviceSize)+ -> io () resizeAllocation allocator allocation newSize = liftIO $ do r <- (ffiVmaResizeAllocation) (allocator) (allocation) (newSize) when (r < SUCCESS) (throwIO (VulkanException r))@@ -1069,7 +1243,13 @@ -- -- - If you just want to check if allocation is not lost, -- 'touchAllocation' will work faster.-getAllocationInfo :: forall io . MonadIO io => Allocator -> Allocation -> io (AllocationInfo)+getAllocationInfo :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaGetAllocationInfo" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaGetAllocationInfo" "allocation"+ Allocation+ -> io (AllocationInfo) getAllocationInfo allocator allocation = liftIO . evalContT $ do pPAllocationInfo <- ContT (withZeroCStruct @AllocationInfo) lift $ (ffiVmaGetAllocationInfo) (allocator) (allocation) (pPAllocationInfo)@@ -1102,7 +1282,13 @@ -- If the allocation has been created without -- 'ALLOCATION_CREATE_CAN_BECOME_LOST_BIT' flag, this function always -- returns @VK_TRUE@.-touchAllocation :: forall io . MonadIO io => Allocator -> Allocation -> io (Bool)+touchAllocation :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaTouchAllocation" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaTouchAllocation" "allocation"+ Allocation+ -> io (Bool) touchAllocation allocator allocation = liftIO $ do r <- (ffiVmaTouchAllocation) (allocator) (allocation) pure $ ((bool32ToBool r))@@ -1129,7 +1315,15 @@ -- copied to allocation\'s @pUserData@. It is opaque, so you can use it -- however you want - e.g. as a pointer, ordinal number or some handle to -- you own data.-setAllocationUserData :: forall io . MonadIO io => Allocator -> Allocation -> ("userData" ::: Ptr ()) -> io ()+setAllocationUserData :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaSetAllocationUserData" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaSetAllocationUserData" "allocation"+ Allocation+ -> -- No documentation found for Nested "vmaSetAllocationUserData" "pUserData"+ ("userData" ::: Ptr ())+ -> io () setAllocationUserData allocator allocation userData = liftIO $ do (ffiVmaSetAllocationUserData) (allocator) (allocation) (userData) pure $ ()@@ -1151,7 +1345,11 @@ -- Returned allocation is not tied to any specific memory pool or memory -- type and not bound to any image or buffer. It has size = 0. It cannot be -- turned into a real, non-empty allocation.-createLostAllocation :: forall io . MonadIO io => Allocator -> io (Allocation)+createLostAllocation :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaCreateLostAllocation" "allocator"+ Allocator+ -> io (Allocation) createLostAllocation allocator = liftIO . evalContT $ do pPAllocation <- ContT $ bracket (callocBytes @Allocation 8) free lift $ (ffiVmaCreateLostAllocation) (allocator) (pPAllocation)@@ -1219,7 +1417,13 @@ -- allocation is made from a memory types that is not @HOST_COHERENT@, you -- also need to use 'invalidateAllocation' \/ 'flushAllocation', as -- required by Vulkan specification.-mapMemory :: forall io . MonadIO io => Allocator -> Allocation -> io (("data" ::: Ptr ()))+mapMemory :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaMapMemory" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaMapMemory" "allocation"+ Allocation+ -> io (("data" ::: Ptr ())) mapMemory allocator allocation = liftIO . evalContT $ do pPpData <- ContT $ bracket (callocBytes @(Ptr ()) 8) free r <- lift $ (ffiVmaMapMemory) (allocator) (allocation) (pPpData)@@ -1257,7 +1461,13 @@ -- allocation is made from a memory types that is not @HOST_COHERENT@, you -- also need to use 'invalidateAllocation' \/ 'flushAllocation', as -- required by Vulkan specification.-unmapMemory :: forall io . MonadIO io => Allocator -> Allocation -> io ()+unmapMemory :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaUnmapMemory" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaUnmapMemory" "allocation"+ Allocation+ -> io () unmapMemory allocator allocation = liftIO $ do (ffiVmaUnmapMemory) (allocator) (allocation) pure $ ()@@ -1297,7 +1507,17 @@ -- -- This function returns the @VkResult@ from @vkFlushMappedMemoryRanges@ if -- it is called, otherwise @VK_SUCCESS@.-flushAllocation :: forall io . MonadIO io => Allocator -> Allocation -> ("offset" ::: DeviceSize) -> DeviceSize -> io ()+flushAllocation :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaFlushAllocation" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaFlushAllocation" "allocation"+ Allocation+ -> -- No documentation found for Nested "vmaFlushAllocation" "offset"+ ("offset" ::: DeviceSize)+ -> -- No documentation found for Nested "vmaFlushAllocation" "size"+ DeviceSize+ -> io () flushAllocation allocator allocation offset size = liftIO $ do r <- (ffiVmaFlushAllocation) (allocator) (allocation) (offset) (size) when (r < SUCCESS) (throwIO (VulkanException r))@@ -1338,7 +1558,17 @@ -- This function returns the @VkResult@ from -- @vkInvalidateMappedMemoryRanges@ if it is called, otherwise -- @VK_SUCCESS@.-invalidateAllocation :: forall io . MonadIO io => Allocator -> Allocation -> ("offset" ::: DeviceSize) -> DeviceSize -> io ()+invalidateAllocation :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaInvalidateAllocation" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaInvalidateAllocation" "allocation"+ Allocation+ -> -- No documentation found for Nested "vmaInvalidateAllocation" "offset"+ ("offset" ::: DeviceSize)+ -> -- No documentation found for Nested "vmaInvalidateAllocation" "size"+ DeviceSize+ -> io () invalidateAllocation allocator allocation offset size = liftIO $ do r <- (ffiVmaInvalidateAllocation) (allocator) (allocation) (offset) (size) when (r < SUCCESS) (throwIO (VulkanException r))@@ -1378,7 +1608,17 @@ -- -- This function returns the @VkResult@ from @vkFlushMappedMemoryRanges@ if -- it is called, otherwise @VK_SUCCESS@.-flushAllocations :: forall io . MonadIO io => Allocator -> ("allocations" ::: Vector Allocation) -> ("offsets" ::: Vector DeviceSize) -> ("sizes" ::: Vector DeviceSize) -> io ()+flushAllocations :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaFlushAllocations" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaFlushAllocations" "allocations"+ ("allocations" ::: Vector Allocation)+ -> -- No documentation found for Nested "vmaFlushAllocations" "offsets"+ ("offsets" ::: Vector DeviceSize)+ -> -- No documentation found for Nested "vmaFlushAllocations" "sizes"+ ("sizes" ::: Vector DeviceSize)+ -> io () flushAllocations allocator allocations offsets sizes = liftIO . evalContT $ do let allocationsLength = Data.Vector.length $ (allocations) let offsetsLength = Data.Vector.length $ (offsets)@@ -1440,7 +1680,17 @@ -- This function returns the @VkResult@ from -- @vkInvalidateMappedMemoryRanges@ if it is called, otherwise -- @VK_SUCCESS@.-invalidateAllocations :: forall io . MonadIO io => Allocator -> ("allocations" ::: Vector Allocation) -> ("offsets" ::: Vector DeviceSize) -> ("sizes" ::: Vector DeviceSize) -> io ()+invalidateAllocations :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaInvalidateAllocations" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaInvalidateAllocations" "allocations"+ ("allocations" ::: Vector Allocation)+ -> -- No documentation found for Nested "vmaInvalidateAllocations" "offsets"+ ("offsets" ::: Vector DeviceSize)+ -> -- No documentation found for Nested "vmaInvalidateAllocations" "sizes"+ ("sizes" ::: Vector DeviceSize)+ -> io () invalidateAllocations allocator allocations offsets sizes = liftIO . evalContT $ do let allocationsLength = Data.Vector.length $ (allocations) let offsetsLength = Data.Vector.length $ (offsets)@@ -1502,7 +1752,13 @@ -- allocations. @VMA_ASSERT@ is also fired in that case. -- -- - Other value: Error returned by Vulkan, e.g. memory mapping failure.-checkCorruption :: forall io . MonadIO io => Allocator -> ("memoryTypeBits" ::: Word32) -> io ()+checkCorruption :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaCheckCorruption" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaCheckCorruption" "memoryTypeBits"+ ("memoryTypeBits" ::: Word32)+ -> io () checkCorruption allocator memoryTypeBits = liftIO $ do r <- (ffiVmaCheckCorruption) (allocator) (memoryTypeBits) when (r < SUCCESS) (throwIO (VulkanException r))@@ -1567,7 +1823,13 @@ -- -- For more information and important limitations regarding -- defragmentation, see documentation chapter: /Defragmentation/.-defragmentationBegin :: forall io . MonadIO io => Allocator -> DefragmentationInfo2 -> io (Result, DefragmentationStats, DefragmentationContext)+defragmentationBegin :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaDefragmentationBegin" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaDefragmentationBegin" "pInfo"+ DefragmentationInfo2+ -> io (Result, DefragmentationStats, DefragmentationContext) defragmentationBegin allocator info = liftIO . evalContT $ do pInfo <- ContT $ withCStruct (info) pPStats <- ContT (withZeroCStruct @DefragmentationStats)@@ -1604,7 +1866,13 @@ -- Use this function to finish defragmentation started by -- 'defragmentationBegin'. It is safe to pass @context == null@. The -- function then does nothing.-defragmentationEnd :: forall io . MonadIO io => Allocator -> DefragmentationContext -> io ()+defragmentationEnd :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaDefragmentationEnd" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaDefragmentationEnd" "context"+ DefragmentationContext+ -> io () defragmentationEnd allocator context = liftIO $ do r <- (ffiVmaDefragmentationEnd) (allocator) (context) when (r < SUCCESS) (throwIO (VulkanException r))@@ -1618,7 +1886,13 @@ :: Allocator -> DefragmentationContext -> Ptr DefragmentationPassInfo -> IO Result -beginDefragmentationPass :: forall io . MonadIO io => Allocator -> DefragmentationContext -> io (DefragmentationPassInfo)+beginDefragmentationPass :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaBeginDefragmentationPass" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaBeginDefragmentationPass" "context"+ DefragmentationContext+ -> io (DefragmentationPassInfo) beginDefragmentationPass allocator context = liftIO . evalContT $ do pPInfo <- ContT (withZeroCStruct @DefragmentationPassInfo) r <- lift $ (ffiVmaBeginDefragmentationPass) (allocator) (context) (pPInfo)@@ -1648,7 +1922,13 @@ :: Allocator -> DefragmentationContext -> IO Result -endDefragmentationPass :: forall io . MonadIO io => Allocator -> DefragmentationContext -> io ()+endDefragmentationPass :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaEndDefragmentationPass" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaEndDefragmentationPass" "context"+ DefragmentationContext+ -> io () endDefragmentationPass allocator context = liftIO $ do r <- (ffiVmaEndDefragmentationPass) (allocator) (context) when (r < SUCCESS) (throwIO (VulkanException r))@@ -1732,7 +2012,15 @@ -- but you should measure that on your platform. -- -- For more information, see /Defragmentation/ chapter.-defragment :: forall io . MonadIO io => Allocator -> ("allocations" ::: Vector Allocation) -> ("defragmentationInfo" ::: Maybe DefragmentationInfo) -> io (("allocationsChanged" ::: Vector Bool), DefragmentationStats)+defragment :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaDefragment" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaDefragment" "pAllocations"+ ("allocations" ::: Vector Allocation)+ -> -- No documentation found for Nested "vmaDefragment" "pDefragmentationInfo"+ ("defragmentationInfo" ::: Maybe DefragmentationInfo)+ -> io (("allocationsChanged" ::: Vector Bool), DefragmentationStats) defragment allocator allocations defragmentationInfo = liftIO . evalContT $ do pPAllocations <- ContT $ allocaBytesAligned @Allocation ((Data.Vector.length (allocations)) * 8) 8 lift $ Data.Vector.imapM_ (\i e -> poke (pPAllocations `plusPtr` (8 * (i)) :: Ptr Allocation) (e)) (allocations)@@ -1770,7 +2058,15 @@ -- Vulkan). -- -- It is recommended to use function 'createBuffer' instead of this one.-bindBufferMemory :: forall io . MonadIO io => Allocator -> Allocation -> Buffer -> io ()+bindBufferMemory :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaBindBufferMemory" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaBindBufferMemory" "allocation"+ Allocation+ -> -- No documentation found for Nested "vmaBindBufferMemory" "buffer"+ Buffer+ -> io () bindBufferMemory allocator allocation buffer = liftIO $ do r <- (ffiVmaBindBufferMemory) (allocator) (allocation) (buffer) when (r < SUCCESS) (throwIO (VulkanException r))@@ -1804,7 +2100,19 @@ -- 'ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT' flag or with -- /VmaAllocatorCreateInfo::vulkanApiVersion/ @== VK_API_VERSION_1_1@. -- Otherwise the call fails.-bindBufferMemory2 :: forall io . MonadIO io => Allocator -> Allocation -> ("allocationLocalOffset" ::: DeviceSize) -> Buffer -> ("next" ::: Ptr ()) -> io ()+bindBufferMemory2 :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaBindBufferMemory2" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaBindBufferMemory2" "allocation"+ Allocation+ -> -- No documentation found for Nested "vmaBindBufferMemory2" "allocationLocalOffset"+ ("allocationLocalOffset" ::: DeviceSize)+ -> -- No documentation found for Nested "vmaBindBufferMemory2" "buffer"+ Buffer+ -> -- No documentation found for Nested "vmaBindBufferMemory2" "pNext"+ ("next" ::: Ptr ())+ -> io () bindBufferMemory2 allocator allocation allocationLocalOffset buffer next = liftIO $ do r <- (ffiVmaBindBufferMemory2) (allocator) (allocation) (allocationLocalOffset) (buffer) (next) when (r < SUCCESS) (throwIO (VulkanException r))@@ -1830,7 +2138,15 @@ -- Vulkan). -- -- It is recommended to use function 'createImage' instead of this one.-bindImageMemory :: forall io . MonadIO io => Allocator -> Allocation -> Image -> io ()+bindImageMemory :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaBindImageMemory" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaBindImageMemory" "allocation"+ Allocation+ -> -- No documentation found for Nested "vmaBindImageMemory" "image"+ Image+ -> io () bindImageMemory allocator allocation image = liftIO $ do r <- (ffiVmaBindImageMemory) (allocator) (allocation) (image) when (r < SUCCESS) (throwIO (VulkanException r))@@ -1864,7 +2180,19 @@ -- 'ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT' flag or with -- /VmaAllocatorCreateInfo::vulkanApiVersion/ @== VK_API_VERSION_1_1@. -- Otherwise the call fails.-bindImageMemory2 :: forall io . MonadIO io => Allocator -> Allocation -> ("allocationLocalOffset" ::: DeviceSize) -> Image -> ("next" ::: Ptr ()) -> io ()+bindImageMemory2 :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaBindImageMemory2" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaBindImageMemory2" "allocation"+ Allocation+ -> -- No documentation found for Nested "vmaBindImageMemory2" "allocationLocalOffset"+ ("allocationLocalOffset" ::: DeviceSize)+ -> -- No documentation found for Nested "vmaBindImageMemory2" "image"+ Image+ -> -- No documentation found for Nested "vmaBindImageMemory2" "pNext"+ ("next" ::: Ptr ())+ -> io () bindImageMemory2 allocator allocation allocationLocalOffset image next = liftIO $ do r <- (ffiVmaBindImageMemory2) (allocator) (allocation) (allocationLocalOffset) (image) (next) when (r < SUCCESS) (throwIO (VulkanException r))@@ -1875,7 +2203,7 @@ unsafe #endif "vmaCreateBuffer" ffiVmaCreateBuffer- :: Allocator -> Ptr (BufferCreateInfo a) -> Ptr AllocationCreateInfo -> Ptr Buffer -> Ptr Allocation -> Ptr AllocationInfo -> IO Result+ :: Allocator -> Ptr (SomeStruct BufferCreateInfo) -> Ptr AllocationCreateInfo -> Ptr Buffer -> Ptr Allocation -> Ptr AllocationInfo -> IO Result -- | __Parameters.__ --@@ -1914,14 +2242,22 @@ -- VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT is not used), it creates -- dedicated allocation for this buffer, just like when using -- VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.-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)+ => -- No documentation found for Nested "vmaCreateBuffer" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaCreateBuffer" "pBufferCreateInfo"+ (BufferCreateInfo a)+ -> -- No documentation found for Nested "vmaCreateBuffer" "pAllocationCreateInfo"+ AllocationCreateInfo+ -> io (Buffer, Allocation, AllocationInfo) createBuffer allocator bufferCreateInfo allocationCreateInfo = liftIO . evalContT $ do pBufferCreateInfo <- ContT $ withCStruct (bufferCreateInfo) pAllocationCreateInfo <- ContT $ withCStruct (allocationCreateInfo) pPBuffer <- ContT $ bracket (callocBytes @Buffer 8) free pPAllocation <- ContT $ bracket (callocBytes @Allocation 8) free pPAllocationInfo <- ContT (withZeroCStruct @AllocationInfo)- r <- lift $ (ffiVmaCreateBuffer) (allocator) pBufferCreateInfo pAllocationCreateInfo (pPBuffer) (pPAllocation) (pPAllocationInfo)+ r <- lift $ (ffiVmaCreateBuffer) (allocator) (forgetExtensions pBufferCreateInfo) pAllocationCreateInfo (pPBuffer) (pPAllocation) (pPAllocationInfo) lift $ when (r < SUCCESS) (throwIO (VulkanException r)) pBuffer <- lift $ peek @Buffer pPBuffer pAllocation <- lift $ peek @Allocation pPAllocation@@ -1958,7 +2294,15 @@ -- @ -- -- It it safe to pass null as buffer and\/or allocation.-destroyBuffer :: forall io . MonadIO io => Allocator -> Buffer -> Allocation -> io ()+destroyBuffer :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaDestroyBuffer" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaDestroyBuffer" "buffer"+ Buffer+ -> -- No documentation found for Nested "vmaDestroyBuffer" "allocation"+ Allocation+ -> io () destroyBuffer allocator buffer allocation = liftIO $ do (ffiVmaDestroyBuffer) (allocator) (buffer) (allocation) pure $ ()@@ -1969,17 +2313,25 @@ unsafe #endif "vmaCreateImage" ffiVmaCreateImage- :: Allocator -> Ptr (ImageCreateInfo a) -> Ptr AllocationCreateInfo -> Ptr Image -> Ptr Allocation -> Ptr AllocationInfo -> IO Result+ :: Allocator -> Ptr (SomeStruct ImageCreateInfo) -> Ptr AllocationCreateInfo -> Ptr Image -> Ptr Allocation -> Ptr AllocationInfo -> IO Result -- | Function similar to 'createBuffer'.-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)+ => -- No documentation found for Nested "vmaCreateImage" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaCreateImage" "pImageCreateInfo"+ (ImageCreateInfo a)+ -> -- No documentation found for Nested "vmaCreateImage" "pAllocationCreateInfo"+ AllocationCreateInfo+ -> io (Image, Allocation, AllocationInfo) createImage allocator imageCreateInfo allocationCreateInfo = liftIO . evalContT $ do pImageCreateInfo <- ContT $ withCStruct (imageCreateInfo) pAllocationCreateInfo <- ContT $ withCStruct (allocationCreateInfo) pPImage <- ContT $ bracket (callocBytes @Image 8) free pPAllocation <- ContT $ bracket (callocBytes @Allocation 8) free pPAllocationInfo <- ContT (withZeroCStruct @AllocationInfo)- r <- lift $ (ffiVmaCreateImage) (allocator) pImageCreateInfo pAllocationCreateInfo (pPImage) (pPAllocation) (pPAllocationInfo)+ r <- lift $ (ffiVmaCreateImage) (allocator) (forgetExtensions pImageCreateInfo) pAllocationCreateInfo (pPImage) (pPAllocation) (pPAllocationInfo) lift $ when (r < SUCCESS) (throwIO (VulkanException r)) pImage <- lift $ peek @Image pPImage pAllocation <- lift $ peek @Allocation pPAllocation@@ -2016,7 +2368,15 @@ -- @ -- -- It it safe to pass null as image and\/or allocation.-destroyImage :: forall io . MonadIO io => Allocator -> Image -> Allocation -> io ()+destroyImage :: forall io+ . (MonadIO io)+ => -- No documentation found for Nested "vmaDestroyImage" "allocator"+ Allocator+ -> -- No documentation found for Nested "vmaDestroyImage" "image"+ Image+ -> -- No documentation found for Nested "vmaDestroyImage" "allocation"+ Allocation+ -> io () destroyImage allocator image allocation = liftIO $ do (ffiVmaDestroyImage) (allocator) (image) (allocation) pure $ ()@@ -2177,6 +2537,9 @@ userData :: Ptr () } deriving (Typeable)+#if defined(GENERIC_INSTANCES)+deriving instance Generic (DeviceMemoryCallbacks)+#endif deriving instance Show DeviceMemoryCallbacks instance ToCStruct DeviceMemoryCallbacks where@@ -2403,7 +2766,10 @@ , -- No documentation found for Nested "VmaVulkanFunctions" "vkGetPhysicalDeviceMemoryProperties2KHR" vkGetPhysicalDeviceMemoryProperties2KHR :: PFN_vkGetPhysicalDeviceMemoryProperties2KHR }- deriving (Typeable)+ deriving (Typeable, Eq)+#if defined(GENERIC_INSTANCES)+deriving instance Generic (VulkanFunctions)+#endif deriving instance Show VulkanFunctions instance ToCStruct VulkanFunctions where@@ -2537,6 +2903,9 @@ filePath :: ByteString } deriving (Typeable)+#if defined(GENERIC_INSTANCES)+deriving instance Generic (RecordSettings)+#endif deriving instance Show RecordSettings instance ToCStruct RecordSettings where@@ -2671,6 +3040,9 @@ vulkanApiVersion :: Word32 } deriving (Typeable)+#if defined(GENERIC_INSTANCES)+deriving instance Generic (AllocatorCreateInfo)+#endif deriving instance Show AllocatorCreateInfo instance ToCStruct AllocatorCreateInfo where@@ -2770,7 +3142,10 @@ -- /VmaAllocatorCreateInfo::device/. device :: Ptr Device_T }- deriving (Typeable)+ deriving (Typeable, Eq)+#if defined(GENERIC_INSTANCES)+deriving instance Generic (AllocatorInfo)+#endif deriving instance Show AllocatorInfo instance ToCStruct AllocatorInfo where@@ -2836,7 +3211,10 @@ , unusedRangeSizeMax :: DeviceSize }- deriving (Typeable)+ deriving (Typeable, Eq)+#if defined(GENERIC_INSTANCES)+deriving instance Generic (StatInfo)+#endif deriving instance Show StatInfo instance ToCStruct StatInfo where@@ -2941,6 +3319,9 @@ total :: StatInfo } deriving (Typeable)+#if defined(GENERIC_INSTANCES)+deriving instance Generic (Stats)+#endif deriving instance Show Stats instance ToCStruct Stats where@@ -3025,7 +3406,10 @@ -- problems. budget :: DeviceSize }- deriving (Typeable)+ deriving (Typeable, Eq)+#if defined(GENERIC_INSTANCES)+deriving instance Generic (Budget)+#endif deriving instance Show Budget instance ToCStruct Budget where@@ -3384,6 +3768,9 @@ userData :: Ptr () } deriving (Typeable)+#if defined(GENERIC_INSTANCES)+deriving instance Generic (AllocationCreateInfo)+#endif deriving instance Show AllocationCreateInfo instance ToCStruct AllocationCreateInfo where@@ -3559,7 +3946,10 @@ -- frame to become lost, set this value to 0. frameInUseCount :: Word32 }- deriving (Typeable)+ deriving (Typeable, Eq)+#if defined(GENERIC_INSTANCES)+deriving instance Generic (PoolCreateInfo)+#endif deriving instance Show PoolCreateInfo instance ToCStruct PoolCreateInfo where@@ -3635,7 +4025,10 @@ , -- | Number of @VkDeviceMemory@ blocks allocated for this pool. blockCount :: Word64 }- deriving (Typeable)+ deriving (Typeable, Eq)+#if defined(GENERIC_INSTANCES)+deriving instance Generic (PoolStats)+#endif deriving instance Show PoolStats instance ToCStruct PoolStats where@@ -3762,6 +4155,9 @@ userData :: Ptr () } deriving (Typeable)+#if defined(GENERIC_INSTANCES)+deriving instance Generic (AllocationInfo)+#endif deriving instance Show AllocationInfo instance ToCStruct AllocationInfo where@@ -3920,6 +4316,9 @@ commandBuffer :: Ptr CommandBuffer_T } deriving (Typeable)+#if defined(GENERIC_INSTANCES)+deriving instance Generic (DefragmentationInfo2)+#endif deriving instance Show DefragmentationInfo2 instance ToCStruct DefragmentationInfo2 where@@ -3997,7 +4396,10 @@ , offset :: DeviceSize }- deriving (Typeable)+ deriving (Typeable, Eq)+#if defined(GENERIC_INSTANCES)+deriving instance Generic (DefragmentationPassMoveInfo)+#endif deriving instance Show DefragmentationPassMoveInfo instance ToCStruct DefragmentationPassMoveInfo where@@ -4047,7 +4449,10 @@ , moves :: Ptr DefragmentationPassMoveInfo }- deriving (Typeable)+ deriving (Typeable, Eq)+#if defined(GENERIC_INSTANCES)+deriving instance Generic (DefragmentationPassInfo)+#endif deriving instance Show DefragmentationPassInfo instance ToCStruct DefragmentationPassInfo where@@ -4102,7 +4507,10 @@ -- Default is @UINT32_MAX@, which means no limit. maxAllocationsToMove :: Word32 }- deriving (Typeable)+ deriving (Typeable, Eq)+#if defined(GENERIC_INSTANCES)+deriving instance Generic (DefragmentationInfo)+#endif deriving instance Show DefragmentationInfo instance ToCStruct DefragmentationInfo where@@ -4153,7 +4561,10 @@ -- system. deviceMemoryBlocksFreed :: Word32 }- deriving (Typeable)+ deriving (Typeable, Eq)+#if defined(GENERIC_INSTANCES)+deriving instance Generic (DefragmentationStats)+#endif deriving instance Show DefragmentationStats instance ToCStruct DefragmentationStats where