vk/0.210.0: Rework allocation to use the new pAllocator's
diff --git a/src/vulkan/anv_image.c b/src/vulkan/anv_image.c
index db52078..c831d75 100644
--- a/src/vulkan/anv_image.c
+++ b/src/vulkan/anv_image.c
@@ -292,6 +292,7 @@
 VkResult
 anv_image_create(VkDevice _device,
                  const struct anv_image_create_info *create_info,
+                 const VkAllocationCallbacks* alloc,
                  VkImage *pImage)
 {
    ANV_FROM_HANDLE(anv_device, device, _device);
@@ -321,8 +322,8 @@
    assert(extent->height <= limits->height);
    assert(extent->depth <= limits->depth);
 
-   image = anv_device_alloc(device, sizeof(*image), 8,
-                            VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
+   image = anv_alloc2(&device->alloc, alloc, sizeof(*image), 8,
+                      VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
    if (!image)
       return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
 
@@ -374,7 +375,7 @@
 
 fail:
    if (image)
-      anv_device_free(device, image);
+      anv_free2(&device->alloc, alloc, image);
 
    return r;
 }
@@ -382,21 +383,24 @@
 VkResult
 anv_CreateImage(VkDevice device,
                 const VkImageCreateInfo *pCreateInfo,
+                const VkAllocationCallbacks *pAllocator,
                 VkImage *pImage)
 {
    return anv_image_create(device,
       &(struct anv_image_create_info) {
          .vk_info = pCreateInfo,
       },
+      pAllocator,
       pImage);
 }
 
 void
-anv_DestroyImage(VkDevice _device, VkImage _image)
+anv_DestroyImage(VkDevice _device, VkImage _image,
+                 const VkAllocationCallbacks *pAllocator)
 {
    ANV_FROM_HANDLE(anv_device, device, _device);
 
-   anv_device_free(device, anv_image_from_handle(_image));
+   anv_free2(&device->alloc, pAllocator, anv_image_from_handle(_image));
 }
 
 static void
@@ -453,6 +457,7 @@
 VkResult
 anv_validate_CreateImageView(VkDevice _device,
                              const VkImageViewCreateInfo *pCreateInfo,
+                             const VkAllocationCallbacks *pAllocator,
                              VkImageView *pView)
 {
    ANV_FROM_HANDLE(anv_image, image, pCreateInfo->image);
@@ -531,7 +536,7 @@
       assert(!"bad VkImageSubresourceRange::aspectFlags");
    }
 
-   return anv_CreateImageView(_device, pCreateInfo, pView);
+   return anv_CreateImageView(_device, pCreateInfo, pAllocator, pView);
 }
 
 void
@@ -584,13 +589,14 @@
 VkResult
 anv_CreateImageView(VkDevice _device,
                     const VkImageViewCreateInfo *pCreateInfo,
+                    const VkAllocationCallbacks *pAllocator,
                     VkImageView *pView)
 {
    ANV_FROM_HANDLE(anv_device, device, _device);
    struct anv_image_view *view;
 
-   view = anv_device_alloc(device, sizeof(*view), 8,
-                           VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
+   view = anv_alloc2(&device->alloc, pAllocator, sizeof(*view), 8,
+                     VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
    if (view == NULL)
       return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
 
@@ -601,10 +607,13 @@
    return VK_SUCCESS;
 }
 
-static void
-anv_image_view_destroy(struct anv_device *device,
-                       struct anv_image_view *iview)
+void
+anv_DestroyImageView(VkDevice _device, VkImageView _iview,
+                     const VkAllocationCallbacks *pAllocator)
 {
+   ANV_FROM_HANDLE(anv_device, device, _device);
+   ANV_FROM_HANDLE(anv_image_view, iview, _iview);
+
    if (iview->image->needs_color_rt_surface_state) {
       anv_state_pool_free(&device->surface_state_pool,
                           iview->color_rt_surface_state);
@@ -615,16 +624,7 @@
                           iview->nonrt_surface_state);
    }
 
-   anv_device_free(device, iview);
-}
-
-void
-anv_DestroyImageView(VkDevice _device, VkImageView _iview)
-{
-   ANV_FROM_HANDLE(anv_device, device, _device);
-   ANV_FROM_HANDLE(anv_image_view, iview, _iview);
-
-   anv_image_view_destroy(device, iview);
+   anv_free2(&device->alloc, pAllocator, iview);
 }
 
 struct anv_surface *