anv: move to using vk_alloc helpers.

This moves all the alloc/free in anv to the generic helpers.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Dave Airlie
2016-10-14 13:31:35 +10:00
parent 0cfd428aef
commit 1ae6ece980
18 changed files with 103 additions and 147 deletions

View File

@@ -222,7 +222,7 @@ anv_image_create(VkDevice _device,
anv_assert(pCreateInfo->extent.height > 0);
anv_assert(pCreateInfo->extent.depth > 0);
image = anv_alloc2(&device->alloc, alloc, sizeof(*image), 8,
image = vk_alloc2(&device->alloc, alloc, sizeof(*image), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (!image)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
@@ -251,7 +251,7 @@ anv_image_create(VkDevice _device,
fail:
if (image)
anv_free2(&device->alloc, alloc, image);
vk_free2(&device->alloc, alloc, image);
return r;
}
@@ -276,7 +276,7 @@ anv_DestroyImage(VkDevice _device, VkImage _image,
{
ANV_FROM_HANDLE(anv_device, device, _device);
anv_free2(&device->alloc, pAllocator, anv_image_from_handle(_image));
vk_free2(&device->alloc, pAllocator, anv_image_from_handle(_image));
}
VkResult anv_BindImageMemory(
@@ -411,7 +411,7 @@ anv_CreateImageView(VkDevice _device,
ANV_FROM_HANDLE(anv_image, image, pCreateInfo->image);
struct anv_image_view *iview;
iview = anv_alloc2(&device->alloc, pAllocator, sizeof(*iview), 8,
iview = vk_alloc2(&device->alloc, pAllocator, sizeof(*iview), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (iview == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
@@ -580,7 +580,7 @@ anv_DestroyImageView(VkDevice _device, VkImageView _iview,
iview->storage_surface_state);
}
anv_free2(&device->alloc, pAllocator, iview);
vk_free2(&device->alloc, pAllocator, iview);
}
@@ -594,7 +594,7 @@ anv_CreateBufferView(VkDevice _device,
ANV_FROM_HANDLE(anv_buffer, buffer, pCreateInfo->buffer);
struct anv_buffer_view *view;
view = anv_alloc2(&device->alloc, pAllocator, sizeof(*view), 8,
view = vk_alloc2(&device->alloc, pAllocator, sizeof(*view), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (!view)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
@@ -663,7 +663,7 @@ anv_DestroyBufferView(VkDevice _device, VkBufferView bufferView,
anv_state_pool_free(&device->surface_state_pool,
view->storage_surface_state);
anv_free2(&device->alloc, pAllocator, view);
vk_free2(&device->alloc, pAllocator, view);
}
const struct anv_surface *