summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2015-07-14 10:26:17 -0700
committerChad Versace <[email protected]>2015-07-14 10:26:17 -0700
commit6e5ab5cf1bdac9292b512bbbe10da44558fe1bc0 (patch)
treea7dcdd8da97f9d458769049f3c940c45b89f124b /src
parent114015321eb3998e2814687e3584994bc061a33b (diff)
vk/0.132: Add vkDestroyPipeline()
Diffstat (limited to 'src')
-rw-r--r--src/vulkan/device.c4
-rw-r--r--src/vulkan/pipeline.c23
2 files changed, 21 insertions, 6 deletions
diff --git a/src/vulkan/device.c b/src/vulkan/device.c
index 599475135e7..43724641c08 100644
--- a/src/vulkan/device.c
+++ b/src/vulkan/device.c
@@ -1249,12 +1249,14 @@ VkResult anv_DestroyObject(
return VK_SUCCESS;
case VK_OBJECT_TYPE_COMMAND_BUFFER:
- case VK_OBJECT_TYPE_PIPELINE:
case VK_OBJECT_TYPE_DYNAMIC_VP_STATE:
case VK_OBJECT_TYPE_FRAMEBUFFER:
(object->destructor)(device, object, objType);
return VK_SUCCESS;
+ case VK_OBJECT_TYPE_PIPELINE:
+ return anv_DestroyPipeline(_device, (VkPipeline) _object);
+
case VK_OBJECT_TYPE_QUERY_POOL:
return anv_DestroyQueryPool(_device, (VkQueryPool) _object);
diff --git a/src/vulkan/pipeline.c b/src/vulkan/pipeline.c
index d21af0ff8b4..3d67a3a1b6d 100644
--- a/src/vulkan/pipeline.c
+++ b/src/vulkan/pipeline.c
@@ -476,11 +476,8 @@ anv_pipeline_destroy(struct anv_device *device,
assert(obj_type == VK_OBJECT_TYPE_PIPELINE);
- anv_compiler_free(pipeline);
- anv_reloc_list_finish(&pipeline->batch.relocs, pipeline->device);
- anv_state_stream_finish(&pipeline->program_stream);
- anv_state_pool_free(&device->dynamic_state_pool, pipeline->blend_state);
- anv_device_free(pipeline->device, pipeline);
+ anv_DestroyPipeline(anv_device_to_handle(device),
+ anv_pipeline_to_handle(pipeline));
}
VkResult
@@ -769,6 +766,22 @@ anv_pipeline_create(
return VK_SUCCESS;
}
+VkResult anv_DestroyPipeline(
+ VkDevice _device,
+ VkPipeline _pipeline)
+{
+ ANV_FROM_HANDLE(anv_device, device, _device);
+ ANV_FROM_HANDLE(anv_pipeline, pipeline, _pipeline);
+
+ anv_compiler_free(pipeline);
+ anv_reloc_list_finish(&pipeline->batch.relocs, pipeline->device);
+ anv_state_stream_finish(&pipeline->program_stream);
+ anv_state_pool_free(&device->dynamic_state_pool, pipeline->blend_state);
+ anv_device_free(pipeline->device, pipeline);
+
+ return VK_SUCCESS;
+}
+
VkResult anv_CreateGraphicsPipelines(
VkDevice _device,
VkPipelineCache pipelineCache,