Merge pull request #122 from expipiplus1/joe-120
Return VkResult in vmaInvalidateAllocation and vmaFlushAllocation
diff --git a/README.md b/README.md
index 26af239..b583893 100644
--- a/README.md
+++ b/README.md
@@ -125,5 +125,6 @@
- **[VulkanMemoryAllocator-Hpp](https://github.com/malte-v/VulkanMemoryAllocator-Hpp)** - C++ binding for this library. License: CC0-1.0.
- **[PyVMA](https://github.com/realitix/pyvma)** - Python wrapper for this library. Author: Jean-Sébastien B. (@realitix). License: Apache 2.0.
- **[vk-mem](https://github.com/gwihlidal/vk-mem-rs)** - Rust binding for this library. Author: Graham Wihlidal. License: Apache 2.0 or MIT.
+- **[Haskell bindings](https://hackage.haskell.org/package/VulkanMemoryAllocator)**, **[github](https://github.com/expipiplus1/vulkan/tree/master/VulkanMemoryAllocator)** - Haskell bindings for this library. Author: Joe Hermaszewski (@expipiplus1). License BSD-3-Clause.
- **[vma_sample_sdl](https://github.com/rextimmy/vma_sample_sdl)** - SDL port of the sample app of this library (with the goal of running it on multiple platforms, including MacOS). Author: @rextimmy. License: MIT.
- **[vulkan-malloc](https://github.com/dylanede/vulkan-malloc)** - Vulkan memory allocation library for Rust. Based on version 1 of this library. Author: Dylan Ede (@dylanede). License: MIT / Apache 2.0.
diff --git a/src/vk_mem_alloc.h b/src/vk_mem_alloc.h
index ccd5c71..724ff8a 100644
--- a/src/vk_mem_alloc.h
+++ b/src/vk_mem_alloc.h
@@ -3139,8 +3139,8 @@
*/
VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryPages(
VmaAllocator VMA_NOT_NULL allocator,
- const VkMemoryRequirements* VMA_NOT_NULL pVkMemoryRequirements,
- const VmaAllocationCreateInfo* VMA_NOT_NULL pCreateInfo,
+ const VkMemoryRequirements* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pVkMemoryRequirements,
+ const VmaAllocationCreateInfo* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pCreateInfo,
size_t allocationCount,
VmaAllocation VMA_NULLABLE * VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(allocationCount) pAllocations,
VmaAllocationInfo* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) pAllocationInfo);
diff --git a/tools/VmaDumpVis/VmaDumpVis.py b/tools/VmaDumpVis/VmaDumpVis.py
index f5a38b1..519ee30 100644
--- a/tools/VmaDumpVis/VmaDumpVis.py
+++ b/tools/VmaDumpVis/VmaDumpVis.py
@@ -66,6 +66,20 @@
return newMemTypeData
+def IsDataEmpty():
+ global data
+ for dictMemType in data.values():
+ if 'DedicatedAllocations' in dictMemType and len(dictMemType['DedicatedAllocations']) > 0:
+ return False
+ if 'DefaultPoolBlocks' in dictMemType and len(dictMemType['DefaultPoolBlocks']) > 0:
+ return False
+ if 'CustomPools' in dictMemType:
+ for lBlockList in dictMemType['CustomPools'].values():
+ if len(lBlockList) > 0:
+ return False
+ return True
+
+
# Returns tuple:
# [0] image height : integer
# [1] pixels per byte : float
@@ -204,6 +218,10 @@
for sBlockId, objBlock in objBlocks.items():
ProcessBlock(dstBlockArray, int(sBlockId), objBlock, sAlgorithm)
+if IsDataEmpty():
+ print("There is nothing to put on the image. Please make sure you generated the stats string with detailed map enabled.")
+ exit(1)
+
iImgSizeY, fPixelsPerByte = CalcParams()
img = Image.new('RGB', (IMG_SIZE_X, iImgSizeY), 'white')