From 4cbe8d21f5ba0917c25f43c66746d5d775272568 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 17 Oct 2023 17:31:33 +0800 Subject: [PATCH 1/3] Bump VMA --- VulkanMemoryAllocator/VulkanMemoryAllocator | 2 +- .../src/VulkanMemoryAllocator.hs | 35 ++++++++++++++++--- generate-new/readme.md | 2 ++ 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/VulkanMemoryAllocator/VulkanMemoryAllocator b/VulkanMemoryAllocator/VulkanMemoryAllocator index 413fc4f98..2f382df21 160000 --- a/VulkanMemoryAllocator/VulkanMemoryAllocator +++ b/VulkanMemoryAllocator/VulkanMemoryAllocator @@ -1 +1 @@ -Subproject commit 413fc4f98812994e295d05491254823a8ba89400 +Subproject commit 2f382df218d7e8516dee3b3caccb819a62b571a2 diff --git a/VulkanMemoryAllocator/src/VulkanMemoryAllocator.hs b/VulkanMemoryAllocator/src/VulkanMemoryAllocator.hs index a6e87489e..8d44e32d5 100644 --- a/VulkanMemoryAllocator/src/VulkanMemoryAllocator.hs +++ b/VulkanMemoryAllocator/src/VulkanMemoryAllocator.hs @@ -175,6 +175,8 @@ module VulkanMemoryAllocator ( createAllocator , AllocationCreateInfo(..) , PoolCreateInfo(..) , AllocationInfo(..) + , PFN_vmaCheckDefragmentationBreakFunction + , FN_vmaCheckDefragmentationBreakFunction , DefragmentationInfo(..) , DefragmentationMove(..) , DefragmentationPassMoveInfo(..) @@ -5545,6 +5547,11 @@ instance Zero AllocationInfo where Nothing +type FN_vmaCheckDefragmentationBreakFunction = ("pUserData" ::: Ptr ()) -> IO Bool32 +-- No documentation found for TopLevel "PFN_vmaCheckDefragmentationBreakFunction" +type PFN_vmaCheckDefragmentationBreakFunction = FunPtr FN_vmaCheckDefragmentationBreakFunction + + -- | VmaDefragmentationInfo -- -- Parameters for defragmentation. @@ -5567,22 +5574,31 @@ data DefragmentationInfo = DefragmentationInfo -- -- @0@ means no limit. maxAllocationsPerPass :: Word32 + , -- | Optional custom callback for stopping 'beginDefragmentation'. + -- + -- Have to return true for breaking current defragmentation pass. + pfnBreakCallback :: PFN_vmaCheckDefragmentationBreakFunction + , -- | Optional data to pass to custom callback for stopping pass of + -- defragmentation. + breakCallbackUserData :: Ptr () } - deriving (Typeable, Eq) + deriving (Typeable) #if defined(GENERIC_INSTANCES) deriving instance Generic (DefragmentationInfo) #endif deriving instance Show DefragmentationInfo instance ToCStruct DefragmentationInfo where - withCStruct x f = allocaBytes 32 $ \p -> pokeCStruct p x (f p) + withCStruct x f = allocaBytes 48 $ \p -> pokeCStruct p x (f p) pokeCStruct p DefragmentationInfo{..} f = do poke ((p `plusPtr` 0 :: Ptr DefragmentationFlags)) (flags) poke ((p `plusPtr` 8 :: Ptr Pool)) (pool) poke ((p `plusPtr` 16 :: Ptr DeviceSize)) (maxBytesPerPass) poke ((p `plusPtr` 24 :: Ptr Word32)) (maxAllocationsPerPass) + poke ((p `plusPtr` 32 :: Ptr PFN_vmaCheckDefragmentationBreakFunction)) (pfnBreakCallback) + poke ((p `plusPtr` 40 :: Ptr (Ptr ()))) (breakCallbackUserData) f - cStructSize = 32 + cStructSize = 48 cStructAlignment = 8 pokeZeroCStruct p f = do poke ((p `plusPtr` 0 :: Ptr DefragmentationFlags)) (zero) @@ -5596,11 +5612,18 @@ instance FromCStruct DefragmentationInfo where pool <- peek @Pool ((p `plusPtr` 8 :: Ptr Pool)) maxBytesPerPass <- peek @DeviceSize ((p `plusPtr` 16 :: Ptr DeviceSize)) maxAllocationsPerPass <- peek @Word32 ((p `plusPtr` 24 :: Ptr Word32)) + pfnBreakCallback <- peek @PFN_vmaCheckDefragmentationBreakFunction ((p `plusPtr` 32 :: Ptr PFN_vmaCheckDefragmentationBreakFunction)) + pBreakCallbackUserData <- peek @(Ptr ()) ((p `plusPtr` 40 :: Ptr (Ptr ()))) pure $ DefragmentationInfo - flags pool maxBytesPerPass maxAllocationsPerPass + flags + pool + maxBytesPerPass + maxAllocationsPerPass + pfnBreakCallback + pBreakCallbackUserData instance Storable DefragmentationInfo where - sizeOf ~_ = 32 + sizeOf ~_ = 48 alignment ~_ = 8 peek = peekCStruct poke ptr poked = pokeCStruct ptr poked (pure ()) @@ -5611,6 +5634,8 @@ instance Zero DefragmentationInfo where zero zero zero + zero + zero -- | VmaDefragmentationMove diff --git a/generate-new/readme.md b/generate-new/readme.md index 5a1cc72d4..2ffda9427 100644 --- a/generate-new/readme.md +++ b/generate-new/readme.md @@ -36,6 +36,8 @@ In an environment with `doxygen` (`nix-shell -p doxygen`), in the sed -i -e 's|^GENERATE_DOCBOOK.*|GENERATE_DOCBOOK=YES|' \ -e 's|^BRIEF_MEMBER_DESC.*|BRIEF_MEMBER_DESC=NO|' \ -e 's|^PREDEFINED *=|PREDEFINED = VMA_STATS_STRING_ENABLED=1 |' \ + -e 's|^PREDEFINED *=|PREDEFINED = VMA_EXTENDS_VK_STRUCT(s)=s |' \ + -e 's|@CMAKE_SOURCE_DIR@/||' \ Doxyfile && doxygen Doxyfile) ``` From e71dcf463c55c36cfd0827707ee8b8520e3479a9 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 17 Oct 2023 17:32:32 +0800 Subject: [PATCH 2/3] bump vma changelog --- VulkanMemoryAllocator/changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/VulkanMemoryAllocator/changelog.md b/VulkanMemoryAllocator/changelog.md index da5c2c7b5..eb3c24ae7 100644 --- a/VulkanMemoryAllocator/changelog.md +++ b/VulkanMemoryAllocator/changelog.md @@ -1,6 +1,7 @@ # Change Log ## WIP +- Bump VMA ## [0.10.5.1] - 2023-10-17 - Raise upper bound on `vulkan` From 5a7ea545a6d1cf98d60678023ebe18b8a8bf3081 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 17 Oct 2023 17:33:18 +0800 Subject: [PATCH 3/3] vma-v0.11 - Bump VMA --- VulkanMemoryAllocator/VulkanMemoryAllocator.cabal | 2 +- VulkanMemoryAllocator/changelog.md | 2 ++ VulkanMemoryAllocator/package.yaml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/VulkanMemoryAllocator/VulkanMemoryAllocator.cabal b/VulkanMemoryAllocator/VulkanMemoryAllocator.cabal index e9f4a38da..d4f26a21e 100644 --- a/VulkanMemoryAllocator/VulkanMemoryAllocator.cabal +++ b/VulkanMemoryAllocator/VulkanMemoryAllocator.cabal @@ -5,7 +5,7 @@ cabal-version: 2.2 -- see: https://github.com/sol/hpack name: VulkanMemoryAllocator -version: 0.10.5.1 +version: 0.11 synopsis: Bindings to the VulkanMemoryAllocator library category: Graphics homepage: https://github.com/expipiplus1/vulkan#readme diff --git a/VulkanMemoryAllocator/changelog.md b/VulkanMemoryAllocator/changelog.md index eb3c24ae7..1ceb00c23 100644 --- a/VulkanMemoryAllocator/changelog.md +++ b/VulkanMemoryAllocator/changelog.md @@ -1,6 +1,8 @@ # Change Log ## WIP + +## [0.11] - 2023-10-17 - Bump VMA ## [0.10.5.1] - 2023-10-17 diff --git a/VulkanMemoryAllocator/package.yaml b/VulkanMemoryAllocator/package.yaml index c1f43482c..54b75d255 100644 --- a/VulkanMemoryAllocator/package.yaml +++ b/VulkanMemoryAllocator/package.yaml @@ -1,5 +1,5 @@ name: VulkanMemoryAllocator -version: "0.10.5.1" +version: "0.11" synopsis: Bindings to the VulkanMemoryAllocator library category: Graphics maintainer: Ellie Hermaszewska