Merge pull request #121 from expipiplus1/joe-len

Add missing length annotation in vmaAllocateMemoryPages
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 ad5ce69..3e2a530 100644
--- a/src/vk_mem_alloc.h
+++ b/src/vk_mem_alloc.h
@@ -2331,7 +2331,7 @@
 
     Starting from version 3.0.0 this member is no longer optional, it must be set!
     */
-    VkInstance VMA_NOT_NULL_NON_DISPATCHABLE instance;
+    VkInstance VMA_NOT_NULL instance;
     /** \brief Optional. The highest version of Vulkan that the application is designed to use.
     
     It must be a value in the format as created by macro `VK_MAKE_VERSION` or a constant like: `VK_API_VERSION_1_1`, `VK_API_VERSION_1_0`.
@@ -3481,7 +3481,7 @@
 
     Passing null means that only CPU defragmentation will be performed.
     */
-    VkCommandBuffer VMA_NULLABLE_NON_DISPATCHABLE commandBuffer;
+    VkCommandBuffer VMA_NULLABLE commandBuffer;
 } VmaDefragmentationInfo2;
 
 typedef struct VmaDefragmentationPassMoveInfo {
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')