packages feed

VulkanMemoryAllocator 0.3.3 → 0.3.4

raw patch · 4 files changed

+28/−6 lines, 4 filesdep ~vulkanPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: vulkan

API changes (from Hackage documentation)

Files

VulkanMemoryAllocator.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 14d8f4ba2a1915454c61747c37a201aa9946075ac33cf4e761fba42e1d63df37+-- hash: a3c9dcb12307cb0afb6abed844197811576c6f4cf4bd75b68a5c6e6028f9ed35  name:           VulkanMemoryAllocator-version:        0.3.3+version:        0.3.4 synopsis:       Bindings to the VulkanMemoryAllocator library category:       Graphics homepage:       https://github.com/expipiplus1/vulkan#readme@@ -64,7 +64,7 @@     , bytestring     , transformers     , vector-    , vulkan ==3.5.*+    , vulkan ==3.6.*   if flag(safe-foreign-calls)     cpp-options: -DSAFE_FOREIGN_CALLS   if flag(vma-ndebug)
VulkanMemoryAllocator/src/vk_mem_alloc.h view
@@ -25,7 +25,7 @@ 
 /** \mainpage Vulkan Memory Allocator
 
-<b>Version 3.0.0-development</b> (2020-03-23)
+<b>Version 3.0.0-development</b> (2020-06-24)
 
 Copyright (c) 2017-2020 Advanced Micro Devices, Inc. All rights reserved. \n
 License: MIT
@@ -1880,6 +1880,7 @@   objects in CPU memory (not Vulkan memory), allocation failures are not checked
   and handled gracefully, because that would complicate code significantly and
   is usually not needed in desktop PC applications anyway.
+  Success of an allocation is just checked with an assert.
 - Code free of any compiler warnings. Maintaining the library to compile and
   work correctly on so many different platforms is hard enough. Being free of 
   any warnings, on any version of any compiler, is simply not feasible.
@@ -3092,6 +3093,12 @@     /** \brief Size of this allocation, in bytes.
 
     It never changes, unless allocation is lost.
+
+    \note Allocation size returned in this variable may be greater than the size
+    requested for the resource e.g. as `VkBufferCreateInfo::size`. Whole size of the
+    allocation is accessible for operations on memory e.g. using a pointer after
+    mapping with vmaMapMemory(), but operations on the resource e.g. using
+    `vkCmdCopyBuffer` must be limited to the size of the resource.
     */
     VkDeviceSize size;
     /** \brief Pointer to the beginning of this allocation as mapped data.
@@ -4626,10 +4633,11 @@ 
 static void* VmaMalloc(const VkAllocationCallbacks* pAllocationCallbacks, size_t size, size_t alignment)
 {
+    void* result = VMA_NULL;
     if((pAllocationCallbacks != VMA_NULL) &&
         (pAllocationCallbacks->pfnAllocation != VMA_NULL))
     {
-        return (*pAllocationCallbacks->pfnAllocation)(
+        result = (*pAllocationCallbacks->pfnAllocation)(
             pAllocationCallbacks->pUserData,
             size,
             alignment,
@@ -4637,8 +4645,10 @@     }
     else
     {
-        return VMA_SYSTEM_ALIGNED_MALLOC(size, alignment);
+        result = VMA_SYSTEM_ALIGNED_MALLOC(size, alignment);
     }
+    VMA_ASSERT(result != VMA_NULL && "CPU memory allocation failed.");
+    return result;
 }
 
 static void VmaFree(const VkAllocationCallbacks* pAllocationCallbacks, void* ptr)
changelog.md view
@@ -2,6 +2,9 @@  ## WIP +## [0.3.4] - 2020-07-05+  - Bump VMA, just documentation change+ ## [0.3.3] - 2020-06-22   - Bump VMA 
src/VulkanMemoryAllocator.hs view
@@ -4137,6 +4137,15 @@   , -- | Size of this allocation, in bytes.     --     -- It never changes, unless allocation is lost.+    --+    -- Note+    --+    -- Allocation size returned in this variable may be greater than the size+    -- requested for the resource e.g. as @VkBufferCreateInfo::size@. Whole+    -- size of the allocation is accessible for operations on memory e.g. using+    -- a pointer after mapping with 'mapMemory', but operations on the resource+    -- e.g. using @vkCmdCopyBuffer@ must be limited to the size of the+    -- resource.     size :: DeviceSize   , -- | Pointer to the beginning of this allocation as mapped data.     --