From 8b342b39a3f2779fdf112fb839af5b0d69808235 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 10 Jul 2015 12:30:58 -0700 Subject: [PATCH] vk/image: Add an explicit DestroyImage function --- src/vulkan/device.c | 4 +++- src/vulkan/image.c | 10 ++++++++++ src/vulkan/private.h | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/vulkan/device.c b/src/vulkan/device.c index e9c3eebea96..6efcfbdf470 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -1171,8 +1171,10 @@ VkResult anv_DestroyObject( case VK_OBJECT_TYPE_DEPTH_STENCIL_VIEW: return anv_DestroyDepthStencilView(_device, _object); - case VK_OBJECT_TYPE_BUFFER: case VK_OBJECT_TYPE_IMAGE: + return anv_DestroyImage(_device, _object); + + case VK_OBJECT_TYPE_BUFFER: case VK_OBJECT_TYPE_SHADER: case VK_OBJECT_TYPE_SHADER_MODULE: case VK_OBJECT_TYPE_PIPELINE_LAYOUT: diff --git a/src/vulkan/image.c b/src/vulkan/image.c index 5f82ed369cb..5b042a0e297 100644 --- a/src/vulkan/image.c +++ b/src/vulkan/image.c @@ -306,6 +306,16 @@ anv_CreateImage(VkDevice device, pImage); } +VkResult +anv_DestroyImage(VkDevice _device, VkImage _image) +{ + ANV_FROM_HANDLE(anv_device, device, _device); + + anv_device_free(device, anv_image_from_handle(_image)); + + return VK_SUCCESS; +} + VkResult anv_GetImageSubresourceLayout( VkDevice device, VkImage image, diff --git a/src/vulkan/private.h b/src/vulkan/private.h index 91f3e50b5d8..c374311fc99 100644 --- a/src/vulkan/private.h +++ b/src/vulkan/private.h @@ -943,6 +943,7 @@ anv_cmd_buffer_clear(struct anv_cmd_buffer *cmd_buffer, void * anv_lookup_entrypoint(const char *name); +VkResult anv_DestroyImage(VkDevice device, VkImage image); VkResult anv_DestroyImageView(VkDevice device, VkImageView imageView); VkResult anv_DestroyBufferView(VkDevice device, VkBufferView bufferView); VkResult anv_DestroyColorAttachmentView(VkDevice device, -- 2.30.2