From: Chad Versace Date: Tue, 14 Jul 2015 17:16:22 +0000 (-0700) Subject: vk/0.132: Add vkDestroyShader() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cb57bff36c5b8f449f4f9738e71d5359d9090fc8;p=mesa.git vk/0.132: Add vkDestroyShader() --- diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index 015ab11d890..91d67156126 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -2038,6 +2038,7 @@ typedef VkResult (VKAPI *PFN_vkCreateDepthStencilView)(VkDevice device, const Vk typedef VkResult (VKAPI *PFN_vkCreateShaderModule)(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, VkShaderModule* pShaderModule); typedef VkResult (VKAPI *PFN_vkDestroyShaderModule)(VkDevice device, VkShaderModule shaderModule); typedef VkResult (VKAPI *PFN_vkCreateShader)(VkDevice device, const VkShaderCreateInfo* pCreateInfo, VkShader* pShader); +typedef VkResult (VKAPI *PFN_vkDestroyShader)(VkDevice device, VkShader shader); typedef VkResult (VKAPI *PFN_vkCreatePipelineCache)(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, VkPipelineCache* pPipelineCache); typedef size_t (VKAPI *PFN_vkGetPipelineCacheSize)(VkDevice device, VkPipelineCache pipelineCache); typedef VkResult (VKAPI *PFN_vkGetPipelineCacheData)(VkDevice device, VkPipelineCache pipelineCache, void* pData); @@ -2402,6 +2403,10 @@ VkResult VKAPI vkCreateShader( const VkShaderCreateInfo* pCreateInfo, VkShader* pShader); +VkResult VKAPI vkDestroyShader( + VkDevice device, + VkShader shader); + VkResult VKAPI vkCreatePipelineCache( VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, diff --git a/src/vulkan/device.c b/src/vulkan/device.c index 76c44ba507e..2c110726d5f 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -1232,6 +1232,8 @@ VkResult anv_DestroyObject( return anv_DestroyShaderModule(_device, (VkShaderModule) _object); case VK_OBJECT_TYPE_SHADER: + return anv_DestroyShader(_device, (VkShader) _object); + case VK_OBJECT_TYPE_PIPELINE_LAYOUT: case VK_OBJECT_TYPE_SAMPLER: case VK_OBJECT_TYPE_DESCRIPTOR_SET: diff --git a/src/vulkan/pipeline.c b/src/vulkan/pipeline.c index 76a38250701..991ab9f21c2 100644 --- a/src/vulkan/pipeline.c +++ b/src/vulkan/pipeline.c @@ -98,6 +98,19 @@ VkResult anv_CreateShader( return VK_SUCCESS; } +VkResult anv_DestroyShader( + VkDevice _device, + VkShader _shader) +{ + ANV_FROM_HANDLE(anv_device, device, _device); + ANV_FROM_HANDLE(anv_shader, shader, _shader); + + anv_device_free(device, shader); + + return VK_SUCCESS; +} + + VkResult anv_CreatePipelineCache( VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo,