Trivial removal because vkDestroyObject() no longer uses it.
stub_return(VK_UNSUPPORTED);
}
-static void
-anv_fence_destroy(struct anv_device *device,
- struct anv_object *object,
- VkObjectType obj_type)
-{
- struct anv_fence *fence = (struct anv_fence *) object;
-
- assert(obj_type == VK_OBJECT_TYPE_FENCE);
-
- anv_DestroyFence(anv_device_to_handle(device),
- anv_fence_to_handle(fence));
-}
-
VkResult anv_CreateFence(
VkDevice _device,
const VkFenceCreateInfo* pCreateInfo,
if (result != VK_SUCCESS)
goto fail;
- fence->base.destructor = anv_fence_destroy;
-
fence->bo.map =
anv_gem_mmap(device, fence->bo.gem_handle, 0, fence->bo.size);
batch.next = batch.start = fence->bo.map;
return max;
}
-static void
-anv_dynamic_vp_state_destroy(struct anv_device *device,
- struct anv_object *object,
- VkObjectType obj_type)
-{
- struct anv_dynamic_vp_state *vp_state = (void *) object;
-
- assert(obj_type == VK_OBJECT_TYPE_DYNAMIC_VP_STATE);
-
- anv_DestroyDynamicViewportState(anv_device_to_handle(device),
- anv_dynamic_vp_state_to_handle(vp_state));
-}
-
VkResult anv_CreateDynamicViewportState(
VkDevice _device,
const VkDynamicViewportStateCreateInfo* pCreateInfo,
if (state == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
- state->base.destructor = anv_dynamic_vp_state_destroy;
-
unsigned count = pCreateInfo->viewportAndScissorCount;
state->sf_clip_vp = anv_state_pool_alloc(&device->dynamic_state_pool,
count * 64, 64);
// Command buffer functions
-static void
-anv_cmd_buffer_destroy(struct anv_device *device,
- struct anv_object *object,
- VkObjectType obj_type)
-{
- struct anv_cmd_buffer *cmd_buffer = (struct anv_cmd_buffer *) object;
-
- assert(obj_type == VK_OBJECT_TYPE_COMMAND_BUFFER);
-
- anv_DestroyCommandBuffer(anv_device_to_handle(device),
- anv_cmd_buffer_to_handle(cmd_buffer));
-}
-
static VkResult
anv_cmd_buffer_chain_batch(struct anv_batch *batch, void *_data)
{
if (cmd_buffer == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
- cmd_buffer->base.destructor = anv_cmd_buffer_destroy;
-
cmd_buffer->device = device;
cmd_buffer->rs_state = NULL;
cmd_buffer->vp_state = NULL;
GEN8_PIPE_CONTROL_pack(&cmd_buffer->batch, dw, &cmd);
}
-static void
-anv_framebuffer_destroy(struct anv_device *device,
- struct anv_object *object,
- VkObjectType obj_type)
-{
- struct anv_framebuffer *fb = (struct anv_framebuffer *)object;
-
- assert(obj_type == VK_OBJECT_TYPE_FRAMEBUFFER);
-
- anv_DestroyFramebuffer(anv_device_to_handle(device),
- anv_framebuffer_to_handle(fb));
-}
-
VkResult anv_CreateFramebuffer(
VkDevice _device,
const VkFramebufferCreateInfo* pCreateInfo,
if (framebuffer == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
- framebuffer->base.destructor = anv_framebuffer_destroy;
-
framebuffer->attachment_count = pCreateInfo->attachmentCount;
for (uint32_t i = 0; i < pCreateInfo->attachmentCount; i++) {
ANV_FROM_HANDLE(anv_attachment_view, view,
GEN8_3DSTATE_WM_DEPTH_STENCIL_pack(NULL, pipeline->state_wm_depth_stencil, &wm_depth_stencil);
}
-static void
-anv_pipeline_destroy(struct anv_device *device,
- struct anv_object *object,
- VkObjectType obj_type)
-{
- struct anv_pipeline *pipeline = (struct anv_pipeline*) object;
-
- assert(obj_type == VK_OBJECT_TYPE_PIPELINE);
-
- anv_DestroyPipeline(anv_device_to_handle(device),
- anv_pipeline_to_handle(pipeline));
-}
-
VkResult
anv_pipeline_create(
VkDevice _device,
if (pipeline == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
- pipeline->base.destructor = anv_pipeline_destroy;
pipeline->device = device;
pipeline->layout = anv_pipeline_layout_from_handle(pCreateInfo->layout);
memset(pipeline->shaders, 0, sizeof(pipeline->shaders));
const VkGraphicsPipelineCreateInfo* pCreateInfos,
VkPipeline* pPipelines)
{
- ANV_FROM_HANDLE(anv_device, device, _device);
VkResult result = VK_SUCCESS;
unsigned i = 0;
NULL, &pPipelines[i]);
if (result != VK_SUCCESS) {
for (unsigned j = 0; j < i; j++) {
- anv_pipeline_destroy(device, (struct anv_object *)pPipelines[j],
- VK_OBJECT_TYPE_PIPELINE);
+ anv_DestroyPipeline(_device, pPipelines[j]);
}
return result;
if (pipeline == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
- pipeline->base.destructor = anv_pipeline_destroy;
pipeline->device = device;
pipeline->layout = anv_pipeline_layout_from_handle(pCreateInfo->layout);
const VkComputePipelineCreateInfo* pCreateInfos,
VkPipeline* pPipelines)
{
- ANV_FROM_HANDLE(anv_device, device, _device);
VkResult result = VK_SUCCESS;
unsigned i = 0;
&pPipelines[i]);
if (result != VK_SUCCESS) {
for (unsigned j = 0; j < i; j++) {
- anv_pipeline_destroy(device, (struct anv_object *)pPipelines[j],
- VK_OBJECT_TYPE_PIPELINE);
+ anv_DestroyPipeline(_device, pPipelines[j]);
}
return result;
VkResult anv_bo_pool_alloc(struct anv_bo_pool *pool, struct anv_bo *bo);
void anv_bo_pool_free(struct anv_bo_pool *pool, const struct anv_bo *bo);
-struct anv_object;
-struct anv_device;
-
-typedef void (*anv_object_destructor_cb)(struct anv_device *,
- struct anv_object *,
- VkObjectType);
-
-struct anv_object {
- anv_object_destructor_cb destructor;
-};
-
struct anv_physical_device {
struct anv_instance * instance;
uint32_t chipset_id;
};
struct anv_dynamic_vp_state {
- struct anv_object base;
struct anv_state sf_clip_vp;
struct anv_state cc_vp;
struct anv_state scissor;
};
struct anv_cmd_buffer {
- struct anv_object base;
struct anv_device * device;
struct drm_i915_gem_execbuffer2 execbuf;
void anv_aub_writer_destroy(struct anv_aub_writer *writer);
struct anv_fence {
- struct anv_object base;
struct anv_bo bo;
struct drm_i915_gem_execbuffer2 execbuf;
struct drm_i915_gem_exec_object2 exec2_objects[1];
};
struct anv_pipeline {
- struct anv_object base;
struct anv_device * device;
struct anv_batch batch;
uint32_t batch_data[256];
};
struct anv_framebuffer {
- struct anv_object base;
-
uint32_t width;
uint32_t height;
uint32_t layers;
};
struct anv_query_pool {
- struct anv_object base;
VkQueryType type;
uint32_t slots;
struct anv_bo bo;
};
-static void
-anv_query_pool_destroy(struct anv_device *device,
- struct anv_object *object,
- VkObjectType obj_type)
-{
- struct anv_query_pool *pool = (struct anv_query_pool *) object;
-
- assert(obj_type == VK_OBJECT_TYPE_QUERY_POOL);
-
- anv_DestroyQueryPool(anv_device_to_handle(device),
- anv_query_pool_to_handle(pool));
-}
-
VkResult anv_CreateQueryPool(
VkDevice _device,
const VkQueryPoolCreateInfo* pCreateInfo,
if (pool == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
- pool->base.destructor = anv_query_pool_destroy;
-
- pool->type = pCreateInfo->queryType;
size = pCreateInfo->slots * sizeof(struct anv_query_pool_slot);
result = anv_bo_init_new(&pool->bo, device, size);
if (result != VK_SUCCESS)