typedef VkResult (VKAPI *PFN_vkMergePipelineCaches)(VkDevice device, VkPipelineCache destCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches);
typedef VkResult (VKAPI *PFN_vkCreateGraphicsPipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, const VkGraphicsPipelineCreateInfo* pCreateInfos, VkPipeline* pPipelines);
typedef VkResult (VKAPI *PFN_vkCreateComputePipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, const VkComputePipelineCreateInfo* pCreateInfos, VkPipeline* pPipelines);
+typedef VkResult (VKAPI *PFN_vkDestroyPipeline)(VkDevice device, VkPipeline pipeline);
typedef VkResult (VKAPI *PFN_vkCreatePipelineLayout)(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, VkPipelineLayout* pPipelineLayout);
typedef VkResult (VKAPI *PFN_vkCreateSampler)(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, VkSampler* pSampler);
typedef VkResult (VKAPI *PFN_vkCreateDescriptorSetLayout)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayout* pSetLayout);
const VkComputePipelineCreateInfo* pCreateInfos,
VkPipeline* pPipelines);
+VkResult VKAPI vkDestroyPipeline(
+ VkDevice device,
+ VkPipeline pipeline);
+
VkResult VKAPI vkCreatePipelineLayout(
VkDevice device,
const VkPipelineLayoutCreateInfo* pCreateInfo,
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);
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
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,