Skip to content

Commit 432af58

Browse files
authored
Merge pull request #482 from expipiplus1/bump-vma
Bump VMA
2 parents d22123a + 5a7ea54 commit 432af58

File tree

6 files changed

+38
-8
lines changed

6 files changed

+38
-8
lines changed

VulkanMemoryAllocator/VulkanMemoryAllocator.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cabal-version: 2.2
55
-- see: https://github.com/sol/hpack
66

77
name: VulkanMemoryAllocator
8-
version: 0.10.5.1
8+
version: 0.11
99
synopsis: Bindings to the VulkanMemoryAllocator library
1010
category: Graphics
1111
homepage: https://github.com/expipiplus1/vulkan#readme

VulkanMemoryAllocator/changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## WIP
44

5+
## [0.11] - 2023-10-17
6+
- Bump VMA
7+
58
## [0.10.5.1] - 2023-10-17
69
- Raise upper bound on `vulkan`
710

VulkanMemoryAllocator/package.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: VulkanMemoryAllocator
2-
version: "0.10.5.1"
2+
version: "0.11"
33
synopsis: Bindings to the VulkanMemoryAllocator library
44
category: Graphics
55
maintainer: Ellie Hermaszewska <live.long.and.prosper@monoid.al>

VulkanMemoryAllocator/src/VulkanMemoryAllocator.hs

+30-5
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ module VulkanMemoryAllocator ( createAllocator
175175
, AllocationCreateInfo(..)
176176
, PoolCreateInfo(..)
177177
, AllocationInfo(..)
178+
, PFN_vmaCheckDefragmentationBreakFunction
179+
, FN_vmaCheckDefragmentationBreakFunction
178180
, DefragmentationInfo(..)
179181
, DefragmentationMove(..)
180182
, DefragmentationPassMoveInfo(..)
@@ -5545,6 +5547,11 @@ instance Zero AllocationInfo where
55455547
Nothing
55465548

55475549

5550+
type FN_vmaCheckDefragmentationBreakFunction = ("pUserData" ::: Ptr ()) -> IO Bool32
5551+
-- No documentation found for TopLevel "PFN_vmaCheckDefragmentationBreakFunction"
5552+
type PFN_vmaCheckDefragmentationBreakFunction = FunPtr FN_vmaCheckDefragmentationBreakFunction
5553+
5554+
55485555
-- | VmaDefragmentationInfo
55495556
--
55505557
-- Parameters for defragmentation.
@@ -5567,22 +5574,31 @@ data DefragmentationInfo = DefragmentationInfo
55675574
--
55685575
-- @0@ means no limit.
55695576
maxAllocationsPerPass :: Word32
5577+
, -- | Optional custom callback for stopping 'beginDefragmentation'.
5578+
--
5579+
-- Have to return true for breaking current defragmentation pass.
5580+
pfnBreakCallback :: PFN_vmaCheckDefragmentationBreakFunction
5581+
, -- | Optional data to pass to custom callback for stopping pass of
5582+
-- defragmentation.
5583+
breakCallbackUserData :: Ptr ()
55705584
}
5571-
deriving (Typeable, Eq)
5585+
deriving (Typeable)
55725586
#if defined(GENERIC_INSTANCES)
55735587
deriving instance Generic (DefragmentationInfo)
55745588
#endif
55755589
deriving instance Show DefragmentationInfo
55765590

55775591
instance ToCStruct DefragmentationInfo where
5578-
withCStruct x f = allocaBytes 32 $ \p -> pokeCStruct p x (f p)
5592+
withCStruct x f = allocaBytes 48 $ \p -> pokeCStruct p x (f p)
55795593
pokeCStruct p DefragmentationInfo{..} f = do
55805594
poke ((p `plusPtr` 0 :: Ptr DefragmentationFlags)) (flags)
55815595
poke ((p `plusPtr` 8 :: Ptr Pool)) (pool)
55825596
poke ((p `plusPtr` 16 :: Ptr DeviceSize)) (maxBytesPerPass)
55835597
poke ((p `plusPtr` 24 :: Ptr Word32)) (maxAllocationsPerPass)
5598+
poke ((p `plusPtr` 32 :: Ptr PFN_vmaCheckDefragmentationBreakFunction)) (pfnBreakCallback)
5599+
poke ((p `plusPtr` 40 :: Ptr (Ptr ()))) (breakCallbackUserData)
55845600
f
5585-
cStructSize = 32
5601+
cStructSize = 48
55865602
cStructAlignment = 8
55875603
pokeZeroCStruct p f = do
55885604
poke ((p `plusPtr` 0 :: Ptr DefragmentationFlags)) (zero)
@@ -5596,11 +5612,18 @@ instance FromCStruct DefragmentationInfo where
55965612
pool <- peek @Pool ((p `plusPtr` 8 :: Ptr Pool))
55975613
maxBytesPerPass <- peek @DeviceSize ((p `plusPtr` 16 :: Ptr DeviceSize))
55985614
maxAllocationsPerPass <- peek @Word32 ((p `plusPtr` 24 :: Ptr Word32))
5615+
pfnBreakCallback <- peek @PFN_vmaCheckDefragmentationBreakFunction ((p `plusPtr` 32 :: Ptr PFN_vmaCheckDefragmentationBreakFunction))
5616+
pBreakCallbackUserData <- peek @(Ptr ()) ((p `plusPtr` 40 :: Ptr (Ptr ())))
55995617
pure $ DefragmentationInfo
5600-
flags pool maxBytesPerPass maxAllocationsPerPass
5618+
flags
5619+
pool
5620+
maxBytesPerPass
5621+
maxAllocationsPerPass
5622+
pfnBreakCallback
5623+
pBreakCallbackUserData
56015624

56025625
instance Storable DefragmentationInfo where
5603-
sizeOf ~_ = 32
5626+
sizeOf ~_ = 48
56045627
alignment ~_ = 8
56055628
peek = peekCStruct
56065629
poke ptr poked = pokeCStruct ptr poked (pure ())
@@ -5611,6 +5634,8 @@ instance Zero DefragmentationInfo where
56115634
zero
56125635
zero
56135636
zero
5637+
zero
5638+
zero
56145639

56155640

56165641
-- | VmaDefragmentationMove

generate-new/readme.md

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ In an environment with `doxygen` (`nix-shell -p doxygen`), in the
3636
sed -i -e 's|^GENERATE_DOCBOOK.*|GENERATE_DOCBOOK=YES|' \
3737
-e 's|^BRIEF_MEMBER_DESC.*|BRIEF_MEMBER_DESC=NO|' \
3838
-e 's|^PREDEFINED *=|PREDEFINED = VMA_STATS_STRING_ENABLED=1 |' \
39+
-e 's|^PREDEFINED *=|PREDEFINED = VMA_EXTENDS_VK_STRUCT(s)=s |' \
40+
-e 's|@CMAKE_SOURCE_DIR@/||' \
3941
Doxyfile &&
4042
doxygen Doxyfile)
4143
```

0 commit comments

Comments
 (0)