return VK_SUCCESS;
case VK_OBJECT_TYPE_BUFFER:
- case VK_OBJECT_TYPE_BUFFER_VIEW:
case VK_OBJECT_TYPE_IMAGE:
- case VK_OBJECT_TYPE_IMAGE_VIEW:
- case VK_OBJECT_TYPE_COLOR_ATTACHMENT_VIEW:
case VK_OBJECT_TYPE_DEPTH_STENCIL_VIEW:
case VK_OBJECT_TYPE_SHADER:
case VK_OBJECT_TYPE_PIPELINE_LAYOUT:
case VK_OBJECT_TYPE_FENCE:
case VK_OBJECT_TYPE_QUERY_POOL:
case VK_OBJECT_TYPE_FRAMEBUFFER:
+ case VK_OBJECT_TYPE_BUFFER_VIEW:
+ case VK_OBJECT_TYPE_IMAGE_VIEW:
+ case VK_OBJECT_TYPE_COLOR_ATTACHMENT_VIEW:
(object->destructor)(device, object, objType);
return VK_SUCCESS;
if (view == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
+ view->base.destructor = anv_surface_view_destroy;
+
view->bo = buffer->bo;
view->offset = buffer->offset + pCreateInfo->offset;
view->surface_state =
stub_return(VK_UNSUPPORTED);
}
+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 *)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);
+}
+
void
anv_image_view_init(struct anv_surface_view *view,
struct anv_device *device,
anv_image_view_init(view, device, pCreateInfo, NULL);
+ view->base.destructor = anv_surface_view_destroy;
+
*pView = (VkImageView) view;
return VK_SUCCESS;
anv_color_attachment_view_init(view, device, pCreateInfo, NULL);
+ view->base.destructor = anv_surface_view_destroy;
+
*pView = (VkColorAttachmentView) view;
return VK_SUCCESS;
};
struct anv_surface_view {
+ struct anv_object base;
+
struct anv_state surface_state;
struct anv_bo * bo;
uint32_t offset;
const VkColorAttachmentViewCreateInfo* pCreateInfo,
struct anv_cmd_buffer *cmd_buffer);
+void anv_surface_view_destroy(struct anv_device *device,
+ struct anv_object *obj, VkObjectType obj_type);
+
struct anv_sampler {
uint32_t state[4];
};