From: Chad Versace Date: Tue, 14 Jul 2015 17:12:10 +0000 (-0700) Subject: vk/0.132: Add vkDestroyShaderModule() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8ae8e14ba7e5628f4bf3e396fe48f3b46649107b;p=mesa.git vk/0.132: Add vkDestroyShaderModule() --- diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index c4ab8c7da2a..015ab11d890 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -2036,6 +2036,7 @@ typedef VkResult (VKAPI *PFN_vkCreateImageView)(VkDevice device, const VkImageVi typedef VkResult (VKAPI *PFN_vkCreateColorAttachmentView)(VkDevice device, const VkColorAttachmentViewCreateInfo* pCreateInfo, VkColorAttachmentView* pView); typedef VkResult (VKAPI *PFN_vkCreateDepthStencilView)(VkDevice device, const VkDepthStencilViewCreateInfo* pCreateInfo, VkDepthStencilView* pView); 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_vkCreatePipelineCache)(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, VkPipelineCache* pPipelineCache); typedef size_t (VKAPI *PFN_vkGetPipelineCacheSize)(VkDevice device, VkPipelineCache pipelineCache); @@ -2392,6 +2393,10 @@ VkResult VKAPI vkCreateShaderModule( const VkShaderModuleCreateInfo* pCreateInfo, VkShaderModule* pShaderModule); +VkResult VKAPI vkDestroyShaderModule( + VkDevice device, + VkShaderModule shaderModule); + VkResult VKAPI vkCreateShader( VkDevice device, const VkShaderCreateInfo* pCreateInfo, diff --git a/src/vulkan/device.c b/src/vulkan/device.c index 0256b66791f..76c44ba507e 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -1228,8 +1228,10 @@ VkResult anv_DestroyObject( case VK_OBJECT_TYPE_BUFFER: return anv_DestroyBuffer(_device, (VkBuffer) _object); - case VK_OBJECT_TYPE_SHADER: case VK_OBJECT_TYPE_SHADER_MODULE: + return anv_DestroyShaderModule(_device, (VkShaderModule) _object); + + case VK_OBJECT_TYPE_SHADER: 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 6396e6cc0f6..76a38250701 100644 --- a/src/vulkan/pipeline.c +++ b/src/vulkan/pipeline.c @@ -55,6 +55,18 @@ VkResult anv_CreateShaderModule( return VK_SUCCESS; } +VkResult anv_DestroyShaderModule( + VkDevice _device, + VkShaderModule _module) +{ + ANV_FROM_HANDLE(anv_device, device, _device); + ANV_FROM_HANDLE(anv_shader_module, module, _module); + + anv_device_free(device, module); + + return VK_SUCCESS; +} + VkResult anv_CreateShader( VkDevice _device, const VkShaderCreateInfo* pCreateInfo,