anv: Reject VkMemoryAllocateInfo::allocationSize == 0
authorChad Versace <chadversary@chromium.org>
Thu, 17 Nov 2016 20:45:26 +0000 (12:45 -0800)
committerChad Versace <chadversary@chromium.org>
Wed, 14 Dec 2016 20:04:58 +0000 (12:04 -0800)
The Vulkan 1.0.33 spec says "allocationSize must be greater than 0".

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
src/intel/vulkan/anv_device.c

index d594df7d3beb5273dc5834cabc2901544f1a5609..e3d278df733246943db391dd3ece1441be9b1d07 100644 (file)
@@ -1246,11 +1246,8 @@ VkResult anv_AllocateMemory(
 
    assert(pAllocateInfo->sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO);
 
-   if (pAllocateInfo->allocationSize == 0) {
-      /* Apparently, this is allowed */
-      *pMem = VK_NULL_HANDLE;
-      return VK_SUCCESS;
-   }
+   /* The Vulkan 1.0.33 spec says "allocationSize must be greater than 0". */
+   assert(pAllocateInfo->allocationSize > 0);
 
    /* We support exactly one memory heap. */
    assert(pAllocateInfo->memoryTypeIndex == 0 ||