vk/image: Add an explicit DestroyImage function
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 10 Jul 2015 19:30:58 +0000 (12:30 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 10 Jul 2015 19:30:58 +0000 (12:30 -0700)
src/vulkan/device.c
src/vulkan/image.c
src/vulkan/private.h

index e9c3eebea96754d47f90d687b545bad65988739f..6efcfbdf4700945b4c8d57e474fa46ef7f1d5901 100644 (file)
@@ -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:
index 5f82ed369cbf9048ae11b66dcf91c799998d5d28..5b042a0e297c1d5c4cda42c148cf6874f3260780 100644 (file)
@@ -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,
index 91f3e50b5d8281a60d6101ec444f49f099262147..c374311fc998055ed8e8221b45d1683c70c75935 100644 (file)
@@ -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,