summaryrefslogtreecommitdiffstats
path: root/src/vulkan/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vulkan/image.c')
-rw-r--r--src/vulkan/image.c43
1 files changed, 32 insertions, 11 deletions
diff --git a/src/vulkan/image.c b/src/vulkan/image.c
index d63ae1dfed8..5f82ed369cb 100644
--- a/src/vulkan/image.c
+++ b/src/vulkan/image.c
@@ -317,14 +317,8 @@ VkResult anv_GetImageSubresourceLayout(
void
anv_surface_view_destroy(struct anv_device *device,
- struct anv_object *obj, VkObjectType obj_type)
+ struct anv_surface_view *view)
{
- struct anv_surface_view *view = (struct anv_surface_view *)obj;
-
- assert(obj_type == VK_OBJECT_TYPE_BUFFER_VIEW ||
- obj_type == VK_OBJECT_TYPE_IMAGE_VIEW ||
- obj_type == VK_OBJECT_TYPE_COLOR_ATTACHMENT_VIEW);
-
anv_state_pool_free(&device->surface_state_pool, view->surface_state);
anv_device_free(device, view);
@@ -544,13 +538,21 @@ anv_CreateImageView(VkDevice _device,
anv_image_view_init(view, device, pCreateInfo, NULL);
- view->base.destructor = anv_surface_view_destroy;
-
*pView = (VkImageView) view;
return VK_SUCCESS;
}
+VkResult
+anv_DestroyImageView(VkDevice _device, VkImageView _view)
+{
+ ANV_FROM_HANDLE(anv_device, device, _device);
+
+ anv_surface_view_destroy(device, (struct anv_surface_view *)_view);
+
+ return VK_SUCCESS;
+}
+
void
anv_color_attachment_view_init(struct anv_surface_view *view,
struct anv_device *device,
@@ -664,14 +666,22 @@ anv_CreateColorAttachmentView(VkDevice _device,
anv_color_attachment_view_init(view, device, pCreateInfo, NULL);
- view->base.destructor = anv_surface_view_destroy;
-
*pView = (VkColorAttachmentView) view;
return VK_SUCCESS;
}
VkResult
+anv_DestroyColorAttachmentView(VkDevice _device, VkColorAttachmentView _view)
+{
+ ANV_FROM_HANDLE(anv_device, device, _device);
+
+ anv_surface_view_destroy(device, (struct anv_surface_view *)_view);
+
+ return VK_SUCCESS;
+}
+
+VkResult
anv_CreateDepthStencilView(VkDevice _device,
const VkDepthStencilViewCreateInfo *pCreateInfo,
VkDepthStencilView *pView)
@@ -711,3 +721,14 @@ anv_CreateDepthStencilView(VkDevice _device,
return VK_SUCCESS;
}
+
+VkResult
+anv_DestroyDepthStencilView(VkDevice _device, VkDepthStencilView _view)
+{
+ ANV_FROM_HANDLE(anv_device, device, _device);
+ ANV_FROM_HANDLE(anv_depth_stencil_view, view, _view);
+
+ anv_device_free(device, view);
+
+ return VK_SUCCESS;
+}